> ## Documentation Index
> Fetch the complete documentation index at: https://conductorone-eu-instance.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Attribution Rollups

> Get ranked settled-spend attribution groups for one dimension and time window.



## OpenAPI

````yaml https://spec.speakeasy.com/conductor-one/conductorone/my-source-with-code-samples post /api/v1/spend-insights/attribution/search
openapi: 3.1.0
info:
  description: The C1 API is a HTTP API for managing C1 resources.
  title: C1 API
  version: 0.1.0-alpha
servers:
  - description: The C1 API server for the current tenant.
    url: https://{tenantDomain}.conductor.one
    variables:
      tenantDomain:
        default: example
        description: The domain of the tenant to use for this request.
security:
  - bearerAuth: []
    oauth: []
paths:
  /api/v1/spend-insights/attribution/search:
    post:
      tags:
        - Spend Insights
      summary: Get Attribution Rollups
      description: >-
        Get ranked settled-spend attribution groups for one dimension and time
        window.
      operationId: c1.api.spendinsights.v1.SpendInsightsService.GetAttributionRollups
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/c1.api.spendinsights.v1.GetAttributionRollupsRequest
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/c1.api.spendinsights.v1.GetAttributionRollupsResponse
          description: >-
            GetAttributionRollupsResponse contains one page of ranked
            attribution groups.
      x-codeSamples:
        - lang: go
          label: GetAttributionRollups
          source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/conductorone/conductorone-sdk-go/pkg/models/shared\"\n\tconductoronesdkgo \"github.com/conductorone/conductorone-sdk-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := conductoronesdkgo.New(\n        conductoronesdkgo.WithSecurity(shared.Security{\n            BearerAuth: \"<YOUR_BEARER_TOKEN_HERE>\",\n            Oauth: \"<YOUR_OAUTH_HERE>\",\n        }),\n    )\n\n    res, err := s.SpendInsights.GetAttributionRollups(ctx, nil)\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.GetAttributionRollupsResponse != nil {\n        // handle response\n    }\n}"
components:
  schemas:
    c1.api.spendinsights.v1.GetAttributionRollupsRequest:
      description: GetAttributionRollupsRequest specifies how to group settled spend.
      properties:
        dimension:
          description: Dimension used to group settled calls.
          enum:
            - ATTRIBUTION_DIMENSION_UNSPECIFIED
            - ATTRIBUTION_DIMENSION_USER
            - ATTRIBUTION_DIMENSION_DEPARTMENT
            - ATTRIBUTION_DIMENSION_AGENT
            - ATTRIBUTION_DIMENSION_SESSION
            - ATTRIBUTION_DIMENSION_MODEL
            - ATTRIBUTION_DIMENSION_CALL_SOURCE
            - ATTRIBUTION_DIMENSION_SUBJECT_FUND_SOURCE
            - ATTRIBUTION_DIMENSION_APP
          type: string
          x-speakeasy-unknown-values: allow
        endTime:
          format: date-time
          type:
            - string
            - 'null'
        pageSize:
          description: >-
            Maximum number of groups to return. The default is 25 and the
            maximum is 100.
          format: int32
          type: integer
        pageToken:
          description: >-
            Pagination token from a previous response with the same window and
            dimension.
          type: string
        startTime:
          format: date-time
          type:
            - string
            - 'null'
      title: Get Attribution Rollups Request
      type: object
      x-speakeasy-name-override: GetAttributionRollupsRequest
    c1.api.spendinsights.v1.GetAttributionRollupsResponse:
      description: >-
        GetAttributionRollupsResponse contains one page of ranked attribution
        groups.
      properties:
        groups:
          description: Groups ordered by settled spend descending, then key ascending.
          items:
            $ref: '#/components/schemas/c1.api.spendinsights.v1.AttributionGroup'
          type:
            - array
            - 'null'
        nextPageToken:
          description: Token for the next page. Empty when no more groups remain.
          type: string
      title: Get Attribution Rollups Response
      type: object
      x-speakeasy-name-override: GetAttributionRollupsResponse
    c1.api.spendinsights.v1.AttributionGroup:
      description: |-
        AttributionGroup summarizes settled spend for one value of the requested
         attribution dimension. Missing values form their own group.
      properties:
        billableTokens:
          description: Total billable tokens attributed to this group.
          format: int64
          type: string
        blendedCostPerMillionTokensNano:
          description: Blended settled cost per million billable tokens in this group.
          format: int64
          type: string
        cacheReadTokens:
          description: Input tokens served from cache for this group.
          format: int64
          type: string
        cacheReadValueNano:
          description: Savings from cache reads compared with uncached input prices.
          format: int64
          type: string
        cacheWriteCostNano:
          description: Cost of writing tokens to cache.
          format: int64
          type: string
        cacheWriteTokens:
          description: Tokens written to cache for this group.
          format: int64
          type: string
        displayName:
          description: Display name recorded when the calls ran, when available.
          type: string
        inputTokens:
          description: Input tokens attributed to this group.
          format: int64
          type: string
        key:
          description: >-
            Stable value for the requested dimension. Empty for the
            missing-value group.
          type: string
        missing:
          description: Whether this group represents calls missing the requested dimension.
          type: boolean
        outputTokens:
          description: Output tokens attributed to this group.
          format: int64
          type: string
        reasoningTokens:
          description: Reasoning tokens attributed to this group.
          format: int64
          type: string
        settledCalls:
          description: Number of settled calls in this group.
          format: int64
          type: string
        settledNano:
          description: Settled spend attributed to this group.
          format: int64
          type: string
      title: Attribution Group
      type: object
      x-speakeasy-name-override: AttributionGroup
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http
    oauth:
      description: >-
        This API uses OAuth2 with the Client Credential flow.

        Client Credentials must be sent in the BODY, not the headers.

        For an example of how to implement this, refer to the
        [c1TokenSource.Token()](https://github.com/ConductorOne/conductorone-sdk-go/blob/3375fe7c0126d17e7ec4e711693dee7b791023aa/token_source.go#L101-L187)
        function.
      flows:
        clientCredentials:
          scopes: {}
          tokenUrl: /auth/v1/token
      type: oauth2

````