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

> Exports a report for a client as a PDF on the firm letterhead or as a CSV. balance_summary needs as_at; spending_summary and income_expenses need period_start and period_end, at most two years apart. No date may be in the future. An archived client cannot be reported on. Returns the report with a download_url that works for 15 minutes.



## OpenAPI

````yaml /openapi/advisor.json post /reports
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:
  /reports:
    post:
      tags:
        - Reports
      summary: Export a report
      description: >-
        Exports a report for a client as a PDF on the firm letterhead or as a
        CSV. balance_summary needs as_at; spending_summary and income_expenses
        need period_start and period_end, at most two years apart. No date may
        be in the future. An archived client cannot be reported on. Returns the
        report with a download_url that works for 15 minutes.
      operationId: create_report
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                client_id:
                  type: string
                  minLength: 1
                  maxLength: 60
                  description: The client the report is about, from list_clients.
                kind:
                  type: string
                  enum:
                    - balance_summary
                    - spending_summary
                    - income_expenses
                  description: >-
                    balance_summary: every account and its balance on as_at.
                    spending_summary: money out by category over a period.
                    income_expenses: money in and out by month over a period.
                format:
                  anyOf:
                    - type: string
                      enum:
                        - pdf
                        - csv
                    - type: 'null'
                  description: pdf (the default) or csv.
                as_at:
                  anyOf:
                    - type: string
                      description: A calendar day in Sydney, as YYYY-MM-DD.
                    - type: 'null'
                period_start:
                  anyOf:
                    - type: string
                      description: A calendar day in Sydney, as YYYY-MM-DD.
                    - type: 'null'
                period_end:
                  anyOf:
                    - type: string
                      description: A calendar day in Sydney, as YYYY-MM-DD.
                    - type: 'null'
              required:
                - client_id
                - kind
      responses:
        '201':
          description: Created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportWithDownload'
        '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:
            - reports:write
components:
  schemas:
    ReportWithDownload:
      type: object
      properties:
        object:
          type: string
          enum:
            - report
        id:
          type: string
        client_id:
          type: string
        client_name:
          type: string
        kind:
          type: string
          enum:
            - balance_summary
            - spending_summary
            - income_expenses
          description: >-
            balance_summary: every account and its balance on as_at.
            spending_summary: money out by category over a period.
            income_expenses: money in and out by month over a period.
        format:
          type: string
          enum:
            - pdf
            - csv
        as_at:
          anyOf:
            - type: string
            - type: 'null'
        period_start:
          anyOf:
            - type: string
            - type: 'null'
        period_end:
          anyOf:
            - type: string
            - type: 'null'
        page_count:
          anyOf:
            - type: number
            - type: 'null'
        file_name:
          type: string
        created_by_member_id:
          anyOf:
            - type: string
            - type: 'null'
        created_at:
          type: string
          description: An ISO 8601 time in UTC.
        download_url:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Fetches the file without a key. Works for 15 minutes; get the report
            again for a new one.
        download_expires_at:
          anyOf:
            - type: string
              description: An ISO 8601 time in UTC.
            - type: 'null'
      required:
        - object
        - id
        - client_id
        - client_name
        - kind
        - format
        - as_at
        - period_start
        - period_end
        - page_count
        - file_name
        - created_by_member_id
        - created_at
        - 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.