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

# Encerrar matriz

> Encerra a ligação entre uma subsidiária e a matriz dela.



## OpenAPI

````yaml openapi/pt/cell.json POST /v1/identity/parents/{parent_link_id}/end
openapi: 3.1.0
info:
  title: API de dados da Niadra
  version: '1'
  description: >-
    Escrita, contexto, histórico, objetos, identidade, privacidade e governança
    de um espaço. Cada espaço tem um endereço estável, com o espaço e a região
    no nome.
servers:
  - url: https://{space}.{region}.api.niadra.com
    variables:
      space:
        default: acme-prod
        description: O espaço, que vem na chave de fonte.
      region:
        default: us-east-2
        description: A região do espaço, que também vem na chave.
security: []
paths:
  /v1/identity/parents/{parent_link_id}/end:
    post:
      tags:
        - identity
      summary: Encerrar matriz
      description: >-
        Encerra a ligação com a matriz. As leituras seguintes da subsidiária
        deixam de trazer os fatos da matriz; uma conversa em curso fica com o
        pacote que já recebeu.


        **Autenticação.** Token de pessoa do Console com o papel `security`,
        `integration` (ou admin), ou chave de fonte com o escopo `admin`.
      operationId: end_parent_v1_identity_parents__parent_link_id__end_post
      parameters:
        - in: path
          name: parent_link_id
          required: true
          schema:
            format: uuid
            title: Parent Link Id
            type: string
          example: 0192f7a1-5b10-7c3a-8e21-4d2f8a4c0e10
        - in: header
          name: Idempotency-Key
          required: true
          schema:
            maxLength: 256
            minLength: 1
            title: Idempotency-Key
            type: string
          description: >-
            Obrigatório. Fica guardado 24 horas com o hash do corpo: repetir com
            a mesma chave devolve a primeira resposta, e a mesma chave com outro
            corpo devolve 409 `conflict`.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ParentEndIn'
            example:
              valid_to: '2026-10-01T00:00:00Z'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParentOut'
              example:
                parent_link_id: 0192f7a1-5b10-7c3a-8e21-4d2f8a4c0e10
                org_handle_id: 0192f7a1-5b10-7c3a-8e21-4d2f8a4c0e05
                parent_handle_id: 0192f7a1-5b10-7c3a-8e21-4d2f8a4c0e11
                org_profile_id: 0192f7a1-5b10-7c3a-8e21-4d2f8a4c0e12
                parent_profile_id: 0192f7a1-5b10-7c3a-8e21-4d2f8a4c0e13
                method: system_import
                valid_from: '2026-09-22T17:10:00Z'
                valid_to: '2026-10-01T00:00:00Z'
          description: A ligação encerrada.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: O pedido não bate com o contrato.
      security:
        - sourceKey: []
        - personToken: []
components:
  schemas:
    ParentEndIn:
      additionalProperties: false
      properties:
        valid_to:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Valid To
      title: ParentEndIn
      type: object
    ParentOut:
      additionalProperties: false
      properties:
        method:
          enum:
            - system_import
            - declared
          title: Method
          type: string
        org_handle_id:
          description: O identificador da subsidiária.
          format: uuid
          title: Org Handle Id
          type: string
        org_profile_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: O perfil da subsidiária agora.
          title: Org Profile Id
        parent_handle_id:
          format: uuid
          title: Parent Handle Id
          type: string
        parent_link_id:
          format: uuid
          title: Parent Link Id
          type: string
        parent_profile_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: O perfil da matriz agora.
          title: Parent Profile Id
        valid_from:
          format: date-time
          title: Valid From
          type: string
        valid_to:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Valid To
      required:
        - parent_link_id
        - org_handle_id
        - parent_handle_id
        - org_profile_id
        - parent_profile_id
        - method
        - valid_from
      title: ParentOut
      type: object
    Problem:
      additionalProperties: false
      description: >-
        Detalhes do problema no formato da RFC 9457; `code` vem do catálogo de
        erros versionado.
      properties:
        code:
          title: Code
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Detail
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          default: about:blank
          title: Type
          type: string
      required:
        - title
        - status
        - code
      title: Problem
      type: object
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...
    personToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````