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

# Download the attribution record

> Download one JSON file holding the whole attribution record for a range of days. The key needs every permission of the reads inside it. One download a minute.



## OpenAPI

````yaml https://plainrouter.com/openapi.json get /workspaces/{workspace}/admin/attribution-record
openapi: 3.1.0
info:
  title: Plainrouter Conversion API
  version: 0.5.0
  description: Plainrouter public Signals Conversion API.
servers:
  - url: https://plainrouter.com/api/v1
    description: Production
security:
  - workspaceSecret: []
paths:
  /workspaces/{workspace}/admin/attribution-record:
    get:
      tags:
        - AttributionRecord
      summary: Download the attribution record
      description: >-
        Download one JSON file holding the whole attribution record for a range
        of days. The key needs every permission of the reads inside it. One
        download a minute.
      operationId: get_attribution_record
      parameters:
        - name: workspace
          in: path
          required: true
          description: The workspace ID
          schema:
            type: integer
        - name: from
          in: query
          required: true
          description: >-
            First day of the range, as YYYY-MM-DD. Days are days in the time
            zone of the workspace advertising account, or UTC without one.
          schema:
            type: string
            format: date
        - name: to
          in: query
          required: true
          description: >-
            Last day of the range, as YYYY-MM-DD, on or after from. A range may
            hold at most 366 days.
          schema:
            type: string
            format: date
      responses:
        '200':
          description: >-
            One JSON document, sent as an attachment and never stored: a
            manifest, then each section as its own read returns it.
          content:
            application/json:
              schema:
                type: object
                properties:
                  manifest:
                    type: object
                    properties:
                      document:
                        type: string
                        enum:
                          - plainrouter-attribution-record
                      version:
                        type: integer
                      generated_at:
                        type: string
                        format: date-time
                      workspace_id:
                        type: integer
                      range:
                        type: object
                        properties:
                          from:
                            type: string
                            format: date
                          to:
                            type: string
                            format: date
                          timezone:
                            type: string
                          from_utc:
                            type: string
                            format: date-time
                          until_utc:
                            type: string
                            format: date-time
                            description: The first instant after the range.
                        required:
                          - from
                          - to
                          - timezone
                          - from_utc
                          - until_utc
                      basis:
                        type: string
                        description: >-
                          One sentence on what the sections are and how counted
                          and Meta lines differ.
                      hash:
                        type: string
                        description: >-
                          How each sha256 is computed, so a reader of the file
                          can check it.
                      sections:
                        type: object
                        description: >-
                          One entry for each section that follows, in file
                          order.
                        additionalProperties:
                          type: object
                          properties:
                            timezone:
                              type: string
                              description: The time zone the section used for the range.
                            rows:
                              type: object
                              description: Row counts by list name.
                              additionalProperties:
                                type: integer
                            sha256:
                              type: string
                              description: >-
                                SHA-256 of the section as compact JSON with
                                object keys sorted, lists kept in order, slashes
                                unescaped and non-ASCII characters escaped.
                            covers:
                              type:
                                - object
                                - 'null'
                              description: >-
                                Arrivals only: the days its fixed trailing
                                window holds, which can lie partly or wholly
                                outside the range; null when no window could be
                                read.
                              properties:
                                from:
                                  type: string
                                  format: date
                                to:
                                  type: string
                                  format: date
                              required:
                                - from
                                - to
                          required:
                            - timezone
                            - rows
                            - sha256
                    required:
                      - document
                      - version
                      - generated_at
                      - workspace_id
                      - range
                      - basis
                      - hash
                      - sections
                  monthly_statements:
                    type: object
                    description: >-
                      The monthly statements read for the months the range
                      touches, with limit 24.
                    additionalProperties: {}
                  arrivals:
                    type: object
                    description: >-
                      The arrivals comparison read. That read keeps fixed
                      trailing windows, so window names the one used: the
                      shortest that reaches the first day, or the longest this
                      workspace may read.
                    additionalProperties: {}
                  conversion_journeys:
                    type: object
                    description: >-
                      The conversion journeys read for the range and all three
                      conversion kinds, with every journey instead of one page.
                    additionalProperties: {}
                  cac_by_channel:
                    type: object
                    description: >-
                      reads holds the CAC by channel read for the range, once
                      for each conversion kind: subscribed, trial_started,
                      purchase.
                    additionalProperties: {}
                  meta:
                    type: object
                    description: >-
                      windows holds the inventory metrics read with changes and
                      revisions, seven account-local days at a time, for the one
                      advertising account the key may read; otherwise
                      unavailable_reason says why. Change rows name the people
                      who made them, as that read does.
                    additionalProperties: {}
                  receipts:
                    type: object
                    description: >-
                      Receipts created in the range for the same account, each
                      with the decision receipt read of its action, or null
                      before one is issued.
                    additionalProperties: {}
                  audit_events:
                    type: object
                    description: >-
                      The audit export read for the range, redacted as that read
                      is, with every event instead of one page.
                    additionalProperties: {}
                  audit_verification:
                    type: object
                    description: The audit verify read for the whole stored chain.
                    additionalProperties: {}
                required:
                  - manifest
                  - monthly_statements
                  - arrivals
                  - conversion_journeys
                  - cac_by_channel
                  - meta
                  - receipts
                  - audit_events
                  - audit_verification
          headers:
            Content-Disposition:
              description: >-
                attachment;
                filename=plainrouter-attribution-record-{workspace}-{from}-{to}.json
              required: true
              schema:
                type: string
            Cache-Control:
              description: no-store, private
              required: true
              schema:
                type: string
        '401':
          description: >-
            Workspace key missing, expired, revoked or no longer valid for its
            issuer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: >-
            The key lacks a permission one of the reads needs, and the message
            names each missing one; or it is bound to one ad account, which
            cannot read the audit log. No file is sent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Workspace outside the credential binding or unavailable.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ErrorMessage'
                  - $ref: '#/components/schemas/ApiRouteNotFound'
        '422':
          description: >-
            Invalid range, a range longer than 366 days, or more than 25,000
            rows in one section or 2,000 receipts. The message asks for a
            shorter range. No file is sent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '429':
          description: >-
            One download a minute for each workspace, counted only for a key
            that holds every permission. Only a few records are made at once
            across Plainrouter, so a busy moment also answers 429. The shared
            API limit also applies.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          headers:
            Retry-After:
              description: Seconds until retry is allowed.
              required: true
              schema:
                type: integer
      security:
        - workspaceExportKey: []
components:
  schemas:
    ErrorMessage:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: ErrorMessage
    ApiRouteNotFound:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - api_route_not_found
            message:
              type: string
            resolution:
              type: string
          required:
            - code
            - message
            - resolution
        request:
          type: object
          properties:
            method:
              type: string
            path:
              type: string
          required:
            - method
            - path
        resources:
          type: object
          properties:
            documentation:
              type: string
            openapi:
              type: string
          required:
            - documentation
            - openapi
      required:
        - error
        - request
        - resources
      title: ApiRouteNotFound
    ValidationError:
      type: object
      properties:
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
      required:
        - message
        - errors
      title: ValidationError
  securitySchemes:
    workspaceSecret:
      type: http
      description: >-
        Per-workspace Server secret. It authenticates only the Signals workspace
        represented by the credential.
      scheme: bearer
    workspaceExportKey:
      type: http
      description: >-
        Workspace read key whose stored grant explicitly names the operation.
        Existing grants are not expanded. A Reporting key reads only arrivals,
        CAC by channel and monthly statements here.
      scheme: bearer

````

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