Skip to main content

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:

FieldTypeRequiredDescription
org_idstring (UUID)YesOrganization ID
project_idstring (UUID)YesProject to attach the agent to
namestring (1-100 chars)YesAgent name
descriptionstring (max 2000)NoAgent description
system_promptstring (max 10000)NoSystem 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​

MethodPathDescription
GET/agents?org_id=...&project_id=...List agents
GET/agents/:agent_idGet agent details
PATCH/agents/:agent_idUpdate agent (name, description, system_prompt, is_active)
DELETE/agents/:agent_idDeactivate agent and revoke key
POST/agents/:agent_id/rotate-keyRotate API key