Skip to content

HTTP contract reference

The language-neutral Arc HTTP contract is the specification: routes, methods, headers, result envelopes, status codes, identity, and validation values. This page lists what Arc for TypeScript serves against it. The status of each difference, and the evidence for it, is in the capability reference.

PathMethodsAnswer
A command route, such as /api/tasks/registration/register-taskPOSTCommand result
<command route>/validatePOSTCommand result after authorization and validation; the handler never runs
A query route, such as /api/tasks/listing/all-tasksGET, and QUERY unless disabledQuery result; QUERY responses carry Cache-Control: no-store
An observable query routeGET, QUERY, SSE with Accept: text/event-stream, direct WebSocket upgradeCurrent snapshot, a stream of direct SSE results, or direct WebSocket Data frames
/.cratis/queries/wsWebSocket upgradeMultiplexed WebSocket hub
/.cratis/queries/sse, /.cratis/queries/sse/subscribe, /.cratis/queries/sse/unsubscribeGET, and authenticated POSTMultiplexed SSE stream and its caller-bound controls
/.cratis/commands, /.cratis/queriesGETCommand and query metadata with input JSON Schema
/.cratis/identity-details/schemaGETIdentity details JSON Schema, or {}
/.cratis/meGET, when an identity details provider exists401 anonymous, 403 provider denied, 200 identity JSON with display cookie
/.cratis/users, /.cratis/tenantsGET[] by default; opt-in development discovery
/.cratis/queries/healthGET and QUERY, when enabledCaller-scoped hub health; requires authentication
/openapi.jsonGETOpenAPI 3.1 document

The catalogs, identity schema, users, tenants, and /openapi.json are anonymous only in Development by default. Elsewhere they run the configured authentication handlers and require an authenticated principal (401 anonymous, 403 missing a configured role). Without authentication they are unmapped; explicitly requiring it without handlers fails startup. See Discovery access for environment detection, roles, and the anonymous opt-out. Methods that reach Arc but are not accepted answer 405 with an Allow header. Route shapes are explained in Endpoint mapping.

introspection.enabled defaults to true. Setting it to false (Node configuration: Cratis:Arc:Introspection:Enabled) leaves /.cratis/commands, /.cratis/queries, and /openapi.json unmapped in every environment, normally returning 404. Identity discovery and in-process openApi() / exportClientManifest are unchanged. See Turn discovery off, including the authentication-warning interaction and TypeScript’s extension of the switch to HTTP OpenAPI.

HeaderDirectionMeaning
X-Correlation-ID (configurable)Request and responseReused when a valid non-zero UUID, otherwise replaced; always returned
X-Allowed-SeverityRequest0, 1, or 2 on commands; 3 is capped to 2; ignored on queries
x-cratis-tenant-id (configurable)RequestThe requested tenant without tenancy.resolve or another configured tenant source
AuthorizationRequestRead only by the authentication handlers you configure
Cache-Control: no-storeResponseOn QUERY responses, discovery responses, and /.cratis/me
AllowResponseOn 405 answers
Retry-After: 1ResponseOn observable admission 503 answers

A result is 200 when successful, then 403 for authorization failures, 400 for validation and malformed input, 202 for a pending observable snapshot, and 500 for exceptions, in the contract’s order. 401 answers an anonymous caller on a protected operation when authentication handlers are configured, and any failed authentication. Observable routes also use 408 for a timed-out first-result wait and 503 when a limit is reached.

AreaArc on .NETArc for TypeScript
X-Allowed-Severity: 3Runs a command with only error resultsTreated as Warning; errors block
Anonymous caller on a protected operation403401 when handlers are configured
Malformed request messageFramework messageMalformed request
Redacted exception messageFramework messageAn unexpected error occurred
Invalid GUID query argument400 malformedRequest with argument details400 malformedRequest with a generic message
SSE hubAnonymous controls allowedRequires an authenticated principal
Query healthAnonymous, cross-callerOpt-in, caller-scoped
Discovery denial bodyEmpty 401/403 on the ASP.NET fixtureJSON { error } with the same status
waitForFirstResultTimeoutLarger values accepted; unknown booleans ignoredAt most 120 seconds; unknown booleans rejected

Numeric concept GET arguments bind successfully on both runtimes. Both apply GET sorting and reject invalid sort directions. The suite also pins a host-specific difference that is not a choice of Arc for TypeScript:

RequestArc on .NET 22.45.0Arc for TypeScript
An unknown path under ExpressEmpty 404 with a correlation headerExpress’s own HTML 404, without an Arc correlation header

The paired yarn test:conformance suite pins these differences against a .NET host on Cratis.Arc 22.45.0; see How parity is checked.