Service keys

Manage the service keys for your own AtlasAccount. The accountId in the URL is your AtlasAccount id and must match your key's account. The full key (rawKey) is returned only on create and regenerate.

List service keys

GET /api/public/atlas-accounts/{accountId}/service-keys?isActive=true

curl -s "$ATLAS_BASE_URL/api/public/atlas-accounts/$ACCOUNT_ID/service-keys" \
  -H "Authorization: Bearer $ATLAS_API_KEY"

Response (data is an array of keys; never includes the raw key):

{
  "success": true,
  "data": [
    {
      "id": "ck_...",
      "keyName": "production",
      "keyPrefix": "atsk_a1b2c3",
      "description": "prod trading bot",
      "isActive": true,
      "lastUsedAt": "2026-05-25T10:00:00.000Z",
      "expiresAt": null,
      "maxInstances": 5,
      "instanceCount": 2,
      "rateLimitPerMinute": 120,
      "rateLimitPerDay": 50000,
      "requestCount": 18234,
      "allowedIpAddresses": [],
      "createdAt": "2026-01-01T00:00:00.000Z",
      "updatedAt": "2026-05-25T10:00:00.000Z"
    }
  ]
}

Create a service key

POST /api/public/atlas-accounts/{accountId}/service-keys

FieldTypeRequiredNotes
keyNamestring✅Label for the key
descriptionstring
maxInstancesnumberCap on instances this key can create
rateLimitPerMinutenumber
rateLimitPerDaynumber
expiresAtISO 8601 stringAuto-expire the key
allowedIpAddressesstring[]Source IP allowlist
curl -s -X POST "$ATLAS_BASE_URL/api/public/atlas-accounts/$ACCOUNT_ID/service-keys" \
  -H "Authorization: Bearer $ATLAS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "keyName": "trading-bot", "maxInstances": 5 }'

Response (201) — rawKey is shown only here:

{
  "success": true,
  "data": {
    "id": "ck_...",
    "keyName": "trading-bot",
    "keyPrefix": "atsk_a1b2c3",
    "isActive": true,
    "maxInstances": 5,
    "createdAt": "2026-05-25T10:00:00.000Z",
    "rawKey": "atsk_a1b2c3d4e5f6...full-secret...zz"
  }
}

Update a service key

PATCH /api/public/service-keys/{keyId} — any subset of: keyName, description, isActive, maxInstances, rateLimitPerMinute, rateLimitPerDay, expiresAt, allowedIpAddresses.

curl -s -X PATCH "$ATLAS_BASE_URL/api/public/service-keys/$KEY_ID" \
  -H "Authorization: Bearer $ATLAS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "isActive": false }'

Regenerate a service key

POST /api/public/service-keys/{keyId}/regenerate — issues a new secret and invalidates the old one. Returns a fresh rawKey.

curl -s -X POST "$ATLAS_BASE_URL/api/public/service-keys/$KEY_ID/regenerate" \
  -H "Authorization: Bearer $ATLAS_API_KEY"

Delete a service key

DELETE /api/public/service-keys/{keyId}

curl -s -X DELETE "$ATLAS_BASE_URL/api/public/service-keys/$KEY_ID" \
  -H "Authorization: Bearer $ATLAS_API_KEY"