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

# Export a fact register or history

> A client’s fact register (kind register: each value the firm held at the end of as_at, with its source and who confirmed it) or fact history (kind history: every value read, proposed, entered, accepted, corrected, replaced, removed or rejected up to the end of as_at, oldest first). as_at is a day in Sydney, YYYY-MM-DD, today by default and never in the future; a past day shows what the firm knew then. Returns the rows and a download_url for the same as a PDF on the firm letterhead or a CSV (format, pdf by default), which works for 15 minutes. A removed client’s facts export too while they are kept. Nothing is stored.



## OpenAPI

````yaml /openapi/advisor.json get /clients/{client}/facts/export
openapi: 3.1.0
info:
  title: Redbark Advisor API
  version: 2.0.0
  description: >-
    Read and write access to one advice firm in Redbark Advisor: clients,
    checklists, documents, money, messages, reports, team and webhooks. Send an
    API key or a connected app’s access token as a bearer token. A credential
    carries scopes, one read and one write per area, and each call says the
    scope it needs. A write scope brings its read scope. Each key may make 120
    requests a minute.
servers:
  - url: https://advisor.redbark.com/api/v1
security:
  - bearerAuth: []
tags:
  - name: Firm
    description: The firm, its name and its branding.
  - name: Team
    description: Team members and their roles.
  - name: Clients
    description: Clients, their people and portal invites.
  - name: Checklists
    description: Checklist templates, the checklists sent to clients and their answers.
  - name: Documents
    description: Documents clients upload and the details read from them.
  - name: Money
    description: Bank connections, accounts, balances and transactions.
  - name: Document types
    description: Document types, their fields and the client facts they fill.
  - name: Messages
    description: Messages between the firm and clients.
  - name: Reports
    description: Reports exported for clients.
  - name: Webhooks
    description: Webhook endpoints and their deliveries.
  - name: Webhook events
    description: Events sent to your webhook endpoints.
paths:
  /clients/{client}/facts/export:
    get:
      tags:
        - Documents
      summary: Export a fact register or history
      description: >-
        A client’s fact register (kind register: each value the firm held at the
        end of as_at, with its source and who confirmed it) or fact history
        (kind history: every value read, proposed, entered, accepted, corrected,
        replaced, removed or rejected up to the end of as_at, oldest first).
        as_at is a day in Sydney, YYYY-MM-DD, today by default and never in the
        future; a past day shows what the firm knew then. Returns the rows and a
        download_url for the same as a PDF on the firm letterhead or a CSV
        (format, pdf by default), which works for 15 minutes. A removed client’s
        facts export too while they are kept. Nothing is stored.
      operationId: export_facts
      parameters:
        - name: client
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 60
            description: The client id, from list_clients.
        - name: kind
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                enum:
                  - register
                  - history
              - type: 'null'
            description: register (the default) or history.
        - name: as_at
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
        - name: format
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                enum:
                  - pdf
                  - csv
              - type: 'null'
            description: 'The file download_url gives: pdf (the default) or csv.'
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FactExport'
        '400':
          description: The request is not valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: The API key or access token is missing, wrong, expired or revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: >-
            subscription_required: the firm has no active subscription, so it
            cannot add or invite clients or send checklists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            The credential lacks the scope this call needs, the call is for
            admins only, or the member it acts as has left the firm.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such resource in this firm.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            The resource is in a state that does not allow this, such as an
            archived client, or client_limit_reached: the plan’s 20 active
            clients are in use.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: The request body is too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Too many requests. See the Retry-After header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Something went wrong on our side. Try again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth:
            - documents:read
components:
  schemas:
    FactExport:
      type: object
      properties:
        object:
          type: string
          enum:
            - fact_export
        client_id:
          type: string
        kind:
          type: string
          enum:
            - register
            - history
        as_at:
          type: string
        fact_count:
          type: number
          description: Facts the firm keeps, archived ones left out.
        held_count:
          type: number
          description: How many of them held a value that day.
        values:
          anyOf:
            - type: array
              items:
                type: object
                properties:
                  key:
                    type: string
                  label:
                    type: string
                  value:
                    type: string
                    description: >-
                      As stored: dates YYYY-MM-DD, amounts dollars with two
                      decimals.
                  value_shown:
                    type: string
                    description: As printed, such as 12 Mar 1988.
                  origin:
                    type: string
                    description: document, member, ask, or a later origin.
                  source:
                    type: string
                    description: >-
                      The document it was read from, or who entered it, in a few
                      words.
                  page:
                    anyOf:
                      - type: number
                      - type: 'null'
                  note:
                    anyOf:
                      - type: string
                      - type: 'null'
                  confirmed_by:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: The member who accepted or entered it.
                  confirmed_on:
                    type: string
                required:
                  - key
                  - label
                  - value
                  - value_shown
                  - origin
                  - source
                  - page
                  - note
                  - confirmed_by
                  - confirmed_on
                additionalProperties: true
            - type: 'null'
          description: 'For a register: the values that stood at the end of as_at.'
        changes:
          anyOf:
            - type: array
              items:
                type: object
                properties:
                  at:
                    type: string
                    description: An ISO 8601 time in UTC.
                  key:
                    type: string
                  label:
                    type: string
                  change:
                    type: string
                    description: >-
                      Read from document, Proposed by Ask, Entered, Replaced,
                      Accepted, Corrected, accepted, Rejected or Removed.
                  value:
                    type: string
                  value_shown:
                    type: string
                  by:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: The member, by name.
                  source:
                    anyOf:
                      - type: string
                      - type: 'null'
                  page:
                    anyOf:
                      - type: number
                      - type: 'null'
                  read_as:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: The value as read, for a correction.
                  replaced:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: The values it replaced.
                  note:
                    anyOf:
                      - type: string
                      - type: 'null'
                required:
                  - at
                  - key
                  - label
                  - change
                  - value
                  - value_shown
                  - by
                  - source
                  - page
                  - read_as
                  - replaced
                  - note
                additionalProperties: true
            - type: 'null'
          description: 'For a history: every change up to the end of as_at, oldest first.'
        file_name:
          type: string
        download_url:
          anyOf:
            - type: string
            - type: 'null'
          description: The PDF or CSV. Works for 15 minutes.
        download_expires_at:
          anyOf:
            - type: string
              description: An ISO 8601 time in UTC.
            - type: 'null'
      required:
        - object
        - client_id
        - kind
        - as_at
        - fact_count
        - held_count
        - values
        - changes
        - file_name
        - download_url
        - download_expires_at
      additionalProperties: true
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - rate_limit_error
                - api_error
            code:
              type: string
            message:
              type: string
            param:
              anyOf:
                - type: string
                - type: 'null'
            request_id:
              type: string
          required:
            - type
            - code
            - message
            - param
            - request_id
          additionalProperties: true
      required:
        - error
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A firm API key, shown once when it is made, or a connected app’s OAuth
        access token. Each operation lists the scope it needs, such as
        clients:write.

````

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