Creates a new API key for accessing MemSync APIs programmatically.
curl -X POST 'https://api.memchat.io/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
Human-readable name for the API key
List of permission scopes for the API key
Expiration time in seconds (max: 1 year)
Response
Unique identifier for the API key
The actual API key (only shown once)
Granted permission scopes
When the API key was created
{
"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"
}