Skip to main content
Photon’s public HTTP API selects its contract from the Photon-Version request header. Send the header on every request:
2026-07-01 is the only supported API date today. The date is independent of the version of the TypeScript, Python, Rust, or Go package. Package SemVer controls the generated client code; it does not select an HTTP API contract.

Send a date

The API matches the value exactly. It does not normalize the value, choose the nearest date, or read the old X-Photon-Version header. A raw HTTP request can set the date like this:

Read the response

When a versioned endpoint accepts an explicit date, it echoes the selected date in the Photon-Version response header. The echo is present on successful responses and on application errors raised after the date is selected. Responses also include Vary: Photon-Version.
An error that rejects the date before selection, such as an invalid date or an exact retired date, has no Photon-Version response header. The same is true for the current missing-header fallback: a request without the header is served as 2026-07-01, but its response has no date echo. The missing-header fallback is being removed. Starting 2026-11-23, Photon removes it one API at a time. Once it is removed from an API, a request to that API without Photon-Version returns 400 INVALID_API_VERSION. Send the header now:
  • API clients and your own HTTP code: set the header on every request, as shown in Set the date in an API client.
  • Photon CLI: update to 3.2.0 or later, which sends the header.
  • Local MCP server (@photon-ai/mcp): a release that sends the header comes out before the switch. Update to it then. The hosted MCP server needs no change.

Handle version errors

Version errors are RFC 9457 problem documents. They include type, code, title, and status; detail and requestId can also be present. Version errors include supportedVersions, which lists the dates supported by that endpoint. For example, an invalid date returns a body like this:
See Handling errors for the common problem fields and matching rules.

Set the date in an API client

The generated clients do not send Photon-Version by default. Set it as a client-wide extra header so every request uses the same date.
TypeScript also accepts extra headers in a call’s second argument. Python accepts headers in an operation’s generated input when that operation declares them. Rust accepts dynamic headers with PhotonClientBuilder::headers, and Go accepts per-call headers with WithRequestHeader. Client-wide headers are the simplest way to make the date consistent across all requests.