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

# Invite a member

> Invites an e-mail address. An address that already has a pending invitation is NOT an error: the token is rotated in place (the old link dies) and the response is `200` instead of `201`.

**OAuth required.** A classic key (`x-api-key`) is refused: an `x-api-key` request has no user behind it, and allowing writes to the member list would turn any key of the workspace into a path to account takeover.



## OpenAPI

````yaml openapi.json POST /v1/workspace/members
openapi: 3.1.0
info:
  title: Pilot Status API
  version: 1.0.0
  license:
    name: Pilot Status Terms of Service
    url: https://pilotstatus.com.br/terms
  description: >-
    Public REST API for Pilot Status. Authenticate with the `x-api-key: ps_...`
    header (or `x-api-key-id`). Base URL: https://pilotstatus.com.br
servers:
  - url: https://pilotstatus.com.br
security:
  - apiKey: []
  - apiKeyId: []
paths:
  /v1/workspace/members:
    post:
      tags:
        - Workspace
      summary: Invite a member
      description: >-
        Invites an e-mail address. An address that already has a pending
        invitation is NOT an error: the token is rotated in place (the old link
        dies) and the response is `200` instead of `201`.


        **OAuth required.** A classic key (`x-api-key`) is refused: an
        `x-api-key` request has no user behind it, and allowing writes to the
        member list would turn any key of the workspace into a path to account
        takeover.
      operationId: post_workspace-members
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: Normalized to lowercase.
                  example: alguem@acme.com
                role:
                  type: string
                  enum:
                    - ADMIN
                    - AGENT
                    - ANALYST
                  description: >-
                    `OWNER` is NEVER assignable — becoming the owner is a
                    transfer of ownership.
                  example: AGENT
                allowedNumberIds:
                  type: array
                  items:
                    type: string
                  description: >-
                    Limits AGENT/ANALYST to specific numbers. Ignored for ADMIN,
                    which is workspace-wide.
                sendEmail:
                  type: boolean
                  description: >-
                    Defaults to `true`. With `false` no e-mail is sent and the
                    response carries `inviteUrl` — the ONLY time the link
                    appears.
                  example: true
              required:
                - email
                - role
      responses:
        '200':
          description: Pending invitation rotated
        '201':
          description: Invitation created
          content:
            application/json:
              schema:
                type: object
                properties:
                  member:
                    type: object
                    properties:
                      id:
                        type: string
                        example: mb_1a2b
                      email:
                        type: string
                        example: alguem@acme.com
                      name:
                        type:
                          - string
                          - 'null'
                      role:
                        type: string
                        enum:
                          - OWNER
                          - ADMIN
                          - AGENT
                          - ANALYST
                      status:
                        type: string
                        enum:
                          - PENDING
                          - ACTIVE
                      allowedNumberIds:
                        type: array
                        items:
                          type: string
                      invitedAt:
                        type: string
                        format: date-time
                      joinedAt:
                        type:
                          - string
                          - 'null'
                        format: date-time
                      inviteExpiresAt:
                        type:
                          - string
                          - 'null'
                        format: date-time
                      inviteExpired:
                        type: boolean
                        description: >-
                          `true` when the invitation has expired: the row exists
                          but no longer holds a seat.
                  inviteUrl:
                    type:
                      - string
                      - 'null'
                    description: 'Present only with `sendEmail: false`.'
        '400':
          description: Invalid payload (`INVALID_EMAIL`, missing role).
        '403':
          description: Insufficient role, wrong credential, or invitations disabled.
        '409':
          description: >-
            State conflict: `ALREADY_MEMBER`, `SEAT_LIMIT_REACHED`,
            `OWNER_INVITE_FORBIDDEN`, `OWNER_IMMUTABLE`.
        '429':
          description: Rate limited per workspace, per recipient and per IP.
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your ps_ API key
    apiKeyId:
      type: apiKey
      in: header
      name: x-api-key-id
      description: API key id (alternative to x-api-key)

````