Sign-in and account
Sign an app in, read the signed-in account, and sign out.
| Operation | Request |
|---|---|
| Get account | GET /v1/account |
| The caller's access history | GET /v1/account/access |
| Start app login | POST /v1/device/code |
| Sign out app | POST /v1/device/sign-out |
| Poll app login | POST /v1/device/token |
Get account
GET /v1/account · getAccount
Existing account and current workspace memberships. Accepts app sess_ sessions, oa_sk_ sign-in keys, and account-bound oak_ API keys. Credential prefixes alone do not prove authorization.
Sign-in: a bearer credential in the Authorization header.
appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.
Response
200 — The authenticated account.
Type: AppAccountView
| Field | Type | Required | Description |
|---|---|---|---|
v | always "openagents.accounts.v1" | No | |
account | AppAccount | Yes | |
account.id | string | Yes | |
account.label | string | Yes | |
account.email | string or null | No | |
account.avatar_url | string or null | No | |
account.admin | boolean | No | |
workspaces | array of AppWorkspace | Yes | |
workspaces[].id | string | Yes | |
workspaces[].name | string | Yes | |
workspaces[].kind | string | Yes | |
workspaces[].role | string | Yes | |
workspaces[].tenant | string | Yes | |
workspaces[].seats | integer or null | No | |
workspaces[].members | integer | No |
Errors
| Status | Meaning | Body |
|---|---|---|
| 401 | Missing, expired, invalid, or revoked credential. | AppAccountError |
| 403 | Credential cannot act for an account. | AppAccountError |
| 404 | The account no longer exists. | AppAccountError |
| 503 | Account storage is unavailable. | AppAccountError |
Example
curl 'https://api.openagents.com/v1/account' \
-H "Authorization: Bearer $OPENAGENTS_TOKEN"
In the Rust SDK
The caller's access history
GET /v1/account/access · get-v1-account-access
Actor, action, workspace, session digest, and detail for the caller's own events. Secrets are redacted by construction — they are never in the store to begin with.
Sign-in: a bearer credential in the Authorization header.
bearer: An issued key: oak_<id>.<secret>. Omitted entirely for anonymous access to shared doors, which a require_workspace_membership deployment refuses outright.
Response
200 — The operation completed.
Type: object
Errors
| Status | Meaning | Body |
|---|---|---|
| 400, 401, 403, 404, 409, 503 | A typed refusal — see the | TypedError |
Example
curl 'https://api.openagents.com/v1/account/access' \
-H "Authorization: Bearer $OPENAGENTS_TOKEN"
Start app login
POST /v1/device/code · startAppLogin
Start signing an app in. Show the person the returned code and address, then poll for the session.
Sign-in: none needed.
Request body
Content type: application/json
Type: AppDeviceRequest
| Field | Type | Required | Description |
|---|---|---|---|
app | string | No | Default: |
computer | string | Yes |
Response
200 — The app's result. Tokens and codes are returned only here; do not cache.
Type: AppDeviceGrant
| Field | Type | Required | Description |
|---|---|---|---|
device_code | string | Yes | |
user_code | string | Yes | |
verification_uri | string (uri) | Yes | |
verification_uri_complete | string (uri) | Yes | |
expires_in | always 600 | Yes | |
interval | always 5 | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 400 | Invalid request, pending, slow_down, denied, expired, or already redeemed grant. | AppOAuthError |
| 503 | Sign-in is temporarily unavailable. | AppOAuthError |
Example
curl -X POST 'https://api.openagents.com/v1/device/code' \
-H 'Content-Type: application/json' \
-d '{
"computer": "string"
}'
In the Rust SDK
Sign out app
POST /v1/device/sign-out · signOutApp
Revoke this app session. Already expired/revoked sessions are signed out. A sign-in key is a session too; revoking it here is not a local forget operation.
Sign-in: a bearer credential in the Authorization header.
appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.
Response
200 — The app's result. Tokens and codes are returned only here; do not cache.
Type: AppSignedOut
| Field | Type | Required | Description |
|---|---|---|---|
signed_out | always true | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 400 | Invalid request, pending, slow_down, denied, expired, or already redeemed grant. | AppOAuthError |
| 401 | Invalid app credential. | AppOAuthError |
| 503 | Sign-in is temporarily unavailable. | AppOAuthError |
Example
curl -X POST 'https://api.openagents.com/v1/device/sign-out' \
-H "Authorization: Bearer $OPENAGENTS_TOKEN"
In the Rust SDK
Poll app login
POST /v1/device/token · pollAppLogin
Poll for the session of a sign-in you started. Wait the returned interval between polls.
Sign-in: none needed.
Request body
Content type: application/json
Type: AppDevicePoll
| Field | Type | Required | Description |
|---|---|---|---|
device_code | string | Yes | |
grant_type | always "urn:ietf:params:oauth:grant-type:device_code" | No |
Response
200 — The app's result. Tokens and codes are returned only here; do not cache.
Type: AppSession
| Field | Type | Required | Description |
|---|---|---|---|
access_token | string | Yes | |
token_type | always "Bearer" | Yes | |
expires_in | integer | Yes | |
account | AppAccount | Yes | |
account.id | string | Yes | |
account.label | string | Yes | |
account.email | string or null | No | |
account.avatar_url | string or null | No | |
account.admin | boolean | No |
Errors
| Status | Meaning | Body |
|---|---|---|
| 400 | Invalid request, pending, slow_down, denied, expired, or already redeemed grant. | AppOAuthError |
| 503 | Sign-in is temporarily unavailable. | AppOAuthError |
Example
curl -X POST 'https://api.openagents.com/v1/device/token' \
-H 'Content-Type: application/json' \
-d '{
"device_code": "string"
}'