HTTP headers
The headers a Fusion Stack API reads and sends. Each section links to the concept or feature behind it. The Laravel (PHP) and Laravel for Rust packages send the same ones; spec/README.md in the repository is the contract both implement.
Requests
| Header | What it does |
|---|---|
Authorization | Bearer fs_live_… with an API key, or a token from another configured guard, such as Sanctum. |
Api-Version | The version to use, such as 2026-06-01, instead of the key's pinned version or the default. Unknown versions get 400 invalid_api_version. Ignored while versioning is off. |
Idempotency-Key | A unique value, such as a UUID, of up to 255 characters. Sending the same request again with the same key replays the first response. See Idempotency. |
If-None-Match | An ETag from an earlier response. When it still matches, the response is 304 Not Modified with no body. |
X-Request-Id | Your own ID for the request, such as a trace ID: up to 128 letters, digits, ., _, : or -. Other values are replaced. |
Content-Type | application/vnd.api+json for JSON:API documents. Validation errors then point at /data/attributes/…. |
Responses
Every response
| Header | What it is |
|---|---|
X-Request-Id | The request's ID: yours, or a generated req_… one. It is also in each error's meta.request_id and in the log context. |
Api-Version | The version the response was served in. Sent while versioning is on. |
http
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
Api-Version: 2026-06-01
X-Request-Id: req_01m8rqk3gyc6efkra6dzkkyf61
RateLimit-Limit: 300
RateLimit-Remaining: 299
RateLimit-Reset: 59
ETag: W/"9a301b49ee9bf27c2b18312e0e0a2cab"
Cache-Control: no-cache, private
Vary: Api-Version, Authorization, AcceptRate limiting
See Rate limiting.
| Header | What it is |
|---|---|
RateLimit-Limit | How many requests the client may make in the window. |
RateLimit-Remaining | How many are left. |
RateLimit-Reset | Seconds until the window resets. |
Retry-After | On a 429 rate_limited: seconds to wait before trying again. Also sent with 410 api_version_brownout, until the brownout ends. |
Caching
See Caching.
| Header | What it is |
|---|---|
ETag | A weak ETag of a successful GET or HEAD response, different in each version. Send it back in If-None-Match. |
Cache-Control | private, no-cache unless the route sets its own with #[CacheControl], so clients revalidate every time. |
Vary | Api-Version, Authorization, Accept, so shared caches keep versions and callers apart. |
X-Response-Cache | hit or miss, on actions with #[CacheResponse]. |
Idempotency
| Header | What it is |
|---|---|
Idempotent-Replayed | true when the response is a replay of an earlier request with the same Idempotency-Key. |
Deprecation
Sent on responses served in a deprecated version.
| Header | What it is |
|---|---|
Deprecation | When the version was deprecated, as @ and a Unix timestamp (RFC 9745). |
Sunset | When the version will be retired, as an HTTP date (RFC 8594). |
Link | rel="deprecation", linking to api.versions.changelog_url or upgrade_guide_url. |
http
Deprecation: @1795996800
Sunset: Tue, 01 Jun 2027 00:00:00 GMT
Link: <https://example.com/changelog>; rel="deprecation"; type="text/html"Webhook deliveries
Each webhook is a POST with a JSON body and these headers:
| Header | What it is |
|---|---|
Webhook-Id | The event's ID, the same on every retry, so receivers can ignore duplicates. |
Webhook-Signature | t=<timestamp>,v1=<signature>: an HMAC-SHA256 of <timestamp>.<body> with the endpoint's secret. Check it with Signer::verify(), which also rejects signatures older than five minutes. |
User-Agent | Fusion Stack Webhooks. |