> ## 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.

# Preview Team Invite

> Show what a team invite is for, before accepting it.

Returns the team, who sent the invite, the role it carries and when it
expires. It does not say whether the invited address already has an
account: offer both "sign in" (then `POST /api/auth/team-invites/accept`)
and "create account" (`POST /api/auth/team-invites/accept-new`).

`role` is `member` or `admin`; an `admin` invite currently joins as a
member. An unknown, expired, revoked or already used invite returns 404
`team_invite_invalid`. Previewing does not use the invite up.



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/auth/team-invites/preview
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/preview:
    post:
      tags:
        - auth
      summary: Preview Team Invite
      description: >-
        Show what a team invite is for, before accepting it.


        Returns the team, who sent the invite, the role it carries and when it

        expires. It does not say whether the invited address already has an

        account: offer both "sign in" (then `POST
        /api/auth/team-invites/accept`)

        and "create account" (`POST /api/auth/team-invites/accept-new`).


        `role` is `member` or `admin`; an `admin` invite currently joins as a

        member. An unknown, expired, revoked or already used invite returns 404

        `team_invite_invalid`. Previewing does not use the invite up.
      operationId: auth.post_auth_post_auth_team_invites_preview
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/TeamInviteTokenRequest'
        required: true
      responses:
        '200':
          content:
            application/vnd.api+json:
              schema:
                $ref: >-
                  #/components/schemas/JsonApiResponse_TeamInvitePreviewAttributes_
          description: Successful Response
        '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
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
    JsonApiResponse_TeamInvitePreviewAttributes_:
      properties:
        data:
          $ref: '#/components/schemas/JsonApiResource_TeamInvitePreviewAttributes_'
        included:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Included
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - data
      title: JsonApiResponse[TeamInvitePreviewAttributes]
      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
    JsonApiResource_TeamInvitePreviewAttributes_:
      properties:
        attributes:
          $ref: '#/components/schemas/TeamInvitePreviewAttributes'
        id:
          title: Id
          type: string
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        relationships:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Relationships
        type:
          title: Type
          type: string
      required:
        - id
        - type
        - attributes
      title: JsonApiResource[TeamInvitePreviewAttributes]
      type: object
    JsonApiLinks:
      properties:
        self:
          anyOf:
            - type: string
            - type: 'null'
          title: Self
      title: JsonApiLinks
      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
    TeamInvitePreviewAttributes:
      description: |-
        What an invite is for, as its recipient sees it before accepting.

        Never the invited address and never whether it has an account.
      properties:
        expires_at:
          title: Expires At
          type: string
        inviter_name:
          title: Inviter Name
          type: string
        role:
          enum:
            - member
            - admin
          title: Role
          type: string
        team_id:
          title: Team Id
          type: string
        team_name:
          title: Team Name
          type: string
      required:
        - team_id
        - team_name
        - inviter_name
        - role
        - expires_at
      title: TeamInvitePreviewAttributes
      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

````

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