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

# List consumption transactions

> Returns the credit ledger of the company owning the API key over the requested range, one entry per line, paginated with the standard pageNumber/pageSize convention. The range is mandatory, must be ordered and may not span more than 366 days. Every entry type is returned (debits, credits, adjustments, refunds) so no balance movement is hidden. Each line carries its date, type, amount, reason, channel, agent, campaign and the balance after the entry. Cost breakdowns, free-form metadata and internal identifiers are never exposed.



## OpenAPI

````yaml GET /Consumption/transactions
openapi: 3.0.1
info:
  title: Starleads public API documentation
  description: >
    Welcome to the Starleads Public API documentation. This API provides public
    access to Starleads services, allowing developers and growth-hackers to
    interact with campaign-related data.

    ***

    ### Base endpoint

    ```https://api.starleads.co```

    ***

    ### Errors

    The API uses standard HTTP status codes to indicate the success or failure
    of the API call. In case of failure, the body of the response will be JSON
    in the following format:

    ```

    {
      "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
      "title": "Bad Request",
      "status": 400,
      "detail": "No campaign exists with campaignId : 11111111"
    }

    ```

    The ```type``` property is a link to a general description of the error
    type.

    ***

    ### Authentification

    Authentication for the API is handled with an API key that must be provided
    as a ```X-Api-Key``` header for every request.<br>

    **API keys are supposed to be a secret that only the client and server know.
    Please remember to not share them with anyone.**<br>

    You can find your API keys when authenticated in your Starleads profile
    :<br> ![Api key menu option](../images/api-menu-option-screenshot.png)
  version: v1
  x-logo:
    url: https://api.starleads.co/images/starleads-logo.png
servers: []
security: []
tags:
  - name: Agent
    description: >-
      Manage your AI agent's prompt. These endpoints allow you to read and
      update the prompt that drives your agent's behavior during calls.
  - name: CampaignField
    description: >-
      CampaignFields enables users to specify customizable fields within their
      campaigns. These fields serve as placeholders (e.g., ```{lastname}```)
      that can be dynamically filled with corresponding data when creating
      prompts, providing flexibility in tailoring campaign content based on
      specific variables.<br>**Those are the keys of the ```databag``` field of
      the request payload to add a new ```CampaignItem``` to a campaign.**
  - name: CampaignItem
    description: Represents prospects entries related to a campaign
  - name: Consumption
    description: >-
      Track your company's credit consumption. These endpoints expose your
      current balance, usage and billing period so you can build budget
      monitoring on top of the API.
  - name: Subscription
    description: >-
      Inspect your subscription contract: the plan you are on, your subscription
      status, the features currently active and your effective limits. No
      pricing information is exposed.
paths:
  /Consumption/transactions:
    get:
      tags:
        - Consumption
      summary: List the consumption ledger entries
      description: >-
        Returns the credit ledger of the company owning the API key over the
        requested range, one entry per line, paginated with the standard
        pageNumber/pageSize convention. The range is mandatory, must be ordered
        and may not span more than 366 days. Every entry type is returned
        (debits, credits, adjustments, refunds) so no balance movement is
        hidden. Each line carries its date, type, amount, reason, channel,
        agent, campaign and the balance after the entry. Cost breakdowns,
        free-form metadata and internal identifiers are never exposed.
      operationId: GetConsumptionTransactions
      parameters:
        - name: X-Api-Key
          in: header
          description: API key for authentication
          required: true
          schema:
            type: string
        - name: From
          in: query
          required: true
          schema:
            type: string
            description: Start of the ledger range (inclusive)
            format: date-time
        - name: To
          in: query
          required: true
          schema:
            type: string
            description: >-
              End of the ledger range (inclusive). The range may not span more
              than 366 days.
            format: date-time
        - name: PageNumber
          in: query
          schema:
            maximum: 2147483647
            minimum: 1
            type: integer
            description: Page number (starts at 1)
            format: int32
        - name: PageSize
          in: query
          schema:
            maximum: 100
            minimum: 1
            type: integer
            description: Number of items per page (1 to 100, default 50)
            format: int32
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsumptionTransactionPaginatedResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '502':
          description: Server Error
        '504':
          description: Server Error
components:
  schemas:
    ConsumptionTransactionPaginatedResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ConsumptionTransaction'
          description: List of items for the current page
          nullable: true
        total:
          type: integer
          description: Total number of items across all pages
          format: int32
        pageNumber:
          type: integer
          description: Current page number
          format: int32
        pageSize:
          type: integer
          description: Number of items per page
          format: int32
      additionalProperties: false
      description: Paginated response wrapper
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    ConsumptionTransaction:
      type: object
      properties:
        createdAt:
          type: string
          description: When the entry was recorded (UTC)
          format: date-time
        type:
          type: string
          description: Type of the entry (e.g. debit, credit, adjustment, refund)
          nullable: true
        amount:
          type: number
          description: Signed credit amount of the entry
          format: double
        description:
          type: string
          description: >-
            Human-readable reason for the entry. Empty when the entry carries no
            reason; use hasDescription to tell an absent reason apart from a
            blank one.
          nullable: true
        hasDescription:
          type: boolean
          description: >-
            Whether the entry actually carries a reason. False means the
            upstream ledger recorded no description at all, as opposed to a
            blank one.
        channel:
          type: string
          description: >-
            Channel the entry is attributed to (e.g. voice, sms). Null when not
            applicable.
          nullable: true
        agentId:
          type: string
          description: >-
            Identifier of the agent the entry is attributed to. Null when not
            applicable.
          nullable: true
        campaignId:
          type: string
          description: >-
            Identifier of the campaign the entry is attributed to. Null when not
            applicable.
          nullable: true
        balanceAfter:
          type: number
          description: >-
            Credit balance immediately after the entry was applied. Null when
            the upstream ledger did not record it.
          format: double
          nullable: true
      additionalProperties: false
      description: A single credit ledger entry for the company

````