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

# List spend records

> Retrieve daily spend records for a platform and date range.

<div className="nb-api-tables nb-field-table">
  ## Headers

  | Header | Description |
  | :- | :- |
  | `Authorization` <span className="nb-req">required</span> | Your Northbeam API key |
  | `Data-Client-ID` <span className="nb-req">required</span> | Your Northbeam client ID |

  ## Query parameters

  <div className="nb-table-wrap"><table className="nb-main-table"><thead><tr><th>Parameter</th><th>Type</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>date</code></td><td>string (date)</td><td>The date of spend entries to search for - provide this OR the Date Start/End ONLY</td><td><code className="nb-ex">"1970-01-01"</code></td></tr><tr><td><code>date\_start</code></td><td>string (date)</td><td>The date range of a spend entries to search for - provide this or and a end date OR a date ONLY</td><td><code className="nb-ex">"1970-01-01T00:00:00Z"</code></td></tr><tr><td><code>date\_end</code></td><td>string (date)</td><td>The date range of a spend entries to search for - provide this or and a start date OR a date ONLY</td><td><code className="nb-ex">"1970-01-01T00:00:00Z"</code></td></tr><tr><td><code>platform\_account\_id</code></td><td>string</td><td>The Ad Platform Account ID to search for, required</td><td><code className="nb-ex">"12345"</code></td></tr><tr><td><code>campaign\_id</code></td><td>string</td><td>The Ad Platform's Campaign ID to search for</td><td><code className="nb-ex">"12345"</code></td></tr><tr><td><code>adset\_id</code></td><td>string</td><td>The Ad Platform's Adset ID to search for</td><td><code className="nb-ex">"12345"</code></td></tr><tr><td><code>ad\_id</code></td><td>string</td><td>The Ad Platform's Ad ID to search for</td><td><code className="nb-ex">"12345"</code></td></tr><tr><td><code>page</code></td><td>integer</td><td>If Paginating - supply page number<br />Required range: <code>x >= 1</code><br />Default: <code>1</code></td><td><code className="nb-ex">1</code></td></tr><tr><td><code>page\_size</code></td><td>integer</td><td>Results per page - Maximum of 1000 results per page<br />Default: <code>1000</code></td><td><code className="nb-ex">1000</code></td></tr></tbody></table></div>

  ## Responses

  | Status | Description |
  | :- | :- |
  | `200` | List of spend records. |
  | `401` | Authentication failed. |
  | `422` | The request body is invalid. |
  | `4XX` | An unexpected error occurred. |
  | `5XX` | An unexpected error occurred. |

  ### `200` response body

  <div className="nb-table-wrap"><table className="nb-main-table"><thead><tr><th>Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr className="nb-has-children"><td><code>data</code> <span className="nb-req">required</span></td><td>object\[]</td><td /></tr><tr className="nb-children-row"><td /><td /><td colSpan={1}><div className="nb-toggle nb-children"><label><input type="checkbox" /><span>Show child attributes</span></label><div className="nb-toggle-body"><div className="nb-child-table"><div className="nb-ct-head"><div>Field</div><div>Type</div><div>Description</div><div>Example</div></div><div className="nb-ct-row"><div><code>date</code> <span className="nb-req">required</span></div><div>string (date)</div><div>The date of spend entry to upsert, required</div><div><code className="nb-ex">"1970-01-01"</code></div></div><div className="nb-ct-row"><div><code>platform\_account\_id</code></div><div>string</div><div>The Ad Platform Account ID to upsert, used for segregating ad objects per ad platform account<br />Default: <code>""</code></div><div><code className="nb-ex">"12345"</code></div></div><div className="nb-ct-row"><div><code>platform\_name</code> <span className="nb-req">required</span></div><div>string</div><div>The Ad Platform Name to upsert, required</div><div><code className="nb-ex">"Facebook"</code></div></div><div className="nb-ct-row"><div><code>campaign\_id</code> <span className="nb-req">required</span></div><div>string</div><div>The Ad Platform's Campaign ID (utm\_campaign, if known) to upsert, required</div><div><code className="nb-ex">"12345"</code></div></div><div className="nb-ct-row"><div><code>campaign\_name</code> <span className="nb-req">required</span></div><div>string</div><div>The Ad Platform Campaign Name to upsert - will be as Ad Name in the Northbeam Dashboard - can be the same as <code>campaign\_id</code></div><div><code className="nb-ex">"Banana Festival Awareness Campaign"</code></div></div><div className="nb-ct-row"><div><code>adset\_id</code></div><div>string</div><div>The Ad Platform's Adset ID (utm\_term, if known) to upsert, defaults to '' if empty (not all platforms support adsets)<br />Default: <code>""</code></div><div><code className="nb-ex">"12345"</code></div></div><div className="nb-ct-row"><div><code>adset\_name</code></div><div>string</div><div>The Ad Platform Adset Name to upsert - will be as Ad Name in the Northbeam Dashboard - can be the same as <code>adset\_id</code> - defaults to '' if empty<br />Default: <code>""</code></div><div><code className="nb-ex">"Banana Adset"</code></div></div><div className="nb-ct-row"><div><code>ad\_id</code></div><div>string</div><div>The Ad Platform's Ad ID (utm\_content, if known) to upsert, defaults to '' if empty (not all platforms support ads)<br />Default: <code>""</code></div><div><code className="nb-ex">"12345"</code></div></div><div className="nb-ct-row"><div><code>ad\_name</code></div><div>string</div><div>The Ad Platform Ad Name to upsert - will be as Ad Name in the Northbeam Dashboard - can be the same as <code>adset\_id</code> - defaults to '' if empty<br />Default: <code>""</code></div><div><code className="nb-ex">"Banana Ad"</code></div></div><div className="nb-ct-row"><div><code>spend</code> <span className="nb-req">required</span></div><div>number</div><div>Amount (in currency) spent on ad object to upsert, defaults to 0 if empty<br />Required range: <code>x >= 0</code></div><div><code className="nb-ex">"123"</code></div></div><div className="nb-ct-row"><div><code>spend\_currency</code> <span className="nb-req">required</span></div><div>string</div><div>The Currency of the Spend per ISO 4217 to upsert, required<br />Required string length: <code>3 - 3</code></div><div><code className="nb-ex">"USD"</code></div></div><div className="nb-ct-row"><div><code>impressions</code></div><div>number</div><div>The amount of impressions the ad object received on a given date, defaults to 0 if empty<br />Required range: <code>x >= 0</code><br />Default: <code>0</code></div><div><code className="nb-ex">299</code></div></div><div className="nb-ct-row"><div><code>clicks</code></div><div>number</div><div>The amount of clicks the ad object received on a given date, defaults to 0 if empty<br />Required range: <code>x >= 0</code><br />Default: <code>0</code></div><div><code className="nb-ex">0</code></div></div><div className="nb-ct-row"><div><code>created\_at</code> <span className="nb-req">required</span></div><div>string (date-time)</div><div /><div /></div><div className="nb-ct-row"><div><code>updated\_at</code> <span className="nb-req">required</span></div><div>string (date-time)</div><div /><div /></div></div></div></div></td></tr><tr><td><code>page</code> <span className="nb-req">required</span></td><td>integer</td><td /></tr><tr><td><code>page\_size</code> <span className="nb-req">required</span></td><td>integer</td><td /></tr><tr><td><code>total\_pages</code> <span className="nb-req">required</span></td><td>integer</td><td /></tr><tr><td><code>total\_count</code> <span className="nb-req">required</span></td><td>integer</td><td /></tr></tbody></table></div>

  ### `401` response body

  <div className="nb-table-wrap"><table className="nb-main-table"><thead><tr><th>Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>errors</code></td><td>object\[], nullable</td><td /></tr><tr><td><code>message</code> <span className="nb-req">required</span></td><td>string</td><td /></tr><tr><td><code>request\_id</code></td><td>string (uuid), nullable</td><td /></tr></tbody></table></div>

  ### `422` response body

  <div className="nb-table-wrap"><table className="nb-main-table"><thead><tr><th>Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>errors</code></td><td>object\[], nullable</td><td /></tr><tr><td><code>message</code> <span className="nb-req">required</span></td><td>string</td><td /></tr><tr><td><code>request\_id</code></td><td>string (uuid), nullable</td><td /></tr></tbody></table></div>

  ### `4XX` response body

  <div className="nb-table-wrap"><table className="nb-main-table"><thead><tr><th>Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>errors</code></td><td>object\[], nullable</td><td /></tr><tr><td><code>message</code> <span className="nb-req">required</span></td><td>string</td><td /></tr><tr><td><code>request\_id</code></td><td>string (uuid), nullable</td><td /></tr></tbody></table></div>

  ### `5XX` response body

  <div className="nb-table-wrap"><table className="nb-main-table"><thead><tr><th>Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>errors</code></td><td>object\[], nullable</td><td /></tr><tr><td><code>message</code> <span className="nb-req">required</span></td><td>string</td><td /></tr><tr><td><code>request\_id</code></td><td>string (uuid), nullable</td><td /></tr></tbody></table></div>
</div>


## OpenAPI

````yaml openapi/spend-v1.json GET /spend
openapi: 3.1.0
info:
  title: API - Spend - V1
  termsOfService: https://www.northbeam.io/terms
  version: 1.0.0
servers:
  - url: https://api.northbeam.io/v1
    description: Production Endpoint
  - url: https://api-uat.northbeam.io/v1
    description: >-
      User Acceptance Testing (UAT), Production Equivalent (provided for
      Customer Testing ONLY, spend submitted here does not get used in
      attribution)
security:
  - api_key: []
    client_id: []
tags: []
paths:
  /spend:
    get:
      summary: List daily spend records
      description: Retrieve daily spend records for a platform and date range.
      parameters:
        - required: false
          deprecated: false
          style: form
          explode: false
          schema:
            type: string
            format: date
            description: >-
              The date of spend entries to search for - provide this OR the Date
              Start/End ONLY
            examples:
              - '1970-01-01'
          name: date
          in: query
          allowEmptyValue: false
          allowReserved: false
        - required: false
          deprecated: false
          style: form
          explode: false
          schema:
            type: string
            format: date
            description: >-
              The date range of a spend entries to search for - provide this or
              and a end date OR a date ONLY
            examples:
              - '1970-01-01T00:00:00Z'
          name: date_start
          in: query
          allowEmptyValue: false
          allowReserved: false
        - required: false
          deprecated: false
          style: form
          explode: false
          schema:
            type: string
            format: date
            description: >-
              The date range of a spend entries to search for - provide this or
              and a start date OR a date ONLY
            examples:
              - '1970-01-01T00:00:00Z'
          name: date_end
          in: query
          allowEmptyValue: false
          allowReserved: false
        - required: false
          deprecated: false
          style: form
          explode: false
          schema:
            type: string
            description: The Ad Platform Account ID to search for, required
            examples:
              - '12345'
          name: platform_account_id
          in: query
          allowEmptyValue: false
          allowReserved: false
        - required: false
          deprecated: false
          style: form
          explode: false
          schema:
            type: string
            description: The Ad Platform's Campaign ID to search for
            examples:
              - '12345'
          name: campaign_id
          in: query
          allowEmptyValue: false
          allowReserved: false
        - required: false
          deprecated: false
          style: form
          explode: false
          schema:
            type: string
            description: The Ad Platform's Adset ID to search for
            examples:
              - '12345'
          name: adset_id
          in: query
          allowEmptyValue: false
          allowReserved: false
        - required: false
          deprecated: false
          style: form
          explode: false
          schema:
            type: string
            description: The Ad Platform's Ad ID to search for
            examples:
              - '12345'
          name: ad_id
          in: query
          allowEmptyValue: false
          allowReserved: false
        - required: false
          deprecated: false
          style: form
          explode: false
          schema:
            type: integer
            minimum: 1
            description: If Paginating - supply page number
            default: 1
            examples:
              - 1
          name: page
          in: query
          allowEmptyValue: false
          allowReserved: false
        - required: false
          deprecated: false
          style: form
          explode: false
          schema:
            type: integer
            description: Results per page - Maximum of 1000 results per page
            default: 1000
            examples:
              - 1000
          name: page_size
          in: query
          allowEmptyValue: false
          allowReserved: false
      responses:
        '200':
          description: List of spend records.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendListOutputPayload'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestError'
        '422':
          description: The request body is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestError'
        4XX:
          description: An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestError'
        5XX:
          description: An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestError'
      deprecated: false
components:
  schemas:
    SpendListOutputPayload:
      properties:
        data:
          items:
            $ref: '#/components/schemas/SpendDefaultOutput'
          type: array
          title: Data
        page:
          type: integer
          title: Page
        page_size:
          type: integer
          title: Page Size
        total_pages:
          type: integer
          title: Total Pages
        total_count:
          type: integer
          title: Total Count
      type: object
      required:
        - data
        - page
        - page_size
        - total_pages
        - total_count
      title: Spend Entries Return Metadata
    RequestError:
      properties:
        errors:
          anyOf:
            - items:
                $ref: '#/components/schemas/ErrorLoc'
              type: array
            - type: 'null'
          title: Errors
        message:
          type: string
          title: Message
        request_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Request Id
      type: object
      required:
        - message
      title: RequestError
    SpendDefaultOutput:
      properties:
        date:
          type: string
          format: date
          title: Date
          description: The date of spend entry to upsert, required
          examples:
            - '1970-01-01'
        platform_account_id:
          type: string
          title: Platform Account Id
          description: >-
            The Ad Platform Account ID to upsert, used for segregating ad
            objects per ad platform account
          default: ''
          examples:
            - '12345'
        platform_name:
          type: string
          title: Platform Name
          description: The Ad Platform Name to upsert, required
          examples:
            - Facebook
        campaign_id:
          type: string
          title: Campaign Id
          description: >-
            The Ad Platform's Campaign ID (utm_campaign, if known) to upsert,
            required
          examples:
            - '12345'
        campaign_name:
          type: string
          title: Campaign Name
          description: >-
            The Ad Platform Campaign Name to upsert - will be as Ad Name in the
            Northbeam Dashboard - can be the same as `campaign_id`
          examples:
            - Banana Festival Awareness Campaign
        adset_id:
          type: string
          title: Adset Id
          description: >-
            The Ad Platform's Adset ID (utm_term, if known) to upsert, defaults
            to '' if empty (not all platforms support adsets)
          default: ''
          examples:
            - '12345'
        adset_name:
          type: string
          title: Adset Name
          description: >-
            The Ad Platform Adset Name to upsert - will be as Ad Name in the
            Northbeam Dashboard - can be the same as `adset_id` - defaults to ''
            if empty
          default: ''
          examples:
            - Banana Adset
        ad_id:
          type: string
          title: Ad Id
          description: >-
            The Ad Platform's Ad ID (utm_content, if known) to upsert, defaults
            to '' if empty (not all platforms support ads)
          default: ''
          examples:
            - '12345'
        ad_name:
          type: string
          title: Ad Name
          description: >-
            The Ad Platform Ad Name to upsert - will be as Ad Name in the
            Northbeam Dashboard - can be the same as `adset_id` - defaults to ''
            if empty
          default: ''
          examples:
            - Banana Ad
        spend:
          type: number
          minimum: 0
          title: Spend
          description: >-
            Amount (in currency) spent on ad object to upsert, defaults to 0 if
            empty
          examples:
            - '123'
        spend_currency:
          type: string
          maxLength: 3
          minLength: 3
          title: Spend Currency
          description: The Currency of the Spend per ISO 4217 to upsert, required
          examples:
            - USD
            - CAD
        impressions:
          type: number
          minimum: 0
          title: Impressions
          description: >-
            The amount of impressions the ad object received on a given date,
            defaults to 0 if empty
          default: 0
          examples:
            - 299
        clicks:
          type: number
          minimum: 0
          title: Clicks
          description: >-
            The amount of clicks the ad object received on a given date,
            defaults to 0 if empty
          default: 0
          examples:
            - 0
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - date
        - platform_name
        - campaign_id
        - campaign_name
        - spend
        - spend_currency
        - created_at
        - updated_at
      title: Spend Entry Return
    ErrorLoc:
      properties:
        loc:
          type: string
          title: Loc
        msg:
          type: string
          title: Msg
        type:
          type: string
          title: Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ErrorLoc
  securitySchemes:
    api_key:
      type: apiKey
      name: Authorization
      in: header
    client_id:
      type: apiKey
      name: Data-Client-ID
      in: header

````