POST
/
api-keys
curl -X POST 'https://api.memsync.ai/api-keys' \
  -H 'Authorization: Bearer YOUR_JWT_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Production API Key",
    "scopes": ["memories:read", "memories:write", "profile:read"],
    "expires_in": 2592000
  }'
{
  "api_key_id": "key_123abc",
  "key": "memsync_sk_live_abc123def456...",
  "name": "Production API Key",
  "scopes": ["memories:read", "memories:write", "profile:read"],
  "created_at": "2024-01-15T16:30:00Z",
  "expires_at": "2024-02-14T16:30:00Z"
}
Creates a new API key for accessing MemSync APIs programmatically.
curl -X POST 'https://api.memsync.ai/api-keys' \
  -H 'Authorization: Bearer YOUR_JWT_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Production API Key",
    "scopes": ["memories:read", "memories:write", "profile:read"],
    "expires_in": 2592000
  }'

Request Body

name
string
required
Human-readable name for the API key
scopes
array
List of permission scopes for the API key
expires_in
number
Expiration time in seconds (max: 1 year)

Response

api_key_id
string
Unique identifier for the API key
key
string
The actual API key (only shown once)
name
string
Name of the API key
scopes
array
Granted permission scopes
created_at
string
When the API key was created
expires_at
string
When the API key expires
{
  "api_key_id": "key_123abc",
  "key": "memsync_sk_live_abc123def456...",
  "name": "Production API Key",
  "scopes": ["memories:read", "memories:write", "profile:read"],
  "created_at": "2024-01-15T16:30:00Z",
  "expires_at": "2024-02-14T16:30:00Z"
}