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

# Export

> Gathers the data of a data subject for access and portability.



## OpenAPI

````yaml openapi/en/cell.json POST /v1/export
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-1
        description: The region of the space, which also comes in the key.
security: []
paths:
  /v1/export:
    post:
      tags:
        - governance
      summary: Export
      description: >-
        Builds the access and portability package of one data subject, by
        `profile_id` or by handle: events, facts, episodes, open items, objects,
        actions, patterns with their evidence, and links. The answer is
        immediate and carries a signed download URL, the SHA-256 of the package
        and the list of files inside it. Every export is recorded in the audit
        trail.


        **Authentication.** Console person token with the `security` role (or
        admin), or a source key with the `admin` scope.
      operationId: export_package_v1_export_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportRequest'
            example:
              handle:
                type: phone_e164
                value: '+14155550123'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportPackageOut'
              example:
                run_id: 0192f7b5-8e41-7c5a-9d6b-7e8f9a0b1c2d
                profile_id: 0192f7a0-3b2e-7d41-8c5a-2e9f4b7a1c03
                download_url: >-
                  https://acme-prod.us-east-1.api.niadra.com/v1/exports/0192f7b5-8e41-7c5a-9d6b-7e8f9a0b1c2d/download
                download_expires_at: '2026-09-22T19:00:00Z'
                sha256: >-
                  3b1f4c9a0e7d2b6a8c5f1e0d9a7b3c2e4f6a8b0c1d3e5f7a9b0c2d4e6f8a0b1c
                files:
                  events.jsonl: sha256:9c0e1f
                  facts.jsonl: sha256:4a7d2b
                  traits.jsonl: sha256:e6b3f0
                  links.jsonl: sha256:12c8a5
          description: 'The package is ready: download it before `download_expires_at`.'
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - sourceKey: []
        - personToken: []
components:
  schemas:
    ExportRequest:
      additionalProperties: false
      description: >-
        The portable package of one subject: JSON lines per kind of record,
        zipped.
      properties:
        handle:
          anyOf:
            - $ref: '#/components/schemas/Handle'
            - type: 'null'
        profile_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Profile Id
      title: ExportRequest
      type: object
    ExportPackageOut:
      additionalProperties: false
      properties:
        download_expires_at:
          format: date-time
          title: Download Expires At
          type: string
        download_url:
          description: >-
            Presigned link to the zip in object storage; `GET
            /v1/exports/{run_id}/download` serves the same file through the
            cell.
          title: Download Url
          type: string
        files:
          additionalProperties:
            type: string
          description: File name inside the zip -> SHA-256.
          title: Files
          type: object
        profile_id:
          description: The subject, also when it was named by a handle.
          title: Profile Id
          type: string
        run_id:
          title: Run Id
          type: string
        sha256:
          description: SHA-256 of the zip.
          title: Sha256
          type: string
      required:
        - run_id
        - profile_id
        - download_url
        - download_expires_at
        - files
        - sha256
      title: ExportPackageOut
      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

````