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

# Link the shared card

> Links your reserve card (shared card) to `{workspaceId}`: when the workspace's own wallet does not cover a platform charge (renewal, extra numbers, phone lines) and it has no card of its own, your card pays it. The source is the workspace the Pilot Status team configured as your reserve card. No body. Owner of `{workspaceId}` only. Idempotent: already linked to the same source → `200` with `changed: false`. On a change, the workspace's History records **Backup card linked** (no e-mail).

**Requires an account key** (`ps_account_`, created in Profile → API). Workspace keys, number keys and OAuth/MCP tokens get `403 ACCOUNT_KEY_REQUIRED`. Sent with `Cache-Control: no-store`.

> [!WARNING]
>
> **This changes who pays this workspace's renewals.** Once linked, your reserve card pays the platform charges the workspace's own wallet and card do not cover. Requires an account key (`ps_account_`) and the Owner role. See [Shared card per workspace](https://docs.pilotstatus.com.br/api/workspaces.md#shared-card-per-workspace).


## OpenAPI

````yaml openapi.json PUT /v1/workspaces/{workspaceId}/shared-card
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/workspaces/{workspaceId}/shared-card:
    put:
      tags:
        - Workspace
      summary: Link the shared card
      description: >-
        Links your reserve card (shared card) to `{workspaceId}`: when the
        workspace's own wallet does not cover a platform charge (renewal, extra
        numbers, phone lines) and it has no card of its own, your card pays it.
        The source is the workspace the Pilot Status team configured as your
        reserve card. No body. Owner of `{workspaceId}` only. Idempotent:
        already linked to the same source → `200` with `changed: false`. On a
        change, the workspace's History records **Backup card linked** (no
        e-mail).


        **Requires an account key** (`ps_account_`, created in Profile → API).
        Workspace keys, number keys and OAuth/MCP tokens get `403
        ACCOUNT_KEY_REQUIRED`. Sent with `Cache-Control: no-store`.
      operationId: put_workspaces_shared_card
      parameters:
        - name: workspaceId
          in: path
          required: true
          schema:
            type: string
          description: Workspace id, from `GET /v1/workspaces`.
          example: cmh2a9z8y0002ws8example1q
      responses:
        '200':
          description: 'Linked (or already linked: `changed: false`)'
          content:
            application/json:
              schema:
                type: object
                properties:
                  workspaceId:
                    type: string
                  sharedCard:
                    type: object
                    description: >-
                      Whether the workspace is linked to a shared (reserve)
                      card, and to which source workspace.
                    properties:
                      linked:
                        type: boolean
                        description: >-
                          `true` when the workspace falls back to the reserve
                          card of `sourceWorkspaceId`.
                      sourceWorkspaceId:
                        type:
                          - string
                          - 'null'
                        description: >-
                          The workspace whose saved card backs this one; `null`
                          when not linked.
                    required:
                      - linked
                      - sourceWorkspaceId
                  changed:
                    type: boolean
                    description: >-
                      `false` when the workspace was already in the requested
                      state: nothing was recorded.
              example:
                workspaceId: cmh2a9z8y0002ws8example1q
                sharedCard:
                  linked: true
                  sourceWorkspaceId: cmh2a1b2c0001ws8example7k
                changed: true
          headers:
            Cache-Control:
              schema:
                type: string
              example: no-store
        '400':
          description: >-
            `UNKNOWN_FIELDS` (the endpoint takes no body fields) or
            `SELF_SOURCE` (`{workspaceId}` is the source workspace)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              examples:
                unknownFields:
                  summary: A field was sent
                  value:
                    error: >-
                      This endpoint takes no body fields | Este endpoint não
                      aceita campos no corpo
                    code: UNKNOWN_FIELDS
                selfSource:
                  summary: Workspace is the source
                  value:
                    error: >-
                      A workspace cannot use its own card as a shared card | Um
                      workspace não pode usar o próprio cartão como cartão
                      compartilhado
                    code: SELF_SOURCE
        '401':
          description: Missing, invalid or revoked API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Invalid API key
        '403':
          description: >-
            Not an account key (`ACCOUNT_KEY_REQUIRED`), not an active member of
            the workspace or the workspace does not exist / is archived
            (`WORKSPACE_MEMBERSHIP_REQUIRED`), or a role below Owner
            (`PERMISSION_DENIED`)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: >-
                  This endpoint requires an account API key (ps_account_…),
                  created in Profile → API. Workspace keys, number keys and
                  OAuth tokens cannot use it | Este endpoint exige uma API key
                  de conta (ps_account_…), criada em Perfil → API. Chaves de
                  workspace, de número e tokens OAuth não podem usá-lo
                code: ACCOUNT_KEY_REQUIRED
        '409':
          description: >-
            `SHARED_CARD_NOT_CONFIGURED`, `SOURCE_ARCHIVED` or `NO_SHARED_OWNER`
            — nothing changed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              examples:
                notConfigured:
                  summary: No reserve card configured
                  value:
                    error: >-
                      No reserve card is configured for your account. Ask
                      support to set the workspace whose card is your reserve
                      card, or do not share the card | Nenhum cartão de reserva
                      está configurado para a sua conta. Peça ao suporte para
                      definir o workspace cujo cartão é o seu cartão de reserva,
                      ou não compartilhe o cartão
                    code: SHARED_CARD_NOT_CONFIGURED
                sourceArchived:
                  summary: Source archived
                  value:
                    error: >-
                      The workspace of your reserve card is archived | O
                      workspace do seu cartão de reserva está arquivado
                    code: SOURCE_ARCHIVED
                noSharedOwner:
                  summary: Not an owner of the source
                  value:
                    error: >-
                      You are not an active owner of the workspace of the
                      reserve card | Você não é dono ativo do workspace do
                      cartão de reserva
                    code: NO_SHARED_OWNER
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.