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

# Set which numbers a member sees

> Sets which WhatsApp numbers of the workspace an AGENT or ANALYST sees and acts on, without changing the role. Works on pending invitations too.

`allowedNumberIds` is **required** and **replaces the whole list**. `[]` means **all numbers**, including numbers connected later — not none. A member restricted to specific numbers does not gain new numbers automatically.

The member's OAuth refresh tokens are revoked, so a narrower scope applies on their next call.

**OAuth required, ADMIN or OWNER.** A classic key (`x-api-key`) is refused with `MACHINE_CREDENTIAL_CANNOT_MANAGE_MEMBERS`: 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. To change the role, use `PATCH /v1/workspace/members/{id}` (OWNER only).



## OpenAPI

````yaml openapi.json PATCH /v1/workspace/members/{id}/numbers
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}/numbers:
    patch:
      tags:
        - Workspace
      summary: Set which numbers a member sees
      description: >-
        Sets which WhatsApp numbers of the workspace an AGENT or ANALYST sees
        and acts on, without changing the role. Works on pending invitations
        too.


        `allowedNumberIds` is **required** and **replaces the whole list**. `[]`
        means **all numbers**, including numbers connected later — not none. A
        member restricted to specific numbers does not gain new numbers
        automatically.


        The member's OAuth refresh tokens are revoked, so a narrower scope
        applies on their next call.


        **OAuth required, ADMIN or OWNER.** A classic key (`x-api-key`) is
        refused with `MACHINE_CREDENTIAL_CANNOT_MANAGE_MEMBERS`: 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. To
        change the role, use `PATCH /v1/workspace/members/{id}` (OWNER only).
      operationId: patch_workspace-member-numbers
      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:
                allowedNumberIds:
                  type: array
                  items:
                    type: string
                  description: >-
                    Number ids this AGENT/ANALYST may see. Replaces the whole
                    list. `[]` = all numbers of the workspace, including numbers
                    connected later.
                  example:
                    - wa_abc
              required:
                - allowedNumberIds
              additionalProperties: false
      responses:
        '200':
          description: >-
            Member updated. Body: `{ "member": { ... } }`, same shape as the
            list.
        '400':
          description: >-
            `INVALID_SCOPE` (`allowedNumberIds` missing or not an array of
            strings) or `UNKNOWN_FIELDS` (any other key; listed in
            `details.unknownFields`).
        '403':
          description: >-
            `MACHINE_CREDENTIAL_CANNOT_MANAGE_MEMBERS` (classic key),
            `PERMISSION_DENIED` (caller is AGENT or ANALYST) or
            `WORKSPACE_MEMBERSHIP_REQUIRED`.
        '404':
          description: '`NOT_FOUND`: the membership id is not in this workspace.'
        '409':
          description: >-
            `SCOPE_NOT_APPLICABLE`: the target is OWNER or ADMIN, who always see
            every number.
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)

````

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