SDK reference

Databases

Each route's function in the SDK, its call beside the same request in cURL.
orgDatabases

GET/v1/orgs/:orgId/databases

The org's databases with live status, item count and size from DynamoDB.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/databases' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgDatabasesByResourceId

GET/v1/orgs/:orgId/databases/:resourceId

A database record and its live table description (keys, indexes, status). table is null when the table was deleted outside the platform.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/databases/{resourceId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgDatabasesScan

POST/v1/orgs/:orgId/databases/:resourceId/scan

One page of a scan. Pass cursor from the previous page to continue.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/databases/{resourceId}/scan' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "index": "example",
    "limit": 25,
    "cursor": "example"
  }'
postOrgDatabasesQuery

POST/v1/orgs/:orgId/databases/:resourceId/query

One page of a query on the table or an index.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/databases/{resourceId}/query' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "partition": {}
  }'
postOrgDatabasesItemsGet

POST/v1/orgs/:orgId/databases/:resourceId/items/get

Strongly consistent read of one item by key.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/databases/{resourceId}/items/get' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "key": {}
  }'
putOrgDatabasesItems

PUT/v1/orgs/:orgId/databases/:resourceId/items

Writes an item. With originalKey, replaces that item (a key change moves it); with expected, the write fails with 409 if the item changed since it was read.

Parameters and answers
curl -X PUT 'https://api.cactive.com.au/v1/orgs/{orgId}/databases/{resourceId}/items' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "item": {}
  }'
postOrgDatabasesItemsDelete

POST/v1/orgs/:orgId/databases/:resourceId/items/delete

Deletes items by key.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/databases/{resourceId}/items/delete' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "key": {}
  }'
postOrgDatabasesItemsBatchDelete

POST/v1/orgs/:orgId/databases/:resourceId/items/batch-delete

Deletes up to 100 items by key (batched). failed counts deletes DynamoDB kept throttling.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/databases/{resourceId}/items/batch-delete' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "keys": [
      {}
    ]
  }'
postOrgDatabasesItemsImport

POST/v1/orgs/:orgId/databases/:resourceId/items/import

Imports up to 100 items (typed DynamoDB JSON). overwrite replaces items with the same key; skip keeps existing ones. Nothing is written if any item is invalid.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/databases/{resourceId}/items/import' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "items": [
      {}
    ]
  }'
postOrgDatabasesRestore

POST/v1/orgs/:orgId/databases/:resourceId/restore

Restores the table as it was at time (epoch ms; default the latest restorable time) into a new database named name. Needs point-in-time recovery; the new table takes minutes or longer to appear.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/databases/{resourceId}/restore' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Example"
  }'
orgDatabasesExports

GET/v1/orgs/:orgId/databases/:resourceId/exports

The table's recent full exports to S3.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/databases/{resourceId}/exports' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgDatabasesExports

POST/v1/orgs/:orgId/databases/:resourceId/exports

Exports the whole table (DynamoDB JSON, gzipped) into one of the organization's buckets under prefix. Needs point-in-time recovery; large tables take a while.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/databases/{resourceId}/exports' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "bucketId": "<bucketId>"
  }'
postOrgDatabasesIndexes

POST/v1/orgs/:orgId/databases/:resourceId/indexes

Adds a global secondary index. The table answers with status UPDATING while DynamoDB backfills the index.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/databases/{resourceId}/indexes' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Example",
    "partitionKey": {
      "name": "Example",
      "type": "S"
    },
    "projection": {
      "type": "ALL"
    }
  }'
deleteOrgDatabasesIndexesByIndexName

DELETE/v1/orgs/:orgId/databases/:resourceId/indexes/:indexName

Removes a global secondary index.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/databases/{resourceId}/indexes/{indexName}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgDatabasesMetrics

GET/v1/orgs/:orgId/databases/:resourceId/metrics

Consumed capacity, throttles and latency from CloudWatch.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/databases/{resourceId}/metrics' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgDatabasesSettings

GET/v1/orgs/:orgId/databases/:resourceId/settings

Time to live, point-in-time recovery, deletion protection, table class and tags.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/databases/{resourceId}/settings' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
patchOrgDatabasesSettings

PATCH/v1/orgs/:orgId/databases/:resourceId/settings

Time to live, point-in-time recovery, deletion protection and table class.

Parameters and answers
curl -X PATCH 'https://api.cactive.com.au/v1/orgs/{orgId}/databases/{resourceId}/settings' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "ttl": {
      "enabled": true
    },
    "pitr": true,
    "deletionProtection": true
  }'
patchOrgDatabasesTags

PATCH/v1/orgs/:orgId/databases/:resourceId/tags

Adds, changes or removes the table's own tags. si: tags are the platform's and can't be changed.

Parameters and answers
curl -X PATCH 'https://api.cactive.com.au/v1/orgs/{orgId}/databases/{resourceId}/tags' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "set": {},
    "remove": []
  }'
deleteOrgDatabasesByResourceId

DELETE/v1/orgs/:orgId/databases/:resourceId

Deletes the table and its record. Refused while deletion protection is on.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/databases/{resourceId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"