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

# List Invitations

> List invitations.

For superadmins: lists all invitations or filters by account_id.
For regular users: lists invitations for their own account only.

Args:
    current_user: Authenticated user context.
    status_filter: Optional status filter (pending, accepted, expired).
    account_id: Optional account ID filter (superadmin only).
    session: Database session.

Returns:
    List of invitations.



## OpenAPI

````yaml get /api/v1/invitations
openapi: 3.1.0
info:
  title: SnackBase
  description: Open-source Backend-as-a-Service (BaaS)
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/invitations:
    get:
      tags:
        - invitations
      summary: List Invitations
      description: |-
        List invitations.

        For superadmins: lists all invitations or filters by account_id.
        For regular users: lists invitations for their own account only.

        Args:
            current_user: Authenticated user context.
            status_filter: Optional status filter (pending, accepted, expired).
            account_id: Optional account ID filter (superadmin only).
            session: Database session.

        Returns:
            List of invitations.
      operationId: list_invitations_api_v1_invitations_get
      parameters:
        - name: status_filter
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/InvitationStatus'
              - type: 'null'
            title: Status Filter
        - name: account_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvitationListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    InvitationStatus:
      type: string
      enum:
        - pending
        - accepted
        - expired
        - cancelled
      title: InvitationStatus
      description: Invitation status enum.
    InvitationListResponse:
      properties:
        invitations:
          items:
            $ref: '#/components/schemas/InvitationResponse'
          type: array
          title: Invitations
          description: List of invitations
        total:
          type: integer
          title: Total
          description: Total number of invitations
      type: object
      required:
        - invitations
        - total
      title: InvitationListResponse
      description: Response schema for listing invitations.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    InvitationResponse:
      properties:
        id:
          type: string
          title: Id
          description: Invitation ID
        account_id:
          type: string
          title: Account Id
          description: Account ID (UUID)
        account_code:
          type: string
          title: Account Code
          description: Human-readable account code in XX#### format (e.g., AB1234)
        email:
          type: string
          title: Email
          description: Email address of the invited user
        invited_by:
          type: string
          title: Invited By
          description: User ID of the inviter
        expires_at:
          type: string
          format: date-time
          title: Expires At
          description: Expiration timestamp
        accepted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Accepted At
          description: Acceptance timestamp (if accepted)
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Creation timestamp
        email_sent:
          type: boolean
          title: Email Sent
          description: Whether the invitation email has been sent
          default: false
        email_sent_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Email Sent At
          description: Timestamp when the email was sent
        status:
          $ref: '#/components/schemas/InvitationStatus'
          description: Current invitation status
        token:
          type: string
          title: Token
          description: Invitation token for constructing acceptance URL
      type: object
      required:
        - id
        - account_id
        - account_code
        - email
        - invited_by
        - expires_at
        - created_at
        - status
        - token
      title: InvitationResponse
      description: Response schema for invitation details.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````