Authentication and access
The Mosoo API separates who is calling from which published Agent is allowed to run. Every request uses a bearer token:agentId identifies the published Agent. Mosoo checks both before it creates or changes a Thread.
Token types
Human PAT
A long-lived token for a registered user. Use it for curl, local tools, user-owned integrations, and API calls that should be attributed to that person.
Organization Service token
A machine caller token for server-side integrations, CI/CD, Managed CLI, and scheduled jobs. It must be allowed to call selected published Agents.
Published Agent access
API access is available only after an Agent is configured and published. A valid request must pass these checks:- The Agent exists.
- The Agent is published and has API Access enabled.
- The bearer token is valid and not revoked.
- The caller is allowed to use the Agent.
- The requested Thread or file is visible to that caller.
Caller access paths
| Access path | Who can call |
|---|---|
| Organization-wide | Active Organization members with a valid Human PAT, plus allowed Service tokens. |
| Invited-only | The Agent owner, explicitly invited collaborators, and allowed Service tokens. |
| Selected Agent service access | Organization Service tokens that explicitly include this published Agent. |
403 Forbidden.
Attribution and execution
Mosoo records the API caller for access checks, attribution, audit logs, and Thread visibility. Runs still use the published Agent owner’s configured capabilities. The API caller does not become the Agent owner, change the Agent’s model provider, or supply provider credentials in the request. For Human PAT calls, the caller is the token owner. For Organization Service token calls, the request may omit user attribution or includeattributed_user_id when that token is allowed to associate work with a bound user.
Token lifecycle
Create and revoke tokens from Mosoo. Revoking a token blocks future API requests from that token; it does not delete existing Threads. Use separate tokens for separate systems when possible:- one Human PAT for local development,
- one Service token per server-side integration or automation,
- selected published Agents for Service tokens,
- clear token labels for audit and rotation.
Idempotency
UseIdempotency-Key for retry-safe create-thread and send-events calls.