Skip to main content
The Safeclose API is a JSON REST API. Every endpoint sits under the /v1/ path prefix, requires a Bearer token for authentication, and returns JSON for both successful responses and errors. This page covers the conventions you need to understand before making your first request.

Base URL

Your API base URL is the URL of your Safeclose API service. All examples in this reference use a placeholder:
Replace this with your actual API host. You can confirm the correct URL by calling the health endpoint — it returns { "service": "safeclose-api" }:
If you receive an HTML response instead of JSON, your base URL likely points at the Safeclose web app instead of the API service. Make sure you are using the correct API host URL — the health endpoint at /health should return { "service": "safeclose-api" }.

Versioning

All API endpoints are prefixed with /v1/. The current version is v1. Include the version prefix in every request path:

Authentication

Every /v1/ endpoint requires a Bearer token in the Authorization header. The token is a Clerk JWT session token obtained from an authenticated Safeclose session.
See Authenticate requests for full details on obtaining and using tokens.

Content type

Send Content-Type: application/json for any request that includes a body. The API returns application/json for all responses, including errors.

Error format

When a request fails, the API returns a JSON object with a single error field describing what went wrong:
The HTTP status code indicates the category of failure. Parse the error string for a human-readable explanation.

HTTP status codes

Rate limiting

Rate limiting is managed at the infrastructure level. Contact your organization administrator for details.

Available API resources

Health endpoints

Two unauthenticated endpoints are available for infrastructure probes:
The health endpoints do not require an Authorization header. Use /health for liveness probes and /ready for readiness probes.