Skip to content

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 ​

HeaderWhat it does
AuthorizationBearer fs_live_… with an API key, or a token from another configured guard, such as Sanctum.
Api-VersionThe 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-KeyA 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-MatchAn ETag from an earlier response. When it still matches, the response is 304 Not Modified with no body.
X-Request-IdYour own ID for the request, such as a trace ID: up to 128 letters, digits, ., _, : or -. Other values are replaced.
Content-Typeapplication/vnd.api+json for JSON:API documents. Validation errors then point at /data/attributes/….

Responses ​

Every response ​

HeaderWhat it is
X-Request-IdThe 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-VersionThe 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, Accept

Rate limiting ​

See Rate limiting.

HeaderWhat it is
RateLimit-LimitHow many requests the client may make in the window.
RateLimit-RemainingHow many are left.
RateLimit-ResetSeconds until the window resets.
Retry-AfterOn a 429 rate_limited: seconds to wait before trying again. Also sent with 410 api_version_brownout, until the brownout ends.

Caching ​

See Caching.

HeaderWhat it is
ETagA weak ETag of a successful GET or HEAD response, different in each version. Send it back in If-None-Match.
Cache-Controlprivate, no-cache unless the route sets its own with #[CacheControl], so clients revalidate every time.
VaryApi-Version, Authorization, Accept, so shared caches keep versions and callers apart.
X-Response-Cachehit or miss, on actions with #[CacheResponse].

Idempotency ​

HeaderWhat it is
Idempotent-Replayedtrue when the response is a replay of an earlier request with the same Idempotency-Key.

Deprecation ​

Sent on responses served in a deprecated version.

HeaderWhat it is
DeprecationWhen the version was deprecated, as @ and a Unix timestamp (RFC 9745).
SunsetWhen the version will be retired, as an HTTP date (RFC 8594).
Linkrel="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:

HeaderWhat it is
Webhook-IdThe event's ID, the same on every retry, so receivers can ignore duplicates.
Webhook-Signaturet=<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-AgentFusion Stack Webhooks.

Released under the MIT License.