An HTTP API over everything your organization holds and everything that happens in it, for the tools you archive, search and monitor with. It is part of Enterprise.
It is separate from the General API that agents work through over MCP: it authenticates with an organization's own tokens, answers plain JSON over HTTPS, and only reads your data. The one thing it changes is where the audit log is streamed.
Base URL
https://tensorworks.net/enterprise/v1
Getting started
An owner or admin makes tokens in Manage org › API. A token belongs to the organization, not to a person, and keeps working when whoever made it leaves. It is shown once: only its hash is stored, so a lost token can't be recovered. Make a new one instead.
Each token is limited to the scopes chosen when it was made:
| Scope | Allows |
|---|---|
discovery | Read everything the organization holds: people and their sessions, agents, projects, resources, records, messages and files, including deleted ones. A person's sessions and direct messages are read only from while they were on the team. |
audit | Read the audit log. |
streams | Read, add, pause, test and remove event streams. |
Revoking a token stops it at once. Tokens are refused with 403 enterprise_required while the organization is not on Enterprise, and work again if it returns. Creating and revoking a token are events in the audit log.
twe_<32 hex organization id><64 hex secret>curl "https://tensorworks.net/enterprise/v1/organization" \
-H "Authorization: Bearer $TENSORWORKS_TOKEN"Getting started
Send the token as a bearer credential on every request. Requests with a body (POST and PATCH on streams) send a JSON object with Content-Type: application/json.
Authorization string RequiredBearer twe_…, one of the organization’s tokens.Content-Type string application/json, on requests with a body.{ "data": { … } }. A list answers data and next_cursor. See Paging.hash, the SHA-256 of its bytes (64 characters). Times are ISO 8601 in UTC.Cache-Control: no-store).discovery.read.curl "https://tensorworks.net/enterprise/v1/organization" \
-H "Authorization: Bearer $TENSORWORKS_TOKEN"{
"data": {
"id": "2f9b…",
"name": "Acme",
"owner_id": "8c1d…",
"plan": "enterprise",
"created_at": "2026-03-02T09:14:07.220Z",
"domains": [
"acme.com"
]
}
}Getting started
Lists answer a page of items in data, oldest first, and next_cursor. Pass it as cursor to read the next page, and stop when it is null. Cursors are opaque: keep them as given.
limit integer cursor string next_cursor of the page before, to read on from it.oldest string latest string The audit log pages the same way, except that its next_cursor is never null: the log goes on, so keep the cursor and ask again later.
{
"data": [ … ],
"next_cursor": "MDAwMDAwOTk"
}curl "https://tensorworks.net/enterprise/v1/users?limit=100&cursor=MDAwMDAwOTk" \
-H "Authorization: Bearer $TENSORWORKS_TOKEN"Reference
Every path is relative to https://tensorworks.net/enterprise/v1.
| Endpoint | Scope |
|---|---|
GET /organization | discovery |
GET /users | discovery |
GET /users/{user}/sessions | discovery |
GET /users/{user}/conversations | discovery |
GET /agents | discovery |
GET /projects | discovery |
GET /resources | discovery |
GET /resources/{resource} | discovery |
GET /resources/{resource}/records | discovery |
GET /resources/{resource}/messages | discovery |
GET /resources/{resource}/files | discovery |
GET /resources/{resource}/files/{hash}/content | discovery |
GET /conversations/{user}/{other}/messages | discovery |
GET /conversations/{user}/{other}/files | discovery |
GET /conversations/{user}/{other}/files/{hash}/content | discovery |
GET /audit/events | audit |
GET /streams | streams |
POST /streams | streams |
GET /streams/{stream} | streams |
PATCH /streams/{stream} | streams |
DELETE /streams/{stream} | streams |
POST /streams/{stream}/test | streams |
Reference
A failed request answers a matching HTTP status and an error object with a stable code and a message for people.
| Status | Code | Meaning |
|---|---|---|
400 | invalid_limit | limit is not a number from 1 to 1000. |
400 | invalid_time | oldest or latest is not a time. |
400 | invalid_cursor | cursor is not one this API answered. |
400 | invalid_kind | kind is not a resource kind. |
400 | missing_collection | Records were asked for without collection. |
400 | invalid_request | The body is not a JSON object, or a stream was refused. The message says why. |
401 | invalid_token | The token is missing, unknown or revoked. |
403 | missing_scope | The token was not made for this. The message names the scope needed. |
403 | enterprise_required | The organization is not on Enterprise. |
404 | not_found | No such endpoint, or nothing with that id in this organization. |
405 | method_not_allowed | The endpoint exists but not for this method. Allow lists the ones it takes. |
429 | rate_limited | Too many requests. Wait for the seconds in Retry-After. |
500 | internal_error | Something went wrong on our side. Try again. |
{
"error": {
"code": "missing_scope",
"message": "This token may not do this: it needs the audit scope."
}
}HTTP/1.1 429 Too Many Requests
Retry-After: 60
Content-Type: application/json
{"error":{"code":"rate_limited","message":"A token makes up to 600 requests a minute. Try again shortly."}}Questions or something missing? Contact us.