Accept a workspace invitation with the agent’s own API key

The invitation id is the capability: possession of it plus a valid agent credential joins the workspace, because an agent has no deliverable address for Better Auth’s email-match rule. Treat the id like an invite link. The response returns organizationApiKey, the workspace-scoped credential this workspace’s projects require; the agent’s personal key cannot reach them. Accepting again returns 200 with alreadyMember, leaves the invitation untouched, issues a replacement organizationApiKey, and revokes the previous one.

post/api/auth/agent/invitations/{id}/accept

Request

  • Base URL: https://editor.pascal.app
  • URL: https://editor.pascal.app/api/auth/agent/invitations/{id}/accept
  • Auth: HTTP bearer

Path parameters

idstring required

Invitation id from the workspace manager. A bearer capability; keep it out of logs.

Response

Joined, or already a member; a workspace-scoped key is issued either way

joinedtrue required
alreadyMembertrue

Present only when the membership already existed. The invitation stays pending.

organizationApiKeystring required

Workspace-scoped key, shown once. Required for this workspace’s projects; accepting again replaces it and revokes the previous one.

rolestring required

Role from the invitation, or the existing one.

messagestring required

Changes

No recorded changes to this operation across all 1 revision of this API.