Invitations · acceptInvitation
Accept an invitation
POST /v1/invitations/accept
The signed-in human joins the workspace with the invited role; their email must be the invited one, and verified (a magic-link sign-in or the confirmation link verifies it: POST /api/auth/verify-email sends one). An unverified email is a 403 email_not_verified. An invitation as Owner also needs the account to own fewer shared workspaces than an account may (402; the invitation stays pending).
- Who may call it
- any signed-in human
- Server
- https://api.logu.dev
Request body#
Content type application/json (required).
The token from the invitation link. Strict.
| Field | Type | Required | Notes |
|---|---|---|---|
token | string | required | 16–200 chars |
{
"token": "Zk3mP9qR2sT5vW8yA1bC4dE7fG0hJ3kL"
}
Example#
curl -s -X POST "https://api.logu.dev/v1/invitations/accept" \
-H "Authorization: Bearer $LOGU_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"token":"Zk3mP9qR2sT5vW8yA1bC4dE7fG0hJ3kL"}'
Responses#
200
The workspace joined.
{
"workspace": {
"id": "wsp_01K7D7Y8Z0B2D4F6H8K0M2P4R6",
"name": "Acme ops",
"personal": false,
"role": "viewer",
"plan": "pro",
"createdAt": "2026-10-02T12:00:00.000Z"
}
}
Response fields
| Field | Type | Required | Notes |
|---|---|---|---|
workspace | Workspace | required | |
workspace.id | string | required | |
workspace.name | string | required | |
workspace.personal | boolean | required | |
workspace.role | "owner" | "decider" | "viewer" | required | |
workspace.plan | "free" | "pro" | required | |
workspace.createdAt | string | required | date-time |
Errors#
Every error is {"error":{"code","message","hint","docUrl","requestId"}}: branch on code. See Errors.
| Status | Code | Meaning |
|---|---|---|
| 400 | bad_request | The request is malformed or a field is invalid (see issues). |
| 400 | unknown_field | The body has a field the endpoint doesn't know (often a typo or snake_case). |
| 401 | unauthorized | No credentials, or the API key or session is invalid or revoked. |
| 402 | plan_limit | This is over one of the workspace's plan quotas: asks, events or metric reports this month, stored images, projects or metric names (Free and Pro), or on Free its agents, members and webhook endpoints (only on servers that enforce plan limits), or a Free account that already owns its shared workspaces (always). |
| 402 | ceiling_reached | The workspace reached one of Logu's cost ceilings (asks, events, metric reports, test traffic or images this month, stored image bytes, projects, metric names or API keys). Unlike plan_limit, upgrading doesn't lift it. An account that already owns the most shared workspaces an account may own gets it too. |
| 403 | forbidden | The caller is authenticated but may not do this (wrong role, or an API key on a human-only endpoint). |
| 403 | email_not_verified | The signed-in human's email isn't verified yet, and this needs it (accepting an invitation, creating a shared workspace, or becoming the Owner of one). |
| 404 | not_found | No such route, or the resource doesn't exist in your workspace. |
| 409 | conflict | The resource isn't in a state that allows this: an ask that is no longer waiting (ask has its current state), an invitation no longer pending, the last Owner. |
| 500 | internal_error | Something went wrong on Logu's side. |