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

# Spent amount of credits

> Retrieve a list of spent credits transactions based on the specified period and date range.


# Filtering

The `/api/auth/transactions/spent_credits/` endpoint allows you to get all spent credits grouped by endpoints in the period.

## Period

Must be on of: `day`, `week`, `month`, `quarter`, `year`.

## Date

* Date: yyyy-mm-dd\
  Example: 2025-01-01

* Date and Time: yyyy-mm-ddTHH:MM:SS.ssssss\
  Example: 2025-01-01T02:03:04.000000


## OpenAPI

````yaml get /api/auth/transactions/spent_credits/
openapi: 3.0.3
info:
  title: Generect API
  description: >-
    Welcome to the Generect API documentation. Here we will help you integrate
    and use our API.


    API base url: `https://api.generect.com` — every path below is relative to
    this host. Newer endpoints live under `/api/v1/...`, legacy endpoints under
    `/api/...`; use each path exactly as documented.

    Protocol: `HTTPS`


    # Authentication


    Get your API token from the Generect app settings and send it in the
    `Authorization` header with the required `Token` prefix.


    Example: `Authorization: Token xxxxxxxxx`


    # Rate limits


    There is no monthly request quota. What you can run is bounded by your
    account balance and by the parallel-request caps on the Limits page. Pricing
    depends on the operation and the number of results returned, and may
    increase with additional data flags. For exact pricing, see each endpoint's
    Pricing section or your billing settings:
    https://app.generect.com/settings/billing


    # Note


    _Every endpoint must include the trailing `/`. Requests without the trailing
    slash may fail._
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.generect.com
security:
  - apiKey: []
tags:
  - name: 1. Auth
    description: Login and get user info
  - name: 2. Transactions
    description: List of latest transactions in your account
  - name: 3. Leads
    description: Fetch information about leads by _link/name/ICP_.
  - name: 4. Companies
    description: Fetch information about companies by link/name/ICP.
  - name: 5. Preview
    description: Search masked database leads for preview and reveal workflows.
  - name: 6. Enrich
    description: Enrich leads and companies by internal or external identifiers.
  - name: 7. Email
    description: Find and validate email addresses.
  - name: 8. Accounts
    description: Account profile, usage, and transactions.
  - name: 9. Search
    description: Database and realtime lead, company, and company-lead search.
  - name: 10. Phone
    description: Find phone numbers for leads.
  - name: 11. Webhooks
    description: Register and manage async job notifications.
paths:
  /api/auth/transactions/spent_credits/:
    get:
      summary: Fetch spent credits transactions
      description: >
        Retrieve a list of spent credits transactions based on the specified
        period and date range.
      parameters:
        - name: timezone
          in: query
          description: Timezone for date calculations
          required: true
          schema:
            type: string
        - name: period
          in: query
          description: The aggregation period for transactions
          required: true
          schema:
            type: string
            enum:
              - day
              - week
              - month
              - quarter
              - year
        - name: start_date
          in: query
          description: The start date for the transaction filter (ISO 8601 format)
          required: true
          schema:
            type: string
            format: date
        - name: end_date
          in: query
          description: The end date for the transaction filter (ISO 8601 format)
          required: true
          schema:
            type: string
            format: date
      responses:
        '200':
          description: A list of transactions for the specified period and date range
          content:
            application/json:
              schema:
                type: object
                properties:
                  spent_credits:
                    type: object
                    additionalProperties:
                      type: object
                      additionalProperties:
                        type: number
                    example:
                      '2025-01-01T00:00:00':
                        /api/linkedin/leads/by_icp/: -4428
                        /api/linkedin/companies/by_icp/: -39
                        /api/linkedin/company/by_link/: -5
                        /api/linkedin/lead/by_link/: -3
                        /api/linkedin/email_finder/: -1
                        platform: -9
                      '2024-12-01T00:00:00':
                        /api/linkedin/leads/by_icp/: -383
                        /api/linkedin/company/by_link/: -17
                        /api/linkedin/companies/by_icp/: -156
                        /api/linkedin/lead/by_link/: -6
                        platform: -12
                      '2024-11-01T00:00:00':
                        /api/linkedin/companies/by_icp/: -101
                        /api/linkedin/leads/by_icp/: -1720
                        platform: -1469
                  total_spent_credits:
                    type: number
                    example: -8349
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization
      description: 'Use the required Token prefix. Example: Authorization: Token xxxxxxxxx'

````

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