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

# Exclusão de um benefício específico

> Exclui um único benefício do membro.



## OpenAPI

````yaml openapi.yaml POST /v1/enrollment/exclusion/{member-tax-id}/benefit/{benefit-id}
openapi: 3.1.0
info:
  title: Pipo Public API
  version: 0.2.0
  description: >
    API pública da Pipo Saúde para integração de movimentações de benefícios

    (inclusões, exclusões e consultas) por parceiros e sistemas de folha de
    pagamento.
  contact:
    name: Pipo Engineering
    email: felipe.rodopoulos@piposaude.com.br
servers:
  - url: https://api.pipo.health
    description: Homologação (staging)
  - url: https://api.piposaude.com.br
    description: Produção
security:
  - bearerAuth: []
tags:
  - name: Autenticação
    description: Obtenção do token de acesso.
  - name: Empresas
    description: Consulta de empresas e seus produtos.
  - name: Benefícios
    description: Consulta de produtos/benefícios disponíveis.
  - name: Movimentações
    description: Inclusões, exclusões e histórico de movimentações.
  - name: Membros
    description: Consulta de membros e seus benefícios.
  - name: Solicitações
    description: Consulta do status de requisições assíncronas.
  - name: Health Check
    description: Verificação de disponibilidade.
paths:
  /v1/enrollment/exclusion/{member-tax-id}/benefit/{benefit-id}:
    post:
      tags:
        - Movimentações
      summary: Exclusão de um benefício específico
      description: Exclui um único benefício do membro.
      parameters:
        - $ref: '#/components/parameters/MemberTaxIdPath'
        - name: benefit-id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: ID do benefício a ser excluído.
        - $ref: '#/components/parameters/AutoResolveEnrollments'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExclusionRequest'
            example:
              exclusion-details:
                end-date: '2024-12-31'
                exclusion-reason: voluntary-dismissal
                extension-plan: true
      responses:
        '200':
          $ref: '#/components/responses/RequestAccepted'
        '400':
          description: Dados inválidos.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: End date cannot be in the past
        '403':
          $ref: '#/components/responses/GenericForbidden'
        '404':
          description: Benefício não encontrado ativo no membro.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Benefit not found active in member
        '424':
          description: >-
            Exclusão não realizada — o benefício ainda tem movimentação em
            andamento.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  enrollment-id:
                    type: string
                    format: uuid
              example:
                enrollment-id: 789e0123-e89b-12d3-a456-426614174002
                error: Exclusion not performed. Benefit still has ongoing enrollment
components:
  parameters:
    MemberTaxIdPath:
      name: member-tax-id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/Cpf'
      description: CPF do membro.
    AutoResolveEnrollments:
      name: auto-resolve-enrollments
      in: query
      required: false
      schema:
        type: string
        enum:
          - approve
          - reject
      description: >
        Resolve automaticamente a movimentação: `approve` aprova; `reject`
        rejeita.

        **Esta opção existe apenas no ambiente de Homologação, para testes.**
  schemas:
    ExclusionRequest:
      type: object
      required:
        - exclusion-details
      properties:
        exclusion-details:
          $ref: '#/components/schemas/ExclusionDetails'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Mensagem descritiva do erro.
    Cpf:
      type: string
      description: CPF (Cadastro de Pessoas Físicas). Aceita apenas dígitos ou formatado.
      examples:
        - '12345678900'
        - 123.456.789-00
    ExclusionDetails:
      type: object
      required:
        - end-date
        - exclusion-reason
        - extension-plan
      properties:
        end-date:
          type: string
          format: date
          description: Data de fim do benefício.
        exclusion-reason:
          $ref: '#/components/schemas/ExclusionReason'
        extension-plan:
          type: boolean
          description: >-
            Indica se o membro contribuiu com os custos e solicitou plano de
            extensão.
        exclusion-reason-details:
          type: string
          description: >-
            Detalhes do motivo (obrigatório quando `exclusion-reason` =
            `other`).
        documents:
          type: array
          items:
            $ref: '#/components/schemas/Document'
    ExclusionReason:
      type: string
      description: >-
        Motivo da exclusão. Se `other`, `exclusion-reason-details` é
        obrigatório.
      enum:
        - dismissal
        - voluntary-dismissal
        - just-cause-dismissal
        - requested-by-beneficiary
        - other
    Document:
      type: object
      required:
        - document-id
        - document-type
      description: Documento relacionado ao membro, previamente enviado via URL de upload.
      properties:
        document-id:
          type: string
          description: Identificador do documento, recebido ao solicitar a URL de upload.
        document-type:
          $ref: '#/components/schemas/DocumentType'
    DocumentType:
      type: string
      description: Tipo do documento anexado à movimentação.
      enum:
        - beneficiary-inclusion-form
        - birth-certificate-or-national-id
        - company-letter
        - company-linking-declaration
        - company-social-contract
        - document-proving-relationship
        - employee-social-contract
        - employee-tax-id-card
        - employment-contract
        - enrollment-request
        - exclusion-file
        - guardianship-certificate
        - identification-document-with-tax-id
        - invoice
        - marriage-certificate
        - proof-of-dependent-relationship
        - proof-of-employment
        - proof-of-promotion
        - proof-of-residency
        - rescission
        - same-sex-marriage-certificate
        - other
  responses:
    RequestAccepted:
      description: Movimentação processada com sucesso.
      content:
        application/json:
          schema:
            type: object
            required:
              - request-id
            properties:
              request-id:
                type: string
                format: uuid
                description: >-
                  Identificador da requisição. Use em `GET
                  /v1/request/{request-id}`.
          example:
            request-id: aaa11111-e89b-12d3-a456-426614174006
    GenericForbidden:
      description: Não autorizado.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Not entitled to modify this member
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Token Bearer obtido em `POST /v1/authenticate`.

````