SDK reference

Keys

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

GET/v1/orgs/:orgId/keys

Every key that protects the org's data, grouped by app on the page: Drive, secrets, connectors, integrations and the org's own keys (keys:read). With only keys:use, the org's own keys. Also the plan's limits and this month's operations.

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

POST/v1/orgs/:orgId/keys

Makes one of the org's own keys (keys:write).

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

GET/v1/orgs/:orgId/keys/:keyId

A key: versions still in use, created, rotated, last used, uses in the last 30 days, recent re-encryption jobs.

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

GET/v1/orgs/:orgId/keys/:keyId/audit

Who or what used the key, how and when (the org's audit log for this key; keys:read).

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

POST/v1/orgs/:orgId/keys/:keyId/rotate

A new version for new data; older versions keep decrypting. reencrypt: also move existing data to it, in the background.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/keys/{keyId}/rotate' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "reencrypt": false
  }'
postOrgKeysReencrypt

POST/v1/orgs/:orgId/keys/:keyId/reencrypt

Moves existing data to the current version, in the background (where the app supports it).

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/keys/{keyId}/reencrypt' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgKeysJobsByJobId

GET/v1/orgs/:orgId/keys/:keyId/jobs/:jobId

A re-encryption job's progress: state, seen, moved, current (already on the newest version), failed and total where known. Needs keys:read.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/keys/{keyId}/jobs/{jobId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
putOrgKeysSchedule

PUT/v1/orgs/:orgId/keys/:keyId/schedule

Rotates every rotateEveryDays days from now; null turns the schedule off.

Parameters and answers
curl -X PUT 'https://api.cactive.com.au/v1/orgs/{orgId}/keys/{keyId}/schedule' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "rotateEveryDays": 1
  }'
postOrgKeysDisable

POST/v1/orgs/:orgId/keys/:keyId/disable

The org's own keys only: nothing seals or opens with a disabled key until it's enabled again.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/keys/{keyId}/disable' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgKeysEnable

POST/v1/orgs/:orgId/keys/:keyId/enable

Turns one of the organization's own keys back on after disable. Needs keys:write.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/keys/{keyId}/enable' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
deleteOrgKeysByKeyId

DELETE/v1/orgs/:orgId/keys/:keyId

Destroys one of the org's own keys, which must be disabled first: nothing it encrypted can be decrypted again.

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

POST/v1/orgs/:orgId/keys/:keyId/encrypt

Encrypts up to 64 KB with an aes-256-gcm key. context: values the ciphertext is bound to; decrypting needs the same.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/keys/{keyId}/encrypt' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "plaintext": "example"
  }'
postOrgKeysDecrypt

POST/v1/orgs/:orgId/keys/:keyId/decrypt

Decrypts a ciphertext (k1.…) made with this key, with the context it was encrypted with, as text (encoding: "utf8", the default) or base64. Any version of the key opens what it sealed. Counts towards the plan's monthly operations and is an audit event. Needs keys:use.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/keys/{keyId}/decrypt' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "ciphertext": "example"
  }'
postOrgKeysRewrap

POST/v1/orgs/:orgId/keys/:keyId/rewrap

The same ciphertext under the key's current version, without the plaintext leaving the service.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/keys/{keyId}/rewrap' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "ciphertext": "example"
  }'
postOrgKeysSign

POST/v1/orgs/:orgId/keys/:keyId/sign

Signs up to 64 KB with an ed25519 or ecdsa-p256 key (ECDSA signs the message's SHA-256).

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/keys/{keyId}/sign' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "message": "example"
  }'
postOrgKeysVerify

POST/v1/orgs/:orgId/keys/:keyId/verify

Checks a signature (k1s.…) from sign against message: { valid }. Counts towards the plan's monthly operations. Needs keys:use.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/keys/{keyId}/verify' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "message": "example",
    "signature": "example"
  }'
meKeys

GET/v1/me/keys

Your personal keys (Health, your own Drive and Photos space) with uses in the last 30 days and when last used. Never key material. Only you see them: people only, not API keys or connected apps.

Parameters and answers
curl 'https://api.cactive.com.au/v1/me/keys' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
meKeysByKeyId

GET/v1/me/keys/:keyId

One of your personal keys: versions still in use, created, last rotated, last used, uses in the last 30 days.

Parameters and answers
curl 'https://api.cactive.com.au/v1/me/keys/{keyId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
meKeysAudit

GET/v1/me/keys/:keyId/audit

Your key's uses, from your own audit log (nobody else's log has them).

Parameters and answers
curl 'https://api.cactive.com.au/v1/me/keys/{keyId}/audit' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"