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
}'
import requests
data = {
"name": "Production API Key",
"scopes": ["memories:read", "memories:write", "profile:read"],
"expires_in": 2592000
}
response = requests.post(
"https://api.memchat.io/api-keys",
headers={"Authorization": "Bearer YOUR_JWT_TOKEN"},
json=data
)
api_key = response.json()
{
"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"
}
API Keys
Create API Key
Create a new API key for programmatic access
POST
/
api-keys
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
}'
import requests
data = {
"name": "Production API Key",
"scopes": ["memories:read", "memories:write", "profile:read"],
"expires_in": 2592000
}
response = requests.post(
"https://api.memchat.io/api-keys",
headers={"Authorization": "Bearer YOUR_JWT_TOKEN"},
json=data
)
api_key = response.json()
{
"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.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
}'
import requests
data = {
"name": "Production API Key",
"scopes": ["memories:read", "memories:write", "profile:read"],
"expires_in": 2592000
}
response = requests.post(
"https://api.memchat.io/api-keys",
headers={"Authorization": "Bearer YOUR_JWT_TOKEN"},
json=data
)
api_key = response.json()
Request Body
string
required
Human-readable name for the API key
array
List of permission scopes for the API key
number
Expiration time in seconds (max: 1 year)
Response
string
Unique identifier for the API key
string
The actual API key (only shown once)
string
Name of the API key
array
Granted permission scopes
string
When the API key was created
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"
}

