API reference

Repositories, databases and buckets

Create, list, link and delete repositories, databases and buckets.
GET/v1/orgs/:orgId/resources

Lists repositories, databases and buckets, optionally of one type.

Auth
A person's token or an API key, as Authorization: Bearer.
Scopes
git:read (with type=repository), resources:read (with any other type, or none)
Get an API key

Path parameters

  • orgId

    Organization id (org_…).

Query parameters

  • type"repository" | "database" | "bucket"
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/resources' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
Send it from this page with your session or a key.

Response 200

{
  resources: {
    region: string
    type: "repository" | "database" | "bucket"
    name: string
    status?: "error" | "active" | "deleting" | "creating"
    createdAt?: number
    updatedAt?: number
    orgId: string
    resourceId: string
    createdBy: string
    projectId?: string
    location: string
    arn?: string
    physicalName: string
    restoredFrom?: string
    pendingSetup?: boolean
  }[]
}
POST/v1/orgs/:orgId/resources

Creates a repository, database or bucket in a location. With projectId, a database or bucket is linked to that Serverless App Service. Databases take an optional key schema (default pk/sk strings; sortKey: null for a partition key only).

Auth
A person's token or an API key, as Authorization: Bearer.
Scopes
git:write (for repositories), resources:write (for databases and buckets)
Get an API key

Path parameters

  • orgId

    Organization id (org_…).

Request body

  • type"repository" | "database" | "bucket"required
  • namestringrequired

    Matches ^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$.

  • projectIdstring
  • locationstring
  • descriptionstring

    Up to 256 characters.

  • partitionKeyobject
  • partitionKey.namestringrequired

    Matches ^[A-Za-z_][A-Za-z0-9_.-]{0,254}$.

  • partitionKey.type"S" | "N" | "B"required
  • sortKeyobjector null
  • sortKey.namestringrequired

    Matches ^[A-Za-z_][A-Za-z0-9_.-]{0,254}$.

  • sortKey.type"S" | "N" | "B"required

Errors

  • 400Only databases have keys.
  • 400The sort key must differ from the partition key.
  • 400Serverless App Service not found in this organization.
  • 400Unknown location: …
  • 409… already uses … for ….
  • 409Repository exists.
  • 502Provisioning failed.
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/resources' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "repository",
    "name": "Example"
  }'
Send it from this page with your session or a key.

Response 201

{
  resource: {
    region: string
    type: "repository" | "database" | "bucket"
    name: string
    status?: "error" | "active" | "deleting" | "creating"
    createdAt?: number
    updatedAt?: number
    orgId: string
    resourceId: string
    createdBy: string
    projectId?: string
    location: string
    arn?: string
    physicalName: string
    restoredFrom?: string
    pendingSetup?: boolean
  }
}
PATCH/v1/orgs/:orgId/resources/:type/:resourceId

Links a database or bucket to a Serverless App Service, or unlinks it with projectId: null. Takes effect on the Serverless App Service's next deployment.

Auth
A person's token or an API key, as Authorization: Bearer.
Get an API key

Path parameters

  • orgId

    Organization id (org_…).

  • type

    repository, database or bucket.

  • resourceId

    Resource id (res_…); for a group's access, the Serverless App Service id (prj_…) or the repository's resource id.

Request body

  • projectIdstringrequiredor null

    At least 1 character.

Errors

  • 400Only databases and buckets can be linked.
  • 400Serverless App Service not found in this organization.
  • 404Not found
  • 409… already uses … for ….
curl -X PATCH 'https://api.cactive.com.au/v1/orgs/{orgId}/resources/{type}/{resourceId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "projectId": "<projectId>"
  }'
Send it from this page with your session or a key.

Response 200

{
  resource: {
    region: string
    type: "repository" | "database" | "bucket"
    name: string
    status?: "error" | "active" | "deleting" | "creating"
    createdAt?: number
    updatedAt?: number
    orgId: string
    resourceId: string
    createdBy: string
    projectId?: string
    location: string
    arn?: string
    physicalName: string
    restoredFrom?: string
    pendingSetup?: boolean
  }
}
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
A person's token or an API key, as Authorization: Bearer.
Scopes
git:write (for repositories), resources:write (for databases and buckets)
Get an API key

Path parameters

  • orgId

    Organization id (org_…).

  • type

    repository, database or bucket.

  • resourceId

    Resource id (res_…); for a group's access, the Serverless App Service id (prj_…) or the repository's resource id.

Errors

  • 400Unknown type
  • 404… not found
  • 404Not found
  • 404Table not found
  • 409Turn off deletion protection first.
  • 409Wait for index … to finish …, then try again.
  • 409Delete every file in this bucket first.
  • 409Still removing old file versions. Try again to continue.
  • 409Couldn't delete … file…: …
  • 409Files were added while deleting. Delete them first.

Errors from AWS map as in AWS errors.

curl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/resources/{type}/{resourceId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
Send it from this page with your session or a key.

Response 204 with no body