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

# Remove a member

> One route for both: an invitation and a membership are the same row.

If the member created API keys that are still active, the removal STOPS with `409 MEMBER_HAS_API_KEYS` and returns the list. Repeat with `apiKeyAction=revoke` or `apiKeyAction=keep` — **there is no default**, because revoking by omission takes down production integrations in the middle of an offboarding.

**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 DELETE /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}:
    delete:
      tags:
        - Workspace
      summary: Remove a member or revoke an invitation
      description: >-
        One route for both: an invitation and a membership are the same row.


        If the member created API keys that are still active, the removal STOPS
        with `409 MEMBER_HAS_API_KEYS` and returns the list. Repeat with
        `apiKeyAction=revoke` or `apiKeyAction=keep` — **there is no default**,
        because revoking by omission takes down production integrations in the
        middle of an offboarding.


        **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: delete_workspace-member
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Membership id (the `id` the list returns), NOT the user id.
        - name: apiKeyAction
          in: query
          required: false
          schema:
            type: string
            enum:
              - revoke
              - keep
          description: >-
            `revoke` sets `revokedAt` (soft, never a delete); `keep` reassigns
            the keys to the caller.
      responses:
        '200':
          description: Removed
        '403':
          description: Insufficient role, wrong credential, or invitations disabled.
        '409':
          description: >-
            `MEMBER_HAS_API_KEYS` (with the list in `apiKeys`) or
            `OWNER_IMMUTABLE`.
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)

````