Accept a workspace invitation
Accept an invitation to a workspace sent to you.
/user/invitations/{id}/acceptYou join it at once with the role it names. Returns the workspace’s slug in workspace. Refused with 404 when you have no open invitation with that id (it may have been answered, revoked or expired), with 403 until you confirm your email address or when your account does not meet what the workspace asks of its members, such as two-factor authentication, and with payment_required (402) while the workspace is free: it can add no one until it starts the g1t plan, and the invitation stays open until then. People only.
You join at once with the invitation’s role. 404 when you have no open invitation with that id (it may have been answered, revoked or expired). 403 until you confirm your email address, and when your account does not meet what the workspace asks of its members, such as two-factor authentication, with a message that says what to turn on. 402 with payment_required while the workspace is on the free plan; the invitation stays open until it starts the g1t plan. Recorded as member.added.
- Authentication: Required. Send an access token as
Authorization: Bearer. - MCP tool:
accountwithactionaccept_workspace_invitation, and the same inputs - Scope: An access token needs
account:write.
Path parameters
Section titled “Path parameters”| Name | Type | Required | Description |
|---|---|---|---|
id |
string | Yes | The invitation’s id, from list_invitations. |
Example request
Section titled “Example request”curl -X POST https://api.g1t.sh/user/invitations/inv_01kp2x7m8n9q0r1s2t3v4w5x6y/accept \ -H "Authorization: Bearer $G1T_TOKEN"Example response
Section titled “Example response”A successful request answers 200 with:
{ "workspace": "acme-labs"}Errors
Section titled “Errors”A failed request answers with one of these statuses and a body like {"error": {"code": "not_found", "message": "Repository not found."}}. See errors.
| Status | Code | When |
|---|---|---|
| 401 | unauthenticated |
A token is required, or the one sent is not valid. |
| 403 | forbidden |
The token is valid but not allowed to do this, such as a member-only change or an agent token outside its repository. |
| 404 | not_found |
It does not exist, or you cannot see it. |
| 409 | conflict |
The request conflicts with the current state. |
| 422 | invalid |
The input is not valid. message says which field and why. |