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

# Get the wallet balance

> The subaccount's prepaid balance, as its Subaccount Owner sees it in the dashboard. In automatic billing the subaccount pays its usage from its own wallet; in manual billing its agency pays it, and the response is mode manual with wallet null. A key whose role cannot see the balance in the dashboard gets 404 resource_not_found.



## OpenAPI

````yaml /openapi.yaml get /balance
openapi: 3.1.0
info:
  title: NewLead API
  version: 1.0.0
  description: >-
    The NewLead public API. Each API key belongs to one subaccount and can read
    and change only that subaccount's data. Errors, pagination, idempotency and
    rate limits are documented at https://docs.newlead.ai.
servers:
  - url: https://rest.newlead.ai/v1
security:
  - BearerAuth: []
  - ApiKeyHeader: []
tags:
  - name: Account
    description: >-
      The account and subaccount of the API key, and the subaccount's wallet
      balance.
  - name: Metrics
    description: >-
      Counts of leads, conversations and calls for a period, as in the
      dashboard.
  - name: Text agents
    description: >-
      Your WhatsApp, Instagram and web chat agents, their templates, lead fields
      and qualification questions.
  - name: Leads
    description: >-
      The people your agents talk to. Create, update, search and pause the AI
      for each one.
  - name: Messages
    description: >-
      Send text and WhatsApp templates, read the conversation and download
      attachments.
  - name: Voice agents
    description: Your voice agents.
  - name: Calls
    description: >-
      Have a voice agent call a phone number, and read calls, transcripts and
      recordings.
  - name: Webhooks
    description: Endpoints that receive your agents' events.
  - name: Properties
    description: The property catalog your agents offer.
  - name: Specification
    description: This document.
paths:
  /balance:
    get:
      tags:
        - Account
      summary: Get the wallet balance
      description: >-
        The subaccount's prepaid balance, as its Subaccount Owner sees it in the
        dashboard. In automatic billing the subaccount pays its usage from its
        own wallet; in manual billing its agency pays it, and the response is
        mode manual with wallet null. A key whose role cannot see the balance in
        the dashboard gets 404 resource_not_found.
      operationId: getBalance
      responses:
        '200':
          description: The balance.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Balance'
        '429':
          $ref: '#/components/responses/RateLimited'
        4XX:
          $ref: '#/components/responses/Error'
        5XX:
          $ref: '#/components/responses/Error'
components:
  headers:
    X-Request-ID:
      description: The id of this request. Quote it when you contact support.
      schema:
        type: string
    RateLimit-Limit:
      description: Requests allowed per minute for this API key.
      schema:
        type: integer
    RateLimit-Remaining:
      description: Requests left in the current minute.
      schema:
        type: integer
    RateLimit-Reset:
      description: Seconds until the counter resets.
      schema:
        type: integer
    Retry-After:
      description: Seconds to wait before repeating the request.
      schema:
        type: integer
    Idempotent-Replayed:
      description: true when the response is the stored one for a repeated Idempotency-Key.
      schema:
        type: string
        const: 'true'
  schemas:
    Balance:
      type: object
      additionalProperties: false
      required:
        - object
        - mode
        - wallet
      properties:
        object:
          type: string
          const: balance
        mode:
          type: string
          enum:
            - auto
            - manual
          description: >-
            auto: the subaccount pays its usage from its own wallet. manual: the
            agency pays it, so the subaccount has no wallet of its own and
            wallet is null.
        wallet:
          type:
            - object
            - 'null'
          additionalProperties: false
          required:
            - available_eur
            - courtesy_margin_used_eur
            - spent_this_month_eur
            - awaiting_first_payment
          description: The subaccount's own wallet. null in manual mode.
          properties:
            available_eur:
              type: string
              description: >-
                Balance left, in euros, as text with two decimals, such as
                "12.50".
            courtesy_margin_used_eur:
              type: string
              description: >-
                What the subaccount owes from its courtesy margin since its
                balance ran out. The next top-up pays it off first.
            spent_this_month_eur:
              type: string
              description: >-
                Spent from this wallet since the 1st of the current month in
                Europe/Madrid.
            awaiting_first_payment:
              type: boolean
              description: >-
                true until the subaccount's first payment in automatic mode.
                Until then the agency pays its usage and its agents don't stop
                for lack of balance.
      examples:
        - object: balance
          mode: auto
          wallet:
            available_eur: '12.50'
            courtesy_margin_used_eur: '0.00'
            spent_this_month_eur: '37.20'
            awaiting_first_payment: false
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - type
            - code
            - message
            - param
            - request_id
            - doc_url
          properties:
            type:
              $ref: '#/components/schemas/ErrorType'
            code:
              $ref: '#/components/schemas/ErrorCode'
            message:
              type: string
              description: 'A human-readable explanation. It can change: never match on it.'
            param:
              type:
                - string
                - 'null'
              description: The offending field, dot-separated (variables.city), or null.
            request_id:
              type: string
              description: The same value as the x-request-id header.
            doc_url:
              type: string
              format: uri
            details:
              type: object
              additionalProperties: true
              description: >-
                On agent_not_ready, carries blockers. On send_outcome_unknown
                from POST /calls, carries call_id if the call is known.
      examples:
        - error:
            type: invalid_request_error
            code: parameter_invalid
            message: phone must match pattern "^\+[1-9]\d{6,14}$".
            param: phone
            request_id: req_m3k2a9_4f1c2b7e
            doc_url: https://docs.newlead.ai/errors#parameter_invalid
    ErrorType:
      type: string
      enum:
        - invalid_request_error
        - authentication_error
        - billing_error
        - permission_error
        - not_found_error
        - conflict_error
        - rate_limit_error
        - api_error
        - provider_error
    ErrorCode:
      type: string
      description: >-
        The closed list of error causes. The table is at
        https://docs.newlead.ai/errors.
      enum:
        - parameter_missing
        - parameter_invalid
        - parameter_unknown
        - body_invalid_json
        - recipient_invalid
        - api_key_missing
        - api_key_invalid
        - insufficient_balance
        - subscription_inactive
        - api_key_forbidden
        - feature_disabled
        - resource_not_found
        - route_not_found
        - agent_not_ready
        - lead_do_not_contact
        - lead_ai_paused
        - messaging_window_closed
        - template_not_approved
        - outside_initiation_hours
        - voice_number_missing
        - webhook_endpoint_limit_reached
        - webhook_endpoint_disabled
        - idempotency_key_reused
        - idempotency_key_in_use
        - rate_limit_exceeded
        - internal_error
        - provider_unavailable
        - media_unavailable
        - send_outcome_unknown
  responses:
    RateLimited:
      description: Too many requests for this API key. Wait for Retry-After and repeat.
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Error:
      description: An error. type is the family and code is the cause.
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
        Idempotent-Replayed:
          $ref: '#/components/headers/Idempotent-Replayed'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        The API key, created in Settings › API keys, in the header
        Authorization: Bearer <key>. The default.
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: The same key, in the x-api-key header. Still accepted.

````

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