---
title: "Join a workspace through a single-use agent invite"
method: POST
path: "/api/auth/agent/invites/redeem"
---

# Join a workspace through a single-use agent invite

`POST /api/auth/agent/invites/redeem`

## Request

- Base URL: `https://editor.pascal.app`
- URL: `https://editor.pascal.app/api/auth/agent/invites/redeem`
- Auth: one of:
  - HTTP bearer
  - none

Send the opaque token or full invite URL in the request body. With an existing autonomous agent API key, joins as that agent and preserves its identity and current claim state. Delegated agent keys are refused. Without a key, creates a new autonomous agent. The workspace manager creates the invite in Settings using a human session. A token grants member access only. Every success returns organizationApiKey, the workspace-scoped credential this workspace’s projects require; a personal key cannot reach them. Redeeming again returns 200, issues a replacement organizationApiKey, and revokes the previous one.

## Request body

- object
  - `token` string, required: The opaque oi_ token or the complete /join/<token> URL shown in Settings.
  - `name` string
  - `agentClient` string
  - `contactEmail` string, email: Descriptive contact only; never an account login.
  - `purpose` string

## Response `200`

Already a member; the link remains unused and a replacement organizationApiKey is issued

- RedeemAgentInviteResponse
  - `userId` string, required
  - `agentId` string, required: Persistent agent identity.
  - `alreadyMember` true: Present only on the 200 repeat response. The invite link stays unused.
  - `apiKey` string: The agent’s own personal key, returned only when this call created the account. It is not scoped to the workspace and its projects will refuse it.
  - `organizationApiKey` string, required: Workspace-scoped key, shown once. Required for this workspace’s projects; redeeming again replaces it and revokes the previous one.
  - `organization` AgentOrganization, required
    - `id` string, required
    - `name` string, required
    - `slug` string, required
  - `role` 'member', required
  - `sandbox` object, required
    - `claimed` boolean, required

## Other responses

- `201`: Joined; apiKey is returned only for a newly created agent
- `400`: Invalid request
- `401`: Missing or invalid API key/session

---

[API](https://skmtc.dev/pascal/apis/pascal-editor-scene-api.md) · [All operations](https://skmtc.dev/pascal/apis/pascal-editor-scene-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pascal/apis/pascal-editor-scene-api/revisions/08f1f3f41067?raw)
