Enterprise API

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

Protocol
HTTPS, JSON responses
Auth
Bearer token made in Manage org › API
Plan
Enterprise
Rate limit
600 requests a minute per token

Getting started

Tokens

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:

ScopeAllows
discoveryRead 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.
auditRead the audit log.
streamsRead, 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.

A token
twe_<32 hex organization id><64 hex secret>
Authenticate
curl "https://tensorworks.net/enterprise/v1/organization" \
  -H "Authorization: Bearer $TENSORWORKS_TOKEN"

Getting started

Making requests

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.

Headers

Authorization string Required
Bearer twe_…, one of the organization’s tokens.
Content-Type string
application/json, on requests with a body.
  • A single item answers { "data": { … } }. A list answers data and next_cursor. See Paging.
  • Ids are 32 lowercase hexadecimal characters. A file is named by its hash, the SHA-256 of its bytes (64 characters). Times are ISO 8601 in UTC.
  • Responses are never cached (Cache-Control: no-store).
  • Every Discovery request is itself recorded in the audit log as discovery.read.
GET /organization
curl "https://tensorworks.net/enterprise/v1/organization" \
  -H "Authorization: Bearer $TENSORWORKS_TOKEN"
200 OK
{
  "data": {
    "id": "2f9b…",
    "name": "Acme",
    "owner_id": "8c1d…",
    "plan": "enterprise",
    "created_at": "2026-03-02T09:14:07.220Z",
    "domains": [
      "acme.com"
    ]
  }
}

Getting started

Paging

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.

Query

limit integer
Items per page, 1 to 1000. Default 100.
cursor string
The next_cursor of the page before, to read on from it.
oldest string
Only items dated at or after this ISO 8601 time.
latest string
Only items dated at or before this ISO 8601 time.

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.

A page
{
  "data": [ … ],
  "next_cursor": "MDAwMDAwOTk"
}
The next page
curl "https://tensorworks.net/enterprise/v1/users?limit=100&cursor=MDAwMDAwOTk" \
  -H "Authorization: Bearer $TENSORWORKS_TOKEN"

Reference

Errors

A failed request answers a matching HTTP status and an error object with a stable code and a message for people.

StatusCodeMeaning
400invalid_limitlimit is not a number from 1 to 1000.
400invalid_timeoldest or latest is not a time.
400invalid_cursorcursor is not one this API answered.
400invalid_kindkind is not a resource kind.
400missing_collectionRecords were asked for without collection.
400invalid_requestThe body is not a JSON object, or a stream was refused. The message says why.
401invalid_tokenThe token is missing, unknown or revoked.
403missing_scopeThe token was not made for this. The message names the scope needed.
403enterprise_requiredThe organization is not on Enterprise.
404not_foundNo such endpoint, or nothing with that id in this organization.
405method_not_allowedThe endpoint exists but not for this method. Allow lists the ones it takes.
429rate_limitedToo many requests. Wait for the seconds in Retry-After.
500internal_errorSomething went wrong on our side. Try again.
403 Forbidden
{
  "error": {
    "code": "missing_scope",
    "message": "This token may not do this: it needs the audit scope."
  }
}
429 Too Many Requests
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."}}

Reference

Limits

WhatLimit
Requests600 a minute per token
Requests with a wrong token30 a minute per IP address
Tokens20 per organization
Token name1–100 characters
Page size1–1000 items, 100 by default
Event streams10 per organization
Stream deliveryUp to 500 events per request, 10 seconds to answer

Questions or something missing? Contact us.