Skip to content

API Versioning

PhantomJSON uses URI versioning for all API endpoints.

/v1/{resource}

All endpoints are prefixed with /v1:

Terminal window
curl https://api.phantomjson.app/v1/users
curl https://api.phantomjson.app/v1/posts
curl https://api.phantomjson.app/v1/products

URI versioning is chosen for PhantomJSON because:

  • Visible in URLs — Version is immediately apparent in browser, logs, and documentation
  • Easy to document — Clear which version an endpoint belongs to
  • Cache-friendly — Different versions have different URLs
  • Developer-friendly — No need to set headers or query params

When breaking changes are introduced, a new version will be available:

/v1/users → Current stable version
/v2/users → Next version (when released)

Both versions will coexist during transition periods.

  1. Always use the version prefix — Include /v1 in all API requests
  2. Check documentation — New features may be version-specific
  3. Migrate when ready — When a new version is released, migrate at your own pace