> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openhands.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Accept Invitation

> Accept an organization invitation via authenticated POST request.

This endpoint is called by the frontend after displaying the acceptance modal.
Requires authentication - cookies are sent because this is a same-origin request.

Args:
    request_data: Contains the invitation token
    user_id: Authenticated user ID (from dependency)

Returns:
    AcceptInvitationResponse: Success response with organization details

Raises:
    HTTPException 400: Invalid or expired token
    HTTPException 403: Email mismatch
    HTTPException 409: User already a member



## OpenAPI

````yaml /openapi/openhands-cloud.json post /api/organizations/members/invite/accept
openapi: 3.1.0
info:
  title: OpenHands
  description: 'OpenHands: Code Less, Make More'
  version: 0.0.1
servers: []
security: []
paths:
  /api/organizations/members/invite/accept:
    post:
      summary: Accept Invitation
      description: >-
        Accept an organization invitation via authenticated POST request.


        This endpoint is called by the frontend after displaying the acceptance
        modal.

        Requires authentication - cookies are sent because this is a same-origin
        request.


        Args:
            request_data: Contains the invitation token
            user_id: Authenticated user ID (from dependency)

        Returns:
            AcceptInvitationResponse: Success response with organization details

        Raises:
            HTTPException 400: Invalid or expired token
            HTTPException 403: Email mismatch
            HTTPException 409: User already a member
      operationId: accept_invitation_api_organizations_members_invite_accept_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AcceptInvitationRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AcceptInvitationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    AcceptInvitationRequest:
      properties:
        token:
          type: string
          title: Token
      type: object
      required:
        - token
      title: AcceptInvitationRequest
      description: Request model for accepting an invitation via POST.
    AcceptInvitationResponse:
      properties:
        success:
          type: boolean
          title: Success
        org_id:
          type: string
          title: Org Id
        org_name:
          type: string
          title: Org Name
        role:
          type: string
          title: Role
      type: object
      required:
        - success
        - org_id
        - org_name
        - role
      title: AcceptInvitationResponse
      description: Response model for successful invitation acceptance.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-Access-Token

````