# List Invitations

`GET /v1/invitations`

The pending invitations to one workspace, or with no ``project_id`` every
one in the organization, each naming its space. Needs ``members:read``,
and a creator who manages people there.

- Base URL: `https://junction-api.qualiastudios.dev`
- Authentication: an API key in the `X-API-Key` header, or `Authorization: Bearer …`

## Parameters

- `project_id` (query, string | null (uuid)): A workspace of the organization; omit it for the organization itself. A workspace key names its own workspace.

## Responses

- `200` The pending invitations: `application/json` `InvitationList`
- `401` Invalid or missing API key: `application/json` `ErrorResponse`
- `403` The key lacks members:read, or its creator's role does not allow it: `application/json` `ErrorResponse`
- `404` Not found or not readable: `application/json` `ErrorResponse`
- `422` Validation Error: `application/json` `HTTPValidationError`

## Schemas

```yaml
InvitationList:
  properties:
    invitations:
      items:
        $ref: "#/components/schemas/Invitation"
      type: array
  type: object
  required:
    - invitations
  title: InvitationList
Invitation:
  properties:
    invitation_id:
      type: string
      format: uuid
    email:
      type: string
    space_id:
      description: The space it grants a role on
      format: uuid
      type:
        - string
        - "null"
    space_role:
      description: The role it grants there
      nullable: true
      type: string
      enum:
        - viewer
        - contributor
        - admin
        - owner
    space_name:
      type:
        - string
        - "null"
    space_kind:
      nullable: true
      type: string
      enum:
        - organization
        - workspace
    invited_by:
      format: uuid
      type:
        - string
        - "null"
    created_at:
      format: date-time
      type:
        - string
        - "null"
    expires_at:
      format: date-time
      type:
        - string
        - "null"
  type: object
  required:
    - invitation_id
    - email
  title: Invitation
  description: A pending invitation.
ErrorResponse:
  properties:
    detail:
      type: string
      description: Error message describing what went wrong
  type: object
  required:
    - detail
  title: ErrorResponse
  description: Standard error response.
HTTPValidationError:
  properties:
    detail:
      items:
        $ref: "#/components/schemas/ValidationError"
      type: array
  type: object
  title: HTTPValidationError
ValidationError:
  properties:
    loc:
      items:
        type:
          - string
          - integer
      type: array
      title: Location
    msg:
      type: string
      title: Message
    type:
      type: string
      title: Error Type
    input: {}
    ctx:
      type: object
      title: Context
  type: object
  required:
    - loc
    - msg
    - type
  title: ValidationError
```
