API reference
Repositories, databases and buckets
Create, list, link and delete repositories, databases and buckets.
Repositories need git scopes; databases and buckets need resource scopes. To read and write data in a database or bucket, use the Databases and Storage routes.
GET /v1/orgs/:orgId/resources
Lists repositories, databases and buckets, optionally of one type.
Auth: user access token or platform agent key · Scopes: git:read (with type=repository), resources:read (with any other type, or none)
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
| Query parameter | Type | Required | Notes |
|---|---|---|---|
type | "repository" | "database" | "bucket" | No |
Response 200
{
resources: {
type: "repository" | "database" | "bucket"
name: string
status?: "error" | "active" | "creating" | "deleting"
createdAt?: number
updatedAt?: number
region: string
orgId: string
createdBy: string
projectId?: string
location: string
resourceId: string
arn?: string
physicalName: string
}[]
}POST /v1/orgs/:orgId/resources
Creates a repository, database or bucket in a location. With projectId, a database or bucket is linked to that project. Databases take an optional key schema (default pk/sk strings; sortKey: null for a partition key only).
Auth: user access token or platform agent key · Scopes: git:write (for repositories), resources:write (for databases and buckets)
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
type | "repository" | "database" | "bucket" | Yes | |
name | string | Yes | matches ^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$ |
projectId | string | No | |
location | string | No | |
description | string | No | up to 256 characters |
partitionKey | object | No | |
partitionKey.name | string | Yes | matches ^[A-Za-z_][A-Za-z0-9_.-]{0,254}$ |
partitionKey.type | "S" | "N" | "B" | Yes | |
sortKey | object | No | can be null |
sortKey.name | string | Yes | matches ^[A-Za-z_][A-Za-z0-9_.-]{0,254}$ |
sortKey.type | "S" | "N" | "B" | Yes |
Response 201
{
resource: {
type: "repository" | "database" | "bucket"
name: string
status?: "error" | "active" | "creating" | "deleting"
createdAt?: number
updatedAt?: number
region: string
orgId: string
createdBy: string
projectId?: string
location: string
resourceId: string
arn?: string
physicalName: string
}
}Errors
| Status | Message |
|---|---|
400 | Only databases have keys. |
400 | The sort key must differ from the partition key. |
400 | Project not found in this organization. |
400 | Unknown location: … |
409 | … already uses … for …. |
409 | Repository exists. |
502 | Provisioning failed. |
PATCH /v1/orgs/:orgId/resources/:type/:resourceId
Links a database or bucket to a project, or unlinks it with projectId: null. Takes effect on the project's next deployment.
Auth: user access token or platform agent key · Scope: resources:write
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:type | repository, database or bucket. |
:resourceId | Resource id (res_…). |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
projectId | string | Yes | at least 1 character; can be null |
Response 200
{
resource: {
type: "repository" | "database" | "bucket"
name: string
status?: "error" | "active" | "creating" | "deleting"
createdAt?: number
updatedAt?: number
region: string
orgId: string
createdBy: string
projectId?: string
location: string
resourceId: string
arn?: string
physicalName: string
}
}Errors
| Status | Message |
|---|---|
400 | Only databases and buckets can be linked. |
400 | Project not found in this organization. |
404 | Not found |
409 | … already uses … for …. |
DELETE /v1/orgs/:orgId/resources/:type/:resourceId
Deletes a resource and the AWS resource behind it. Databases must have deletion protection off; buckets must be empty. On failure the resource keeps its status.
Auth: user access token or platform agent key · Scopes: git:write (for repositories), resources:write (for databases and buckets)
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:type | repository, database or bucket. |
:resourceId | Resource id (res_…). |
Response 204 with no body.
Errors
| Status | Message |
|---|---|
400 | Unknown type |
404 | … not found |
404 | Not found |
404 | Table not found |
409 | Turn off deletion protection first. |
409 | Wait for index … to finish …, then try again. |
409 | Delete every file in this bucket first. |
409 | Still removing old file versions. Try again to continue. |
409 | Couldn't delete … file…: … |
409 | Files were added while deleting. Delete them first. |
Errors from AWS are mapped as in AWS errors.