Tarsana docsDashboard

API reference

Build hardened server images from a spec you write, check how each image was built, and install it on your own servers.

The API is plain HTTPS with JSON in and JSON out. Every operation in this reference is also an MCP tool with the same name, and the dashboard uses the same operations. The machine-readable description of the whole API is at GET /v1.

Base URL

https://api.tarsana.io

Every path starts with /v1. Send JSON request bodies with Content-Type: application/json.

Authentication

Send exactly one credential with every request that needs one:

HeaderCredentialWhere you get it
X-Tarsana-Access-TokenAn API access token. Lasts 90 days. Use it in scripts, CI jobs and MCP clients.issue-access-token
X-Tarsana-SessionA session. Lasts one hour. Needed to create, list and revoke access tokens.login

Requests that read or change something in your tenant also send your tenant ID in the X-Tarsana-Tenant header, and the same ID in the address. Tarsana checks that your credential belongs to that tenant.

curl "https://api.tarsana.io/v1/tenants/acme/audit" \
  -H "X-Tarsana-Access-Token: $ACCESS_TOKEN" \
  -H "X-Tarsana-Tenant: acme"

A request with no credential, or one Tarsana does not recognise, gets unauthenticated. A credential whose role does not allow the operation gets forbidden, with the roles that do. Each operation's page says which roles can call it:

RoleWhat it can do
viewerCan read your submissions and download what your builds produced. Cannot submit specs or change servers. Give it to dashboards, status checks and auditors.
builderCan do everything a viewer can, and submit and check specs. Cannot change servers. Give it to CI jobs that build images.
deployerCan do everything a builder can, and install images on your servers, manage your servers and store your provider credentials. The widest role a tenant can hold.

Signing up, signing in and reading the API description need no credential.

Errors

A request to the API that Tarsana refuses, including one whose body is not valid JSON, gets an HTTP status of 400 or higher and an error object with a code, a message for people, sometimes a detail object, and a doc_url that links to the code's entry in the error reference:

{
  "error": {
    "code": "rate_limited",
    "message": "One sentence that says what went wrong.",
    "detail": {"retry_after_seconds": 30},
    "doc_url": "https://docs.tarsana.io/api/errors#rate_limited"
  }
}

Act on the code, never on the message. The error reference lists every code with what happened and what to do.

Retries and idempotency

You can repeat these requests safely:

OperationWhat happens when you repeat it
submitThe same spec returns the same submission; created is false and no second build starts.
create-serverThe same request_id for the same submission returns the server the first request created. A new request_id creates a new server.
decommission-serverContinues from the step where an earlier request stopped.
complete-signupReturns the same login, with secret set to null.
remove-provider-credential, revoke-access-tokenAnswer removed: false or revoked: false when there is nothing left to remove.

Every operation with the Read badge changes nothing and can be repeated at any time.

Rate limits

When you send too many requests in a short time you get rate_limited with HTTP status 429. The Retry-After header and detail.retry_after_seconds say how many seconds to wait.

Request IDs

Answers do not carry a request ID yet. If you contact Tarsana support about a request, include the time you sent it, the operation, your tenant ID and the error code.

Operations

Create your account

Sign up, then sign in.

OperationWhat it does
POST /v1/signupsChangeCreate your Tarsana account
POST /v1/signups/completeChangeFinish creating your account
POST /v1/sessionsSessionSign in and start a session
DELETE /v1/sessions/currentSessionEnd your session

Set up access

Create API access tokens for your scripts and MCP clients, and store the API token of your cloud provider.

OperationWhat it does
POST /v1/access-tokensChangeCreate an API access token
GET /v1/access-tokensReadList your API access tokens
DELETE /v1/access-tokens/{token_id}DestructiveRevoke an API access token
POST /v1/tenants/{tenant}/providers/{provider_name}/credentialChangeStore or replace your provider credential
GET /v1/tenants/{tenant}/providers/{provider_name}/credentialReadCheck whether your provider credential is stored
DELETE /v1/tenants/{tenant}/providers/{provider_name}/credentialDestructiveRemove your provider credential

Build an image

Check your spec, submit it, follow the build and verify what it produced.

OperationWhat it does
POST /v1/tenants/{tenant}/specs/validateReadCheck a spec without submitting it
POST /v1/tenants/{tenant}/specsChangeSubmit a spec to build an image
GET /v1/tenants/{tenant}/submissions/{submission}ReadSee the status of a submission
GET /v1/tenants/{tenant}/submissions/{submission}/{artifact}ReadDownload a record of a submission
GET /v1/tenants/{tenant}/submissions/{submission}/attestationReadGet what you need to verify an image yourself
GET /v1/tenants/{tenant}/auditReadRead your audit trail

Run it on your servers

Create a server from your spec or install your image on one, review the servers in your cloud account, and remove the ones you no longer need.

OperationWhat it does
POST /v1/tenants/{tenant}/submissions/{submission}/create-serverChangeCreate a server from your spec
POST /v1/tenants/{tenant}/servers/{server_name}/install-commandChangeGet the one-line command that installs Tarsana on a server you have
POST /v1/tenants/{tenant}/submissions/{submission}/provisionChangeInstall a built image on one of your servers
GET /v1/tenants/{tenant}/providers/{provider_name}/serversReadList the servers in your cloud account that Tarsana did not create
POST /v1/tenants/{tenant}/providers/{provider_name}/servers/{server_id}/decommissionDestructiveDecommission a server that Tarsana created
POST /v1/tenants/{tenant}/providers/{provider_name}/servers/{server_id}/destroyDestructiveDelete a server that Tarsana did not create

Reference

The machine-readable description of this API.

OperationWhat it does
GET /v1ReadGet the full API description as JSON

View this page as Markdown