Skip to main content

Tenant Host

List the caller's tenant hostnames

GET
/tenant/domains
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/tenant/domains"
{
  "$schema": "/api/v1/schemas/TenantDomainsOutputBody.json",
  "domains": [
    {
      "$schema": "/api/v1/schemas/DomainBody.json",
      "domain": "string",
      "domain_type": "string",
      "is_primary": true,
      "verification_token": "string",
      "verified": true,
      "verified_at": "2019-08-24T14:15:22Z"
    }
  ]
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

List a tenant's hostnames

GET
/tenants/{id}/domains

Authorization

bearerClerk
AuthorizationBearer <token>

Clerk session JWT from an authenticated dashboard user. Format: Bearer eyJ....

In: header

Path Parameters

id*string

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/tenants/string/domains"
{
  "$schema": "/api/v1/schemas/ListTenantDomainsResponse.json",
  "domains": [
    {
      "$schema": "/api/v1/schemas/DomainBody.json",
      "domain": "string",
      "domain_type": "string",
      "is_primary": true,
      "verification_token": "string",
      "verified": true,
      "verified_at": "2019-08-24T14:15:22Z"
    }
  ]
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Claim a hostname for a tenant

POST
/tenants/{id}/domains

Authorization

bearerClerk
AuthorizationBearer <token>

Clerk session JWT from an authenticated dashboard user. Format: Bearer eyJ....

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/tenants/string/domains" \  -H "Content-Type: application/json" \  -d '{    "domain_type": "subdomain"  }'
{
  "$schema": "/api/v1/schemas/DomainBody.json",
  "domain": "string",
  "domain_type": "string",
  "is_primary": true,
  "verification_token": "string",
  "verified": true,
  "verified_at": "2019-08-24T14:15:22Z"
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Remove a tenant hostname

DELETE
/tenants/{id}/domains/{domain}

Authorization

bearerClerk
AuthorizationBearer <token>

Clerk session JWT from an authenticated dashboard user. Format: Bearer eyJ....

In: header

Path Parameters

id*string
domain*string

Response Body

application/problem+json

curl -X DELETE "https://loading/api/v1/tenants/string/domains/string"
Empty
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Verify custom-domain ownership via TXT record

POST
/tenants/{id}/domains/{domain}/verify

Authorization

bearerClerk
AuthorizationBearer <token>

Clerk session JWT from an authenticated dashboard user. Format: Bearer eyJ....

In: header

Path Parameters

id*string
domain*string

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/tenants/string/domains/string/verify"
{
  "$schema": "/api/v1/schemas/DomainBody.json",
  "domain": "string",
  "domain_type": "string",
  "is_primary": true,
  "verification_token": "string",
  "verified": true,
  "verified_at": "2019-08-24T14:15:22Z"
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Get a tenant's manifest

GET
/tenants/{id}/manifest

Authorization

bearerClerk
AuthorizationBearer <token>

Clerk session JWT from an authenticated dashboard user. Format: Bearer eyJ....

In: header

Path Parameters

id*string

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/tenants/string/manifest"
{
  "$schema": "/api/v1/schemas/ManifestVersionOutputBody.json",
  "manifest": null,
  "tenant_id": "string",
  "version": 0
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Create or update a tenant's manifest

PUT
/tenants/{id}/manifest

Authorization

bearerClerk
AuthorizationBearer <token>

Clerk session JWT from an authenticated dashboard user. Format: Bearer eyJ....

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

body*unknown

The full tenant manifest JSON (schema v1). Unknown top-level keys are rejected.

Response Body

application/json

application/problem+json

curl -X PUT "https://loading/api/v1/tenants/string/manifest"
{
  "$schema": "/api/v1/schemas/ManifestVersionOutputBody.json",
  "manifest": null,
  "tenant_id": "string",
  "version": 0
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Mint a short-lived workspace handoff session

POST
/tenants/{id}/workspace-session

Authorization

bearerClerk
AuthorizationBearer <token>

Clerk session JWT from an authenticated dashboard user. Format: Bearer eyJ....

In: header

Path Parameters

id*string

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/tenants/string/workspace-session"
{
  "$schema": "/api/v1/schemas/WorkspaceSessionOutputBody.json",
  "token": "string",
  "workspace_url": "string"
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}