DaytonaDocs

Management API

Organizations, projects, members, API keys, and credits (OIDC-authenticated).

The management API is the human plane: organizations, membership, invitations, projects, API keys, and credits.

Note: these routes authenticate with your dashboard login token (an OIDC bearer JWT), not an rlp_ project API key. In the examples below, $OIDC_TOKEN is that JWT. See Authentication and Organizations.

Roles: an org owner manages the org itself, membership, and invitations; a member manages projects, keys, and project resources but not the org. Every user gets an undeletable personal organization that takes no invitations.

GET /me

The authenticated user.

cURL
curl https://api.rl.trydaytona.com/me -H "Authorization: Bearer $OIDC_TOKEN"
{ "id": "b1f7e2d4-9c3a-4e58-8f06-2a7d1c5b9e30", "email": "ada@example.com", "name": "Ada" }

Organizations

POST /orgs

Create an organization; the caller becomes its owner. Body: { "name": string } (required, non-empty).

cURL
curl -X POST https://api.rl.trydaytona.com/orgs \
  -H "Authorization: Bearer $OIDC_TOKEN" -H "Content-Type: application/json" \
  -d '{ "name": "Acme" }'
{ "id": "6f0d3b82-4a91-4c67-b5e8-9d2c1f70a345", "name": "Acme", "personal": false }

GET /orgs

Organizations the caller belongs to: { "organizations": [ { "id", "name", "personal", "role" } ] }.

GET /orgs/:id

One org: { "id", "name", "personal", "role" }. 404 for non-members.

PATCH /orgs/:id

Rename (owner only). Body { "name": string }{ "id", "name" }. 403 for non-owners.

DELETE /orgs/:id

Delete (owner only) → { "deleted": "<id>" }.

  • 403 — not an owner. 409 — the personal organization cannot be deleted.

Members

GET /orgs/:id/members

{ "members": [ { "user_id", "email", "name", "role" } ] }. Any member may read.

DELETE /orgs/:id/members/:user_id

Remove a member (owner only) → { "removed": "<user_id>" }.

  • 403 — not an owner. 404 — not a member. 409 — cannot remove the last owner.

Invitations

POST /orgs/:id/invitations

Invite by email (owner only). Body: { "email": string, "role": "owner" | "member" } (role defaults to "member"). Re-inviting the same email refreshes the pending invitation (valid 14 days).

cURL
curl -X POST https://api.rl.trydaytona.com/orgs/6f0d3b82-4a91-4c67-b5e8-9d2c1f70a345/invitations \
  -H "Authorization: Bearer $OIDC_TOKEN" -H "Content-Type: application/json" \
  -d '{ "email": "grace@example.com", "role": "member" }'
{ "id": "aa50c7d3-2e81-4f96-b0c4-7d3e9a1f5b28", "org_id": "6f0d3b82-4a91-4c67-b5e8-9d2c1f70a345", "email": "grace@example.com", "role": "member" }
  • 400 — role not owner/member. 403 — not an owner. 409 — personal orgs cannot have members.

GET /orgs/:id/invitations

Pending invitations for the org (owner only): { "invitations": [ { "id", "email", "role" } ] }.

GET /invitations

Pending, unexpired invitations addressed to the caller's email: { "invitations": [ { "id", "org_id", "org_name", "role" } ] }.

POST /invitations/:id/accept

Accept an invitation → { "org_id", "role" }.

  • 403 — the invitation is addressed to a different email. 404 — unknown, already accepted, or expired.

Projects

POST /orgs/:id/projects

Create a project in the org. Body: { "name": string }{ "id", "org_id", "name" }. 409 on a duplicate name.

GET /orgs/:id/projects

{ "projects": [ { "id", "name" } ] }.

DELETE /projects/:id

Delete a project → { "deleted": "<id>" }. 404 for projects outside the caller's orgs.

API keys

POST /projects/:id/api-keys

Mint a workload API key for a project. Body (optional): { "name": string } — defaults to "default"; minting another "default" key revokes the previous one. The plaintext token is returned once and never stored.

cURL
curl -X POST https://api.rl.trydaytona.com/projects/1d4c8f26-7b3e-4a90-95d1-c2e6f8a03b57/api-keys \
  -H "Authorization: Bearer $OIDC_TOKEN" -H "Content-Type: application/json" \
  -d '{ "name": "ci" }'
{
  "id": "3c9e5a71-8d24-4f6b-a0e3-b7f1d9c24680",
  "name": "ci",
  "project_id": "1d4c8f26-7b3e-4a90-95d1-c2e6f8a03b57",
  "key_prefix": "rlp_a1b2c3d",
  "token": "rlp_a1b2c3d4e5f60718293a4b5c6d7e8f90"
}

GET /projects/:id/api-keys

Live keys for a project; ?include_revoked=true includes revoked ones.

{
  "api_keys": [
    {
      "id": "3c9e5a71-8d24-4f6b-a0e3-b7f1d9c24680",
      "name": "ci",
      "key_prefix": "rlp_a1b2c3d",
      "created_at": "2026-07-31T10:15:00Z",
      "revoked_at": null,
      "last_used_at": "2026-07-31T18:40:12Z"
    }
  ]
}

DELETE /api-keys/:id

Revoke a key (idempotent) → { "revoked": "<id>" }. 404 when the key's project is outside the caller's orgs.

Credits

GET /orgs/:id/credits

Balance, effective overdraft limit, and recent ledger entries. Any member may read. ?limit= caps ledger entries (default 50, max 500). See Spending.

{
  "org_id": "6f0d3b82-4a91-4c67-b5e8-9d2c1f70a345",
  "balance": "42.500000",
  "overdraft_limit": "10.000000",
  "overdraft_limit_source": "global",
  "enabled": true,
  "ledger": [
    { "id": 118, "amount": "-0.030000", "kind": "usage", "vm_id": "7f2e6a30-91cd-4b1f-a8d2-3c5e07b9f614", "note": null, "created_at": "2026-07-31T18:00:00Z" },
    { "id": 1, "amount": "50.000000", "kind": "grant", "vm_id": null, "note": "initial grant", "created_at": "2026-07-01T09:00:00Z" }
  ]
}

Project resources (management mirror)

The workload-plane secrets, registries, and object stores are also reachable with the OIDC token, scoped by project id in the path. Semantics, bodies, and responses match the workload endpoints; any org member may manage them.

Mirror routeWorkload equivalent
GET /projects/:id/secrets · PUT /projects/:id/secrets (body includes name)GET /secrets
GET/PUT/DELETE /projects/:id/secrets/:name/secrets/:name
GET /projects/:id/registries · PUT /projects/:id/registries (body includes host)GET/PUT /registries
GET/PUT/DELETE /projects/:id/registries/:host/registries/:host
GET/POST /projects/:id/object-stores/object-stores
GET/DELETE /projects/:id/object-stores/:name/object-stores/:id_or_name

Errors (all management routes)

  • 401 — missing/invalid OIDC token.
  • 403 — owner-only action attempted by a member, or accepting someone else's invitation.
  • 404 — org/project/key outside the caller's memberships.
  • 409 — duplicate names, personal-org restrictions, last-owner removal.