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

# Accept Team Invite

> Accept a team invite as the signed-in user.

The invite must have been sent to the signed-in account's email address,
and that address must be verified. On success the account joins the team
and a new access + refresh pair is returned: every other session of the
account is signed out, so store the returned pair in place of the old
one. Sets an HttpOnly refresh cookie when the request originates from a
configured platform origin. Accepting when already a member succeeds
without changing the membership.

Errors: 404 `team_invite_invalid` (unknown, expired, revoked or already
used); 403 `team_invite_email_mismatch` (sign in with the invited address)
or `team_invite_email_unverified` (verify the address first); 401
`access_token_invalid` when the session is no longer current. API keys
cannot accept invites.



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/auth/team-invites/accept
openapi: 3.1.0
info:
  description: >-
    Production API reference for Membership.io. Use the authored guides for
    workflows and the generated endpoint pages for exact parameters and schemas.
  title: Membership.io API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.member.dev
security:
  - bearerAuth: []
paths:
  /api/v1/auth/team-invites/accept:
    post:
      tags:
        - auth
      summary: Accept Team Invite
      description: >-
        Accept a team invite as the signed-in user.


        The invite must have been sent to the signed-in account's email address,

        and that address must be verified. On success the account joins the team

        and a new access + refresh pair is returned: every other session of the

        account is signed out, so store the returned pair in place of the old

        one. Sets an HttpOnly refresh cookie when the request originates from a

        configured platform origin. Accepting when already a member succeeds

        without changing the membership.


        Errors: 404 `team_invite_invalid` (unknown, expired, revoked or already

        used); 403 `team_invite_email_mismatch` (sign in with the invited
        address)

        or `team_invite_email_unverified` (verify the address first); 401

        `access_token_invalid` when the session is no longer current. API keys

        cannot accept invites.
      operationId: auth.post_auth_post_auth_team_invites_accept
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/TeamInviteTokenRequest'
        required: true
      responses:
        '200':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/TokenResponse'
          description: Successful Response
        '401':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Not signed in, or session stale
        '403':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: >-
            Invite sent to another address (`team_invite_email_mismatch`),
            address not verified (`team_invite_email_unverified`), or called
            with an API key
        '404':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: >-
            Invite unknown, expired, revoked or already used
            (`team_invite_invalid`)
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Malformed body
        '429':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Rate limited
      security:
        - HTTPBearer: []
components:
  schemas:
    TeamInviteTokenRequest:
      additionalProperties: false
      description: '``token`` is the value after ``#`` in the invite email''s link.'
      properties:
        token:
          maxLength: 512
          minLength: 1
          title: Token
          type: string
      required:
        - token
      title: TeamInviteTokenRequest
      type: object
    TokenResponse:
      properties:
        access_token:
          title: Access Token
          type: string
        expires_in:
          title: Expires In
          type: integer
        refresh_token:
          title: Refresh Token
          type: string
        token_type:
          default: Bearer
          title: Token Type
          type: string
      required:
        - access_token
        - refresh_token
        - expires_in
      title: TokenResponse
      type: object
    JsonApiErrorResponse:
      description: Error JSON:API response.
      properties:
        errors:
          items:
            $ref: '#/components/schemas/JsonApiError'
          title: Errors
          type: array
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - errors
      title: JsonApiErrorResponse
      type: object
    JsonApiError:
      properties:
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        source:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Source
        status:
          title: Status
          type: string
        title:
          title: Title
          type: string
      required:
        - status
        - title
      title: JsonApiError
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT or mio_sk API key
      description: >-
        Send platform JWTs, contact JWTs, or team API keys as `Authorization:
        Bearer <token>`.
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````

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