Auth API · views

Exchange the signed-in person's session for a token in one personal view

POST /api/auth/views/{view}/session

Exchange the signed-in person's session for a token in one personal view — reporting, the B2B order form, the support desk, the ops board or the back office — which the view's app carries on every call: the person's own claims with the view, whose ceiling every service narrows their roles by.

403 ViewNotOpened when their roles do not open the view, 400 ViewNeedsStation for a station's view (those open by unlocking an enrolled station), 403 NoActiveOrganization when the session names no organization the person still reaches, 404 UnknownView for a view there is not. Appends nothing: a mint changes no state, and the sign-in it is minted from was journalled when it happened. No idempotency key: a retry mints another short-lived token and appends nothing.

Access

Requires a signed-in session: The signed-in person's own session, in the organization it is active in; the view's app calls it after sign-in

How scopes come from roles: Scopes and roles. Getting a token: Authentication and app tokens.

Retries

No idempotency key: a retry mints another short-lived token and appends nothing.

Why every write carries a key: Idempotency and retries.

Facts appended

None. This call records nothing in a journal.

What a fact is: Facts and the journal.

AI agent tool

No agent tool. Opening a session in a view mints a token for that view's app after a person signs in; a token is never handed to an agent, whose own session is the MCP exchange.

Connecting an agent: AI agents.

Example

From Set up a station and unlock it with a PIN, step 8: Open the reporting view.

curl
curl -X POST 'https://auth.getmanifold.io/api/auth/views/reporting/session' \
  -H "Authorization: Bearer $MANIFOLD_TOKEN"
JavaScript (fetch)
const response = await fetch("https://auth.getmanifold.io/api/auth/views/reporting/session", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.MANIFOLD_TOKEN}` },
});
if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);
const answer = await response.json();
Response · 200 · application/json
{
  "token": "eyJhbGciOiJFZERTQSJ9.eyJ2aWV3IjoicmVwb3J0aW5nIn0.dmlldy1zZXNzaW9u",
  "expiresAt": "2026-08-17T09:15:00.000Z",
  "tenantId": "org_01a1586e-f9f6-7a8b-9c7d-6e5f4a3b2c1d",
  "userId": "usr_01a15869-1d2e-7f3a-8b4c-5d6e7f8a9b0c",
  "view": "reporting"
}

The panel writes this call in other languages. It does not send it: Manifold's APIs do not take calls from a web page on another site, so run the call from your own code or terminal. The whole API as OpenAPI: auth-service.openapi.json. Base URL https://auth.getmanifold.io.

Errors

Every refusal is a status and a JSON body whose _tag names it. A refused call changes nothing.

400

RefusalWhat it meansWhat to do
ViewNeedsStation view The request was refused, and nothing changed.Fix the request. Sending it again unchanged gets the same answer.

401

RefusalWhat it meansWhat to do
Unauthorized reason The token is missing, expired or not one Manifold issued.Get a fresh token and send the call again.
TokenAlreadyUsed tokenId A single-use app token was already spent.Mint a new token for this call.

402

RefusalWhat it meansWhat to do
SubscriptionRequired status The organization's subscription has lapsed, so writes are refused.An owner settles billing. Reads still work meanwhile.

403

RefusalWhat it meansWhat to do
ViewNotOpened view Their roles do not open the view.The caller may not do this. Use a token whose roles allow it.
NoActiveOrganization The session names no organization the person still reaches.The caller may not do this. Use a token whose roles allow it.
TenantRequired userId The token names no organization.Choose the organization, then get a new token.
ScopeRequired required The token's roles do not grant the scope this call needs.Ask an owner or admin for a role that grants it.

404

RefusalWhat it meansWhat to do
UnknownView view No such record in this organization.Check the id in the path or the body.

409

RefusalWhat it meansWhat to do
MirroredFromSource source This area is fed by your source system until the organization goes live.Make the change in the source system, or go live first.

503

RefusalWhat it meansWhat to do
RequestLogUnavailable tokenId, reason The service could not record the request, so it did nothing.Send the same request again shortly.

How refusals work everywhere: Errors.

Used in