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

# Accept an invitation by token

> Accepts the invitation named by the token in the invitation email and joins the organization as the signed-in user.



## OpenAPI

````yaml /api-reference/cloud-platform-openapi.json post /v1/invitations/{token}/accept
openapi: 3.1.0
info:
  description: Account, organization, workspace and billing routes of NEAR AI Cloud.
  title: NEAR AI Cloud Platform API
  version: '5'
servers:
  - url: https://cloud-platform.near.ai
    description: NEAR AI Cloud Platform
security: []
paths:
  /v1/invitations/{token}/accept:
    post:
      tags:
        - Invitations
      summary: Accept an invitation by token
      description: >-
        Accepts the invitation named by the token in the invitation email and
        joins the organization as the signed-in user.
      operationId: accept_invitation_by_token
      parameters:
        - description: The token from the invitation email.
          in: path
          name: token
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AcceptInvitationResponse'
          description: The user joined the organization.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: The invitation can no longer be accepted.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Missing or invalid credential.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: The invitation was sent to a different email address.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: The invitation does not exist.
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: The user is already a member of the organization.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal error.
      security:
        - session: []
components:
  schemas:
    AcceptInvitationResponse:
      description: The membership created by accepting an invitation.
      properties:
        message:
          type: string
        organization_member:
          $ref: '#/components/schemas/OrganizationMemberResponse'
      required:
        - organization_member
        - message
      type: object
    ErrorResponse:
      description: The body of every error answer on the user routes.
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      required:
        - error
      type: object
    OrganizationMemberResponse:
      description: An organization member.
      properties:
        id:
          type: string
        joined_at:
          format: date-time
          type: string
        organization_id:
          type: string
        role:
          $ref: '#/components/schemas/MemberRole'
        user_id:
          type: string
      required:
        - id
        - organization_id
        - user_id
        - role
        - joined_at
      type: object
    ErrorDetail:
      properties:
        code:
          type:
            - string
            - 'null'
        message:
          type: string
        param:
          type:
            - string
            - 'null'
        type:
          type: string
      required:
        - message
        - type
      type: object
    MemberRole:
      description: Member role enum for API
      enum:
        - owner
        - admin
        - member
      type: string
  securitySchemes:
    session:
      bearerFormat: Session token
      description: 'Session token from signing in, sent as `Authorization: Bearer <token>`.'
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.