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

# Change a member's role

> Changes the role and, optionally, the per-number scope. Promoting to ADMIN clears the scope: ADMIN is workspace-wide, and storing a restriction the gate ignores would make the response lie.

**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 PATCH /v1/workspace/members/{id}
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/{id}:
    patch:
      tags:
        - Workspace
      summary: Change a member's role
      description: >-
        Changes the role and, optionally, the per-number scope. Promoting to
        ADMIN clears the scope: ADMIN is workspace-wide, and storing a
        restriction the gate ignores would make the response lie.


        **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: patch_workspace-member
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Membership id (the `id` the list returns), NOT the user id.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                role:
                  type: string
                  enum:
                    - ADMIN
                    - AGENT
                    - ANALYST
                  example: ADMIN
                allowedNumberIds:
                  type: array
                  items:
                    type: string
              required:
                - role
      responses:
        '200':
          description: Member updated
        '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)

````