Skip to main content
POST
/
api
/
v1
/
keys
Create API key
curl --request POST \
  --url https://carboncopy.news/api/v1/keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Production bot",
  "scopes": {
    "portfolio": "none",
    "traders": "none",
    "orders": "none",
    "markets": "none",
    "account": "none"
  },
  "expiresAt": 1773043200000
}
'
{
  "keyId": "key_abc123",
  "name": "My trading bot",
  "scopes": {
    "portfolio": "none",
    "traders": "none",
    "orders": "none",
    "markets": "none",
    "account": "none"
  },
  "createdAt": 1741000000000,
  "secret": "cc_a1b2c3d4e5f6...",
  "expiresAt": 123,
  "lastUsedAt": 123
}

Authorizations

Authorization
string
header
required

Privy JWT obtained after authenticating with your Privy account. Required only for key management endpoints.

Body

application/json
name
string

Human-readable label for this key.

Example:

"Production bot"

scopes
object
expiresAt
integer

Unix timestamp (ms) for key expiry. Omit for no expiry.

Example:

1773043200000

Response

Key created. Save the secret immediately — it will not be shown again.

keyId
string
required

Unique ID for this key.

Example:

"key_abc123"

name
string
required

Human-readable label.

Example:

"My trading bot"

scopes
object
required
createdAt
integer
required

Unix timestamp (ms) of key creation.

Example:

1741000000000

secret
string
required

The full API key secret (cc_<64 hex chars>). Shown once — store it securely.

Example:

"cc_a1b2c3d4e5f6..."

expiresAt
integer | null

Unix timestamp (ms) of key expiry. null = never expires.

lastUsedAt
integer | null

Unix timestamp (ms) when the key was last used.