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

# Push FOCUS billing records

> Sends FOCUS 1.2 records to a push connection. Authenticate with an API key or an OAuth access token that carries the focus:write scope; install tokens are rejected. charge_period_start and charge_period_end declare the window the batch describes: RFC 3339, the end after the start, no more than 366 days apart, the start on or after 2010-01-01 and not in the future. overwrite true replaces everything previously ingested for the connection inside the window, and is refused with no rows because it would delete the window. Without overwrite the batch appends and must carry batch_id, one id per export run, plus row_offset, the index of the page's first row, so a resent page updates its rows instead of duplicating them. Set final false on every page of a batch except the last; it requires batch_id. batch_id may contain letters, digits, dot, dash and underscore, up to 128 characters. One invalid row rejects the whole batch with a 422 that names the row index. Every row in a batch must carry the same provider, and it must match the connection's. Only one ingest runs per connection at a time, so a concurrent push gets a 409.



## OpenAPI

````yaml /api-reference/costgraph/openapi.json post /api/v1/tenant/billing/focus
openapi: 3.0.0
info:
  description: Read and manage your CostGraph organization, spend, alerts, and settings.
  title: CostGraph API
  contact: {}
  version: '1.0'
servers:
  - url: https://api.costgraph.ai
security: []
tags:
  - name: ai
    x-group: AI
  - name: ai-serving
    x-group: AI serving
  - name: anomalies
    x-group: Anomalies
  - name: auth
    x-group: Auth
  - name: billing
    x-group: Billing
  - name: billing-export
    x-group: Billing export
  - name: budgets
    x-group: Budgets
  - name: ci
    x-group: CI
  - name: compute-recommendations
    x-group: Compute recommendations
  - name: config
    x-group: Config
  - name: context-graph
    x-group: Context graph
  - name: cost
    x-group: Cost
  - name: gpus
    x-group: GPUs
  - name: graphai
    x-group: Graph AI
  - name: integrations
    x-group: Integrations
  - name: invitations
    x-group: Invitations
  - name: kubernetes-clusters
    x-group: Kubernetes clusters
  - name: marketplace
    x-group: Marketplace
  - name: network-requests
    x-group: Network requests
  - name: notifications
    x-group: Notifications
  - name: oauth
    x-group: OAuth
  - name: oauth-clients
    x-group: OAuth clients
  - name: opencost
    x-group: OpenCost
  - name: organization
    x-group: Audit log
  - name: organizations
    x-group: Organizations
  - name: placement-alternatives
    x-group: Placement alternatives
  - name: reports
    x-group: Reports
  - name: service-map
    x-group: Service map
  - name: settings
    x-group: Settings
  - name: sso
    x-group: Single sign-on
  - name: tenants
    x-group: Tenants
  - name: ticketing
    x-group: Ticketing
  - name: user
    x-group: Users
  - name: virtual-machines
    x-group: Virtual machines
  - name: virtual-tags
    x-group: Virtual tags
  - name: workflows
    x-group: Workflows
paths:
  /api/v1/tenant/billing/focus:
    post:
      tags:
        - integrations
      summary: Push FOCUS billing records
      description: >-
        Sends FOCUS 1.2 records to a push connection. Authenticate with an API
        key or an OAuth access token that carries the focus:write scope; install
        tokens are rejected. charge_period_start and charge_period_end declare
        the window the batch describes: RFC 3339, the end after the start, no
        more than 366 days apart, the start on or after 2010-01-01 and not in
        the future. overwrite true replaces everything previously ingested for
        the connection inside the window, and is refused with no rows because it
        would delete the window. Without overwrite the batch appends and must
        carry batch_id, one id per export run, plus row_offset, the index of the
        page's first row, so a resent page updates its rows instead of
        duplicating them. Set final false on every page of a batch except the
        last; it requires batch_id. batch_id may contain letters, digits, dot,
        dash and underscore, up to 128 characters. One invalid row rejects the
        whole batch with a 422 that names the row index. Every row in a batch
        must carry the same provider, and it must match the connection's. Only
        one ingest runs per connection at a time, so a concurrent push gets a
        409.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/focus.pushRequest'
        description: FOCUS batch
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.SuccessResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '413':
          description: Request Entity Too Large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
components:
  schemas:
    focus.pushRequest:
      type: object
      properties:
        batch_id:
          type: string
        charge_period_end:
          type: string
        charge_period_start:
          type: string
        connection_id:
          type: string
        final:
          type: boolean
        focus_version:
          type: string
        overwrite:
          type: boolean
        row_offset:
          type: integer
        rows:
          type: array
          items:
            $ref: '#/components/schemas/focus.Record'
    responses.SuccessResponse:
      type: object
      required:
        - message
        - status
      properties:
        data: {}
        message:
          type: string
          example: some message
        status:
          type: string
          example: success
    responses.ErrorResponse:
      type: object
      required:
        - message
        - status
      properties:
        message:
          type: string
          example: some message
        status:
          type: string
          example: error
    focus.Record:
      type: object
      properties:
        AvailabilityZone:
          type: string
        BilledCost:
          type: string
        BillingAccountId:
          type: string
        BillingAccountName:
          type: string
        BillingAccountType:
          type: string
        BillingCurrency:
          type: string
        BillingPeriodEnd:
          type: string
        BillingPeriodStart:
          type: string
        CapacityReservationId:
          type: string
        CapacityReservationStatus:
          type: string
        ChargeCategory:
          type: string
        ChargeClass:
          type: string
        ChargeDescription:
          type: string
        ChargeFrequency:
          type: string
        ChargePeriodEnd:
          type: string
        ChargePeriodStart:
          type: string
        CommitmentDiscountCategory:
          type: string
        CommitmentDiscountId:
          type: string
        CommitmentDiscountName:
          type: string
        CommitmentDiscountQuantity:
          type: string
        CommitmentDiscountStatus:
          type: string
        CommitmentDiscountType:
          type: string
        CommitmentDiscountUnit:
          type: string
        ConsumedQuantity:
          type: string
        ConsumedUnit:
          type: string
        ContractedCost:
          type: string
        ContractedUnitPrice:
          type: string
        EffectiveCost:
          type: string
        InvoiceId:
          type: string
        InvoiceIssuer:
          type: string
        ListCost:
          type: string
        ListUnitPrice:
          type: string
        PricingCategory:
          type: string
        PricingCurrency:
          type: string
        PricingCurrencyContractedUnitPrice:
          type: string
        PricingCurrencyEffectiveCost:
          type: string
        PricingCurrencyListUnitPrice:
          type: string
        PricingQuantity:
          type: string
        PricingUnit:
          type: string
        Provider:
          type: string
        Publisher:
          type: string
        RegionId:
          type: string
        RegionName:
          type: string
        ResourceId:
          type: string
        ResourceName:
          type: string
        ResourceType:
          type: string
        ServiceCategory:
          type: string
        ServiceName:
          type: string
        ServiceSubcategory:
          type: string
        SkuId:
          type: string
        SkuMeter:
          type: string
        SkuPriceDetails:
          type: array
          items:
            type: integer
        SkuPriceId:
          type: string
        SubAccountId:
          type: string
        SubAccountName:
          type: string
        SubAccountType:
          type: string
        Tags:
          type: array
          items:
            type: integer
  securitySchemes:
    ApiKeyAuth:
      description: API key for machine-to-machine authentication
      type: apiKey
      name: X-API-Key
      in: header
    BearerAuth:
      description: Enter "Bearer {token}"
      type: apiKey
      name: Authorization
      in: header

````

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