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

# Restore a fact

> Undoes a retraction or a correction: the fact comes back as it was and the correction that replaced it is retracted; security role only.



## OpenAPI

````yaml openapi/en/cell.json POST /v1/facts/{fact_id}/restore
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/facts/{fact_id}/restore:
    post:
      tags:
        - governance
      summary: Restore a fact
      description: >-
        Undoes a retraction or a correction: the fact comes back as it was, the
        correction that replaced

        it is retracted, and the fact's history keeps every step. An erased fact
        is gone and answers 404. One

        that came through an unconfirmed link, one merged into another, one that
        is not retracted, and a

        correction that a restore of the fact it corrected already undid (the
        detail says to correct that

        fact again) are refused with 409. Like a correction it becomes an event
        the memory module applies

        within seconds; a replayed key is a duplicate.


        **Authentication.** Console person token with the `security` role (or
        admin), or a source key with the `admin` scope.
      operationId: restore_fact_v1_facts__fact_id__restore_post
      parameters:
        - in: path
          name: fact_id
          required: true
          schema:
            format: uuid
            title: Fact Id
            type: string
          description: The retracted or corrected fact.
        - in: header
          name: Idempotency-Key
          required: true
          schema:
            maxLength: 256
            minLength: 1
            title: Idempotency-Key
            type: string
          description: >-
            Required. Kept 24 hours with the body hash; a replayed key is a
            duplicate.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FactRestoreRequest'
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchResponse'
          description: >-
            Accepted: the restore is now a `feedback.restore_fact` event,
            reported as a batch answer; the memory applies it within seconds.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - sourceKey: []
        - personToken: []
components:
  schemas:
    FactRestoreRequest:
      additionalProperties: false
      description: >-
        Undoing a retraction or a correction of a fact, by a person with the
        security role: the fact comes

        back as it was and the correction that replaced it is retracted. It
        becomes a `feedback.restore_fact`

        event, so the lineage keeps it. An erased fact or one that came through
        an unconfirmed link is refused.
      properties:
        profile_id:
          format: uuid
          title: Profile Id
          type: string
          description: The profile the fact belongs to.
        reason:
          anyOf:
            - maxLength: 500
              type: string
            - type: 'null'
          title: Reason
          description: >-
            Why the retraction or correction is undone, up to 500 characters;
            kept in the lineage.
      required:
        - profile_id
      title: FactRestoreRequest
      type: object
    BatchResponse:
      additionalProperties: false
      properties:
        accepted:
          title: Accepted
          type: integer
        duplicates:
          title: Duplicates
          type: integer
          description: Items whose idempotency key was already stored.
        errors:
          items:
            $ref: '#/components/schemas/ItemError'
          title: Errors
          type: array
        masked:
          additionalProperties:
            type: integer
          description: >-
            Values held back from the accepted items before storage, by type
            (`card`, `cvv`, `password`, `secret`): the stored text says
            `[retido:cartão ****1234]` where the value was.
          title: Masked
          type: object
      required:
        - accepted
        - duplicates
        - errors
      title: BatchResponse
      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
    ItemError:
      additionalProperties: false
      properties:
        code:
          title: Code
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
        index:
          title: Index
          type: integer
          description: Position of the item in `items`.
      required:
        - index
        - code
      title: ItemError
      type: object
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...
    personToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````