FOUR SDK / V1.0.0

HTTP Backend Contract

Confirm the following contract before deployment.

Endpoints

Every operation uses POST:

text
/v1/{module}/{method}

Special client endpoints:

text
/v1/sync
/v1/health

Request body:

json
{
  "input": {},
  "context": {}
}

Headers

http
Content-Type: application/json
X-Request-Id: <request-id>
X-Fourbtd-Network: <network>
Authorization: Bearer <api-key>
Idempotency-Key: <key>
If-Match: <version>

Authorization, Idempotency-Key, and If-Match are included when applicable.

If-Match uses an unquoted decimal version.

Success Responses

Successful responses use:

json
{
  "data": "<operation output>"
}

All successful responses are schema validated.

Unknown entity fields are stripped, and public timestamps use UTC ISO 8601.

Error Mapping

HTTP status SDK error
401 Authentication
403 Authorization
404 Not found
408 Timeout
409, 412 Conflict
429 Rate limit
5xx Server
Other failures Validation

HTTP error bodies are not reflected into SDK error messages.

Retry-After establishes the minimum retry delay.

Backend Requirements

Backend mutations must atomically deduplicate idempotency keys and honor optimistic versions.

The backend contract should also define:

  • Batch ordering and partial results

  • Pagination scope

  • Recall ranking

  • Retention behavior

  • Authentication

  • Tenant isolation

Do not connect the transport directly to an unrelated REST API without an adapter.