Guide

API and agents

API reference

Every endpoint of the public API, generated from the route table that also serves requests and the OpenAPI document. Request and response bodies are the JSON mapping of the named platform.v1 messages; fetch GET /v1/openapi.json for their full schemas. See API overview for authentication, errors, and rate limits.

Access is read or write: read-only tokens may call only read endpoints. Some endpoints also need a broader token scope than project; the Scope column names the narrowest token that may call them. See API tokens.

Two endpoints need no token: GET /v1/health and GET /v1/openapi.json.

Identity

EndpointDescriptionAccessScope
GET /v1/meIdentity behind an account-scoped token.readaccount
GET /v1/tokenIntrospect the presented token.readproject

API tokens

EndpointDescriptionAccessScope
GET /v1/api-tokensList the caller's API tokens, or a workspace's tokens for its admins. Query: workspace_id, include_revoked. Returns ListAPITokensResponse.readaccount
POST /v1/api-tokensCreate an API token; the secret is returned once. Body: CreateAPITokenRequest. Returns CreateAPITokenResponse.writeaccount
DELETE /v1/api-tokens/{tokenId}Revoke an API token (its creator, or an admin of its workspace).writeaccount

GitHub

EndpointDescriptionAccessScope
GET /v1/github/connectionThe caller's GitHub connection. Returns GitHubConnection.readaccount
POST /v1/github/connectionStart connecting GitHub: open the returned authorization_url in a browser. Body: StartGitHubConnectionRequest. Returns StartGitHubConnectionResponse.writeaccount
DELETE /v1/github/connectionDisconnect GitHub.writeaccount
GET /v1/github/repositoriesRepositories the connected GitHub account can deploy (where the GitHub App is installed). Returns ListGitHubRepositoriesResponse.readaccount
GET /v1/github/repositories/{owner}/{repo}/branchesBranches of a repository. Returns ListGitHubBranchesResponse.readaccount
GET /v1/github/repositories/{owner}/{repo}/dockerfilesDockerfile paths of a repository at a ref. Query: ref. Returns ListGitHubDockerfilesResponse.readaccount

Limits

EndpointDescriptionAccessScope
GET /v1/limitsWorkload storage, image, and process limits.readproject

Regions

EndpointDescriptionAccessScope
GET /v1/regionsList configured workload regions with country codes, new-service admission policy and platform default. Returns ListRegionsResponse.readproject
PUT /v1/regions/{regionId}Create or update a region (operator only); closing admission preserves deployments and recovery for existing services. Body: Region. Returns Region.writeaccount

Workspaces and members

EndpointDescriptionAccessScope
GET /v1/workspacesList the caller's workspaces and pending invitations. Returns ListWorkspacesResponse.readworkspace
POST /v1/workspacesCreate a workspace. Body: CreateWorkspaceRequest. Returns Workspace.writeaccount
GET /v1/workspaces/{workspaceId}Get a workspace. Returns Workspace.readworkspace
PATCH /v1/workspaces/{workspaceId}Rename a workspace. Body: RenameWorkspaceRequest. Returns Workspace.writeaccount
DELETE /v1/workspaces/{workspaceId}Delete a workspace with no live projects (confirmation_name must match).writeaccount
GET /v1/workspaces/{workspaceId}/membersList workspace members and invitations. Returns ListWorkspaceMembersResponse.readworkspace
POST /v1/workspaces/{workspaceId}/invitationsInvite a member by email. Body: InviteWorkspaceMemberRequest. Returns WorkspaceInvitation.writeaccount
PATCH /v1/workspaces/{workspaceId}/members/{userId}Change a member's role. Body: UpdateWorkspaceMemberRoleRequest. Returns WorkspaceMember.writeaccount
DELETE /v1/workspaces/{workspaceId}/members/{userId}Remove a member (removing yourself leaves the workspace).writeaccount
DELETE /v1/workspace-invitations/{invitationId}Revoke an invitation.writeaccount
POST /v1/workspace-invitations/{invitationId}/acceptAccept an invitation addressed to the caller. Returns Workspace.writeaccount
POST /v1/workspace-invitations/{invitationId}/declineDecline an invitation addressed to the caller.writeaccount

Projects

EndpointDescriptionAccessScope
GET /v1/projectsList projects. Query: workspace_id, include_deleted, include_summaries. Returns ListProjectsResponse.readworkspace
POST /v1/projectsCreate a project (empty workspace_id uses the personal workspace). Body: CreateProjectRequest. Returns Project.writeworkspace
GET /v1/projects/{projectId}Get a project. Returns Project.readproject
DELETE /v1/projects/{projectId}Delete a project (confirmation_name must match; restorable during grace).writeworkspace
POST /v1/projects/{projectId}/restoreRestore a deleted project. Returns Project.writeworkspace
PATCH /v1/projects/{projectId}/log-retentionSet log retention days. Query: 1-90. Returns Project.writeworkspace
GET /v1/projects/{projectId}/deletion-previewPreview what deleting the project would tombstone. Returns DeletionPreview.readworkspace
POST /v1/projects/{projectId}/moveMove a project to another workspace. Returns Project.writeaccount
GET /v1/projects/{projectId}/environmentsList environments. Query: include_deleted. Returns ListEnvironmentsResponse.readworkspace
POST /v1/projects/{projectId}/environmentsCreate an environment. Body: CreateEnvironmentRequest. Returns Environment.writeworkspace
POST /v1/projects/{projectId}/github-repositoryLink and inspect a GitHub repository for the project. Body: LinkGitHubRepositoryRequest. Returns InspectSourceResponse.writeworkspace
POST /v1/source-inspectionsInspect a source repository without linking it. Body: InspectSourceRequest. Returns InspectSourceResponse.readworkspace

Environments and releases

EndpointDescriptionAccessScope
GET /v1/environments/{environmentId}Get an environment. Returns Environment.readproject
PATCH /v1/environments/{environmentId}Rename an environment. Returns Environment.writeworkspace
PATCH /v1/environments/{environmentId}/auto-deployToggle auto-deploy on tracked-ref changes. Returns Environment.writeproject
POST /v1/environments/{environmentId}/duplicateDuplicate an environment (copy_variables optional). Returns Environment.writeworkspace
DELETE /v1/environments/{environmentId}Delete an environment (production requires confirmation_name).writeworkspace
POST /v1/environments/{environmentId}/restoreRestore a deleted environment. Returns Environment.writeworkspace
GET /v1/environments/{environmentId}/deletion-previewPreview what deleting the environment would tombstone. Returns DeletionPreview.readworkspace
POST /v1/environments/{environmentId}/releasesRelease the environment: deploy every staged service change. Returns ReleaseEnvironmentResponse.writeproject
POST /v1/environments/{environmentId}/services/from-repositoryLink a GitHub repository and stage a service built from it, with defaults from its inspection. Body: CreateServiceFromRepositoryRequest. Returns Service.writeworkspace

Services

EndpointDescriptionAccessScope
GET /v1/environments/{environmentId}/servicesList services and volumes in an environment; long-poll with wait_index. Query: include_deleted, wait_index, wait_timeout_seconds. Returns ListServicesResponse.readproject
POST /v1/environments/{environmentId}/servicesCreate a service (staged until the environment is released). Body: CreateServiceRequest. Returns Service.writeproject
GET /v1/services/{serviceId}Get a service. Query: source. Returns Service.readproject
PUT /v1/services/{serviceId}Replace a service draft (expected_spec_revision must be current; staged until release). Body: UpdateServiceRequest. Returns Service.writeproject
DELETE /v1/services/{serviceId}Delete a service (restorable during grace).writeproject
POST /v1/services/{serviceId}/duplicateCopy a service's draft and variables into a new staged service named -copy. Returns Service.writeproject
POST /v1/services/{serviceId}/restoreRestore a deleted service. Returns Service.writeproject
GET /v1/services/{serviceId}/statusService with live allocation status; long-poll with wait_index. Query: wait_index, wait_timeout_seconds. Returns ServiceStatus.readproject
POST /v1/services/{serviceId}/scaleSet the desired replica count. Returns ServiceStatus.writeproject
POST /v1/services/{serviceId}/discard-changesDiscard staged service changes (change_ids or discard_all). Body: DiscardServiceChangesRequest. Returns Service.writeproject

Deployments, builds, and logs

EndpointDescriptionAccessScope
GET /v1/services/{serviceId}/deploymentsList deployment attempts, newest first (limit); never-released staged configuration is not listed. Returns ListServiceDeploymentsResponse.readproject
POST /v1/services/{serviceId}/deployments/{deploymentId}/actionsAct on a deployment: restart, exact redeploy, rollback, cancel, remove, retry. Body: ApplyDeploymentActionRequest. Returns ServiceStatus.writeproject
GET /v1/services/{serviceId}/logsService logs. Query: log_type, limit, search, times. Returns ListServiceLogsResponse.readproject
GET /v1/services/{serviceId}/artifactsList built image artifacts. Query: limit. Returns ListServiceArtifactsResponse.readproject
GET /v1/services/{serviceId}/builds/{buildId}/attemptsList attempts of one build. Returns ListBuildAttemptsResponse.readproject

Domains

EndpointDescriptionAccessScope
GET /v1/services/{serviceId}/domainsList domain bindings of a service. Query: include_deleted. Returns ListDomainBindingsResponse.readproject
POST /v1/services/{serviceId}/domainsBind a custom hostname to a service port. Body: DomainBindingInput. Returns DomainBinding.writeproject
POST /v1/services/{serviceId}/generated-domainGenerate a platform hostname for a service port. Body: GenerateDomainBindingRequest. Returns DomainBinding.writeproject
GET /v1/domains/{hostname}Get a domain binding, with ownership and certificate state. Returns DomainBinding.readproject
PATCH /v1/domains/{hostname}Retarget a domain binding to a service port. Body: DomainBindingTarget. Returns DomainBinding.writeproject
DELETE /v1/domains/{hostname}Delete a domain binding (restorable during grace).writeproject
POST /v1/domains/{hostname}/restoreRestore a deleted domain binding. Returns DomainBinding.writeproject

Volumes

EndpointDescriptionAccessScope
GET /v1/environments/{environmentId}/volumesList volumes in an environment. Query: include_deleted. Returns ListVolumesResponse.readproject
POST /v1/environments/{environmentId}/volumesCreate a volume (staged until the environment is released). Body: CreateVolumeRequest. Returns Volume.writeproject
GET /v1/volumes/{volumeId}Get one volume by ID. Returns Volume.readproject
PATCH /v1/volumes/{volumeId}Try to grow a volume without downtime; allow_offline_resize confirms a restart after live resize fails. Body: UpdateVolumeRequest. Returns Volume.writeproject
POST /v1/volumes/{volumeId}/movePreview an offline volume move; confirm with the preview target to authorize downtime (all plans). Body: MoveVolumeRequest. Returns VolumeMove.writeproject
DELETE /v1/volumes/{volumeId}Delete a volume (confirmation_name must match).writeproject
GET /v1/volumes/{volumeId}/deletion-previewPreview what deleting the volume affects. Returns DeletionPreview.readproject

Templates

EndpointDescriptionAccessScope
GET /v1/templatesList curated templates (database_only filters the same catalog). Returns ListTemplatesResponse.readproject
POST /v1/environments/{environmentId}/templatesAtomically stage every service, volume, and public route in a template. Body: CreateTemplateRequest. Returns CreateTemplateResponse.writeproject

Usage

Usage queries default end_time to now and start_time to 24 hours, 7 days, or 30 days before the end for minute, hour (default), or day resolution respectively.

EndpointDescriptionAccessScope
GET /v1/workspaces/{workspaceId}/usageUsage totals per project of a workspace. Query: start_time, end_time, resolution. Returns WorkspaceUsage.readworkspace
GET /v1/projects/{projectId}/usageProject resource usage. Query: start_time, end_time, resolution, filters. Returns ProjectUsage.readproject

Recently deleted

EndpointDescriptionAccessScope
GET /v1/deleted-resourcesRestorable deleted projects, environments, services, volumes, and domains, newest first. Query: workspace_id. Returns ListDeletedResourcesResponse.readworkspace

Billing

EndpointDescriptionAccessScope
GET /v1/billing/plansPlans with their prices, limits, and rules. Returns ListBillingPlansResponse.readproject
GET /v1/workspaces/{workspaceId}/billingBilling account summary for the workspace; unknown plans use trial resource caps. Returns BillingAccountSummary.readworkspace
GET /v1/workspaces/{workspaceId}/billing/statementsList billing statements. Query: limit. Returns ListBillingStatementsResponse.readworkspace
GET /v1/workspaces/{workspaceId}/billing/statements/{statementId}Get a billing statement. Query: include_csv. Returns BillingStatement.readworkspace
PATCH /v1/workspaces/{workspaceId}/billing/budgetSet the gross-usage budget stop in cents (0 clears). Returns BillingAccountSummary.writeaccount
POST /v1/workspaces/{workspaceId}/billing/planChange the billing plan. Returns BillingAccountSummary.writeaccount
POST /v1/workspaces/{workspaceId}/billing/payment-setupStart payment method setup; returns a checkout URL. Returns StartBillingPaymentSetupResponse.writeaccount
POST /v1/workspaces/{workspaceId}/billing/activationChoose a paid plan; returns a Checkout link while no card is saved. Returns StartBillingActivationResponse.writeaccount
POST /v1/workspaces/{workspaceId}/billing/cancelCancel the billing account (effective at period end). Returns CancelBillingAccountResponse.writeaccount

Fleet

EndpointDescriptionAccessScope
GET /v1/fleetFleet agents with presence, allocations, and schedulable capacity (operators only). Returns Fleet.readaccount
POST /v1/fleet/agentsEnroll a fleet agent; the bootstrap token is returned once (operators only). Body: CreateAgentRequest. Returns AgentEnrollment.writeaccount
PATCH /v1/fleet/agents/{agentId}Update a fleet agent's placement and reserved capacity (operators only). Body: UpdateAgentRequest. Returns Agent.writeaccount
POST /v1/fleet/agents/{agentId}/lifecycleCordon, drain, activate, or retire a fleet agent (operators only). Body: SetAgentLifecycleRequest. Returns Agent.writeaccount