---
updatedAt: 2026-09-02T17:35:26.000Z
agentTools:
  projectIndex: https://docs.go.v7labs.com/llms.txt
---

# Accept an invitation

Accepts the invitation, adding user to the workspace. An invitation accepted already answers 200 with the invitation. So does an invitation that the directory of the caller replaced with a workspace assignment (status `superseded`), when the caller has the workspace. Without the workspace, such an invitation answers 400 `invitation_superseded`.

# OpenAPI definition

```json
{
  "components": {
    "schemas": {
      "Common.APIErrorDetails": {
        "description": "Additional structured error context. Shape varies by error code.\n\n- For conflict errors: contains a `conflicts` array with conflicting resources\n- For other errors: may contain arbitrary error-specific context",
        "nullable": true,
        "oneOf": [
          {
            "$ref": "#/components/schemas/Common.ConflictErrorDetails"
          },
          {
            "additionalProperties": true,
            "description": "Generic error details for non-conflict errors",
            "type": "object",
            "x-struct": null,
            "x-validate": null
          }
        ],
        "title": "Common.APIErrorDetails",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Common.APIErrorDetails",
        "x-validate": null
      },
      "Common.ConflictErrorDetails": {
        "additionalProperties": false,
        "description": "Details for conflict errors",
        "properties": {
          "conflicts": {
            "description": "List of conflicting resources",
            "items": {
              "additionalProperties": true,
              "type": "object",
              "x-struct": null,
              "x-validate": null
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "conflicts"
        ],
        "title": "Common.ConflictErrorDetails",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Common.ConflictErrorDetails",
        "x-validate": null
      },
      "Common.UUID": {
        "example": "e23ff3f3-8f77-4e78-9e81-fdb25abfb781",
        "format": "uuid",
        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
        "title": "Common.UUID",
        "type": "string",
        "x-struct": null,
        "x-validate": null
      },
      "Invitations.ProjectInvitation": {
        "additionalProperties": false,
        "description": "A project invitation",
        "properties": {
          "email": {
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "expires_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          },
          "id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "invite_url": {
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "project_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "role": {
            "$ref": "#/components/schemas/Invitations.Role"
          },
          "status": {
            "enum": [
              "accepted",
              "superseded",
              "pending",
              "expired"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "workspace_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "workspace_role": {
            "$ref": "#/components/schemas/Invitations.Role"
          }
        },
        "required": [
          "id",
          "workspace_id",
          "project_id",
          "email",
          "role",
          "workspace_role",
          "status",
          "expires_at",
          "invite_url"
        ],
        "title": "Invitations.ProjectInvitation",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Invitations.ProjectInvitation",
        "x-validate": null
      },
      "Invitations.WorkspaceInvitationResponse": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/Invitations.WorkspaceInvitation"
          },
          {
            "$ref": "#/components/schemas/Invitations.ProjectInvitation"
          }
        ],
        "title": "Invitations.WorkspaceInvitationResponse",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Invitations.WorkspaceInvitationResponse",
        "x-validate": null
      },
      "Invitations.Role": {
        "enum": [
          "admin",
          "editor",
          "contributor",
          "reviewer",
          "reader",
          "worker"
        ],
        "title": "Invitations.Role",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Invitations.Role",
        "x-validate": null
      },
      "Invitations.WorkspaceInvitation": {
        "additionalProperties": false,
        "description": "A workspace invitation",
        "properties": {
          "email": {
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "expires_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          },
          "id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "invite_url": {
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "role": {
            "$ref": "#/components/schemas/Invitations.Role"
          },
          "status": {
            "enum": [
              "accepted",
              "superseded",
              "pending",
              "expired"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "user_group_ids": {
            "items": {
              "$ref": "#/components/schemas/Common.UUID"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "workspace_id": {
            "$ref": "#/components/schemas/Common.UUID"
          }
        },
        "required": [
          "id",
          "workspace_id",
          "email",
          "role",
          "status",
          "expires_at",
          "invite_url",
          "user_group_ids"
        ],
        "title": "Invitations.WorkspaceInvitation",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Invitations.WorkspaceInvitation",
        "x-validate": null
      },
      "Common.DateTime": {
        "description": "DateTime in RFC3339 format",
        "example": "2020-01-20T14:00:00Z",
        "format": "date-time",
        "title": "Common.DateTime",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Common.DateTime",
        "x-validate": null
      },
      "Common.APIError": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "example": "bad_request",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "details": {
            "$ref": "#/components/schemas/Common.APIErrorDetails"
          },
          "message": {
            "example": "Bad Request",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "Common.APIError",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Common.APIError",
        "x-validate": null
      },
      "Invitations.AcceptInvitationBadRequestError": {
        "additionalProperties": false,
        "description": "`invitation_invalid` for a token that does not verify or an invitation of\nanother workspace or another person. `invitation_invitee_mismatch` when the\ninvitation is for another email. `invitation_expired` when it expired.\n`invitation_superseded` when the directory of the caller replaced it with a\nworkspace assignment and the caller does not have the workspace.\n`invitation_role_blocked_by_group_membership` when a user group of the caller\nhas a role in the workspace above the invited role.\n`bad_request` is a malformed request.\n",
        "properties": {
          "code": {
            "enum": [
              "bad_request",
              "invitation_invalid",
              "invitation_invitee_mismatch",
              "invitation_expired",
              "invitation_superseded",
              "invitation_role_blocked_by_group_membership"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "message": {
            "example": "Bad Request",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "Invitations.AcceptInvitationBadRequestError",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Invitations.AcceptInvitationBadRequestError",
        "x-validate": null
      },
      "Invitations.AcceptInvitationRequest": {
        "additionalProperties": false,
        "description": "A request to accept workspece invitation",
        "properties": {
          "invite_token": {
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "invite_token"
        ],
        "title": "Invitations.AcceptInvitationRequest",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Invitations.AcceptInvitationRequest",
        "x-validate": null
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "in": "header",
        "name": "X-API-KEY",
        "type": "apiKey"
      },
      "BearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "title": "V7 Go API",
    "version": "0.1.0"
  },
  "openapi": "3.0.0",
  "paths": {
    "/api/workspaces/{workspace_id}/invitations/accept": {
      "post": {
        "callbacks": {},
        "description": "Accepts the invitation, adding user to the workspace. An invitation accepted already answers 200 with the invitation. So does an invitation that the directory of the caller replaced with a workspace assignment (status `superseded`), when the caller has the workspace. Without the workspace, such an invitation answers 400 `invitation_superseded`.",
        "operationId": "workspace-invitation-accept",
        "parameters": [
          {
            "description": "",
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Common.UUID"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Invitations.AcceptInvitationRequest"
              }
            }
          },
          "description": "Invitations.AcceptInvitationRequest",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invitations.WorkspaceInvitationResponse"
                }
              }
            },
            "description": "Invitations.WorkspaceInvitationResponse"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invitations.AcceptInvitationBadRequestError"
                }
              }
            },
            "description": "Invitations.AcceptInvitationBadRequestError"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          }
        },
        "summary": "Accept an invitation",
        "tags": [
          "WorkspaceInvitations"
        ]
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    },
    {
      "ApiKeyAuth": []
    }
  ],
  "servers": [
    {
      "description": "EU",
      "url": "https://go.v7labs.com",
      "variables": {}
    },
    {
      "description": "US",
      "url": "https://go.us.v7labs.com",
      "variables": {}
    },
    {
      "description": "UAE",
      "url": "https://go.uae.v7labs.com",
      "variables": {}
    }
  ]
}
```