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

# Set a parent

> Places an organization under its parent, one level, without merging the two.



## OpenAPI

````yaml openapi/en/cell.json POST /v1/identity/parents
openapi: 3.1.0
info:
  title: Niadra data API
  version: '1'
  description: >-
    Writing, context, history, objects, identity, privacy and governance of one
    space. Every space has a stable address, with the space and the region in
    its name.
servers:
  - url: https://{space}.{region}.api.niadra.com
    variables:
      space:
        default: acme-prod
        description: The space, which comes in the source key.
      region:
        default: us-east-2
        description: The region of the space, which also comes in the key.
security: []
paths:
  /v1/identity/parents:
    post:
      tags:
        - identity
      summary: Set a parent
      description: >-
        Places an organization (the subsidiary) under its parent. One level
        only: a parent has no parent, a subsidiary has no subsidiaries, and an
        organization has one parent at a time. The two stay two profiles, and a
        merge between them is refused, even forced, while the parent is in
        force. Both sides come by the company registry (`org_registry_hmac`) or
        a system id; an e-mail domain is a hint and never qualifies. The
        subsidiary's context then carries the facts the parent holds on its own
        ids.


        **Authentication.** Console person token with the `security`,
        `integration` role (or admin), or a source key with the `admin` scope.
      operationId: set_parent_v1_identity_parents_post
      parameters:
        - in: header
          name: Idempotency-Key
          required: true
          schema:
            maxLength: 256
            minLength: 1
            title: Idempotency-Key
            type: string
          description: >-
            Required. Kept 24 hours with the hash of the body: a retry with the
            same key returns the first answer, and the same key with a different
            body returns 409 `conflict`.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ParentIn'
            example:
              organization:
                type: system_id
                value: ACC-2201
                scope: crm
                subject_kind: account
              parent:
                type: org_registry_hmac
                value: c2f8e0b4a17d9e36f5a1c0d2b8e4f7a9
                subject_kind: account
              method: system_import
        required: true
      responses:
        '201':
          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: null
          description: >-
            The tie to the parent, with the profile on each side. Setting the
            same parent again returns the tie that exists.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: >-
            422 `invalid_input`: not two organizations of the same kind, a side
            not named by a registry or a system id, or the same organization.
      security:
        - sourceKey: []
        - personToken: []
components:
  schemas:
    ParentIn:
      additionalProperties: false
      description: >-
        An organization and its parent: one level, so a parent has no parent and
        a subsidiary has no

        subsidiaries. Subsidiaries of one parent are sibling accounts, each with
        its own memory; a parent is

        never a merge. Both sides are named by a registry (`org_registry_hmac`)
        or a system id.
      properties:
        method:
          default: declared
          enum:
            - system_import
            - declared
          title: Method
          type: string
        organization:
          $ref: '#/components/schemas/Handle'
          description: The subsidiary.
        parent:
          $ref: '#/components/schemas/Handle'
        valid_from:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Valid From
        valid_to:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Valid To
      required:
        - organization
        - parent
      title: ParentIn
      type: object
    ParentOut:
      additionalProperties: false
      properties:
        method:
          enum:
            - system_import
            - declared
          title: Method
          type: string
        org_handle_id:
          description: The subsidiary's identifier.
          format: uuid
          title: Org Handle Id
          type: string
        org_profile_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: The subsidiary's profile now.
          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: The parent's profile now.
          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: RFC 9457 problem details; `code` comes from the versioned error catalog.
      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
    Handle:
      additionalProperties: false
      description: >-
        An identifier of a subject in some channel or system: a phone, an
        e-mail, a CRM id.
      properties:
        scope:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          description: >-
            Namespace for scoped identifiers: the WhatsApp Business account for
            `wa_bsuid`, the system for `system_id`, the country for
            `gov_id_hmac`.
          title: Scope
        subject_kind:
          anyOf:
            - $ref: '#/components/schemas/SubjectKind'
            - type: 'null'
          description: Defaults to `person`, except for organization-only handle types.
        type:
          $ref: '#/components/schemas/HandleType'
        value:
          maxLength: 320
          minLength: 1
          title: Value
          type: string
          description: >-
            The identifier. Normalized on the server: E.164 for phones,
            lowercase for e-mail.
      required:
        - type
        - value
      title: Handle
      type: object
    SubjectKind:
      enum:
        - person
        - account
        - partner
      title: SubjectKind
      type: string
      description: >-
        A person, a customer organization (`account`) or an organization that
        takes part without being a customer (`partner`).
    HandleType:
      enum:
        - phone_e164
        - wa_id
        - wa_jid
        - wa_lid
        - wa_bsuid
        - email
        - gov_id_hmac
        - app_user_id
        - system_id
        - org_registry_hmac
        - email_domain
        - anon_id
      title: HandleType
      type: string
      description: >-
        The kind of identifier. The value is classified by its format, never by
        the field it came from.
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...
    personToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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