API Tokens
API tokens let scripts, CI/CD pipelines, and third-party tools authenticate to Memory without an interactive login. Tokens are scoped to a project and carry only the permissions you grant.
Token format
Section titled “Token format”All tokens use the prefix emt_ (e.g. emt_abc123...). Tokens are:
- Scoped to a specific project
- Revocable at any time
- Auditable —
lastUsedAttracks recent activity - Stored as a bcrypt hash — the plaintext value is only shown at creation
Creating a Token
Section titled “Creating a Token”memory tokens create \ --name "CI/CD Pipeline" \ --scopes "documents:read,search,agents:write" \ --project my-projectThe CLI also accepts presets: --scopes read (the read-only set),
--scopes write (the write set, which also implies the matching reads) or
--scopes read,write for both.
POST /api/projects/{projectId}/tokensContent-Type: application/json
{ "name": "CI/CD Pipeline", "scopes": ["documents:read", "search", "agents:write"]}Response (token value shown once only):
{ "id": "tok_abc123", "name": "CI/CD Pipeline", "token": "emt_abc123...", "scopes": ["documents:read", "search", "agents:write"], "tokenPrefix": "emt_abc", "createdAt": "2026-03-08T10:00:00Z"}Scopes Reference
Section titled “Scopes Reference”| Scope | Access |
|---|---|
documents:read |
Read documents |
documents:write |
Create and update documents |
documents:delete |
Delete documents |
ingest:write |
Trigger document ingestion/parsing |
chunks:read |
Read document chunks |
chunks:write |
Create and update chunks |
graph:read |
Read graph objects |
graph:write |
Create and update graph objects |
graph:search:read |
Graph vector search |
search |
Run hybrid and semantic search (MCP) |
search:read |
Unified REST search |
journal:read |
Read the project journal |
extraction:read |
View extraction jobs |
extraction:write |
Manage extraction jobs |
tasks:read |
Read tasks |
tasks:write |
Resolve and cancel tasks |
notifications:read |
Read notifications |
notifications:write |
Mark notifications as read |
user-activity:read |
View the activity log |
user-activity:write |
Write activity entries |
schema:read |
Read type definitions and template packs |
schema:write |
Install and modify schemas |
agents:read |
Read agents, runs, definitions, questions |
agents:write |
Trigger agents, respond to questions, manage hooks |
projects:read |
Read project metadata and members |
projects:write |
Update project settings and members |
Assign only the scopes your integration needs. The full list, including branch, skill and admin scopes, is in Security and Scopes.
The CLI also accepts two presets: --scopes read (the read-only set above) and
--scopes write (documents, graph, schema, agents and project writes, plus the
REST write scopes the retired data:write umbrella used to imply). Combine them
with --scopes read,write.
Using a Token
Section titled “Using a Token”memory --project-token emt_abc123... agents list# or via environment variable:export MEMORY_PROJECT_API_KEY=emt_abc123...memory agents listAuthorization: Bearer emt_abc123...client, err := sdk.New(sdk.Config{ ServerURL: "https://api.example.com", Auth: sdk.AuthConfig{ Mode: "apitoken", APIKey: "emt_abc123...", },})Listing Tokens
Section titled “Listing Tokens”memory tokens list --project my-projectGET /api/projects/{projectId}/tokensResponse shows token metadata but never the plaintext value. Use tokenPrefix to identify which token is which.
Revoking a Token
Section titled “Revoking a Token”memory tokens revoke <token-id> --project my-projectDELETE /api/projects/{projectId}/tokens/{tokenId}The token is invalidated immediately. Any requests using it will receive 401 Unauthorized.
CI/CD Example
Section titled “CI/CD Example”# GitHub Actions- name: Trigger nightly agent run: | memory agents trigger $AGENT_ID --project $PROJECT_ID env: MEMORY_SERVER_URL: https://api.example.com MEMORY_PROJECT_API_KEY: ${{ secrets.MEMORY_TOKEN }}