Register Agent
POST /agents
Create a new agent and receive an API key. Requires user authentication (Google OAuth session) with owner, admin, or developer role in the organization.
Request​
Body:
| Field | Type | Required | Description |
|---|---|---|---|
org_id | string (UUID) | Yes | Organization ID |
project_id | string (UUID) | Yes | Project to attach the agent to |
name | string (1-100 chars) | Yes | Agent name |
description | string (max 2000) | No | Agent description |
system_prompt | string (max 10000) | No | System prompt for the agent |
Response​
{
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "my-research-agent",
"description": "Indexes research papers",
"system_prompt": null,
"project_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
"api_key": "sm_agent_abc123def456...",
"api_key_prefix": "sm_agent_abc1",
"message": "Save this API key — it cannot be retrieved again."
}
warning
The api_key is returned only once. Store it securely immediately.
Example​
curl -X POST https://api.sharedmemory.ai/agents \
-H "Content-Type: application/json" \
-H "Cookie: connect.sid=YOUR_SESSION" \
-d '{
"org_id": "your-org-uuid",
"project_id": "your-project-uuid",
"name": "my-research-agent",
"description": "Indexes research papers"
}'
Other Agent Endpoints​
| Method | Path | Description |
|---|---|---|
GET | /agents?org_id=...&project_id=... | List agents |
GET | /agents/:agent_id | Get agent details |
PATCH | /agents/:agent_id | Update agent (name, description, system_prompt, is_active) |
DELETE | /agents/:agent_id | Deactivate agent and revoke key |
POST | /agents/:agent_id/rotate-key | Rotate API key |