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

# Get Denial

> Get one budget-denial episode by its unique ID.



## OpenAPI

````yaml https://spec.speakeasy.com/conductor-one/conductorone/my-source-with-code-samples get /api/v1/spend-insights/denials/{block_id}
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/denials/{block_id}:
    get:
      tags:
        - Spend Insights
      summary: Get Denial
      description: Get one budget-denial episode by its unique ID.
      operationId: c1.api.spendinsights.v1.SpendInsightsService.GetDenial
      parameters:
        - in: path
          name: block_id
          required: true
          schema:
            description: Unique identifier for the denial episode.
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/c1.api.spendinsights.v1.GetDenialResponse'
          description: >-
            GetDenialResponse contains a denial episode and its first-refusal
            context.
      x-codeSamples:
        - lang: go
          label: GetDenial
          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\"github.com/conductorone/conductorone-sdk-go/pkg/models/operations\"\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.GetDenial(ctx, operations.C1APISpendinsightsV1SpendInsightsServiceGetDenialRequest{\n        BlockID: \"<id>\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.GetDenialResponse != nil {\n        // handle response\n    }\n}"
components:
  schemas:
    c1.api.spendinsights.v1.GetDenialResponse:
      description: >-
        GetDenialResponse contains a denial episode and its first-refusal
        context.
      properties:
        episode:
          oneOf:
            - $ref: '#/components/schemas/c1.api.spendinsights.v1.DenialEpisode'
            - type: 'null'
        firstDenialMoney:
          oneOf:
            - $ref: '#/components/schemas/c1.api.spendinsights.v1.DenialMoneySnapshot'
            - type: 'null'
        historicalTrace:
          oneOf:
            - $ref: '#/components/schemas/c1.api.spendinsights.v1.AdmissionTrace'
            - type: 'null'
      title: Get Denial Response
      type: object
      x-speakeasy-name-override: GetDenialResponse
    c1.api.spendinsights.v1.DenialEpisode:
      description: >-
        DenialEpisode represents repeated budget refusals for one scope and
        budget period.
      properties:
        attemptCount:
          description: >-
            Best-effort lower bound for refused calls in this episode.
            Concurrent
             retry exhaustion can under-report; denial_events is exact for a window.
          format: int64
          type: string
        authorityId:
          description: Identifier of the configuration that supplied the denying limit.
          type: string
        authorityKind:
          description: Type of configuration that supplied the denying limit.
          enum:
            - AUTHORITY_KIND_UNSPECIFIED
            - AUTHORITY_KIND_FUND_POLICY
            - AUTHORITY_KIND_FUND_ASSIGNMENT
            - AUTHORITY_KIND_FUND_RULE
            - AUTHORITY_KIND_TENANT_APP_CAP
            - AUTHORITY_KIND_SUBJECT_APP_LIMIT
            - AUTHORITY_KIND_ENTITLEMENT_BINDING
            - AUTHORITY_KIND_APP_USER
            - AUTHORITY_KIND_USER
          type: string
          x-speakeasy-unknown-values: allow
        authorityVersion:
          description: Version of the configuration used for the first refusal.
          format: int64
          type: string
        blockId:
          description: Unique identifier for this denial episode.
          type: string
        budgetKey:
          description: Stable identifier for the budget account that denied the calls.
          type: string
        closedAt:
          format: date-time
          type:
            - string
            - 'null'
        firstDeniedAt:
          format: date-time
          type:
            - string
            - 'null'
        lastDeniedAt:
          format: date-time
          type:
            - string
            - 'null'
        periodEnd:
          format: date-time
          type:
            - string
            - 'null'
        periodKey:
          description: Stable key for the denied budget period.
          type: string
        periodKind:
          description: Length of the denied budget period.
          enum:
            - PERIOD_KIND_UNSPECIFIED
            - PERIOD_KIND_DAILY
            - PERIOD_KIND_WEEKLY
            - PERIOD_KIND_MONTHLY
            - PERIOD_KIND_QUARTERLY
            - PERIOD_KIND_YEARLY
          type: string
          x-speakeasy-unknown-values: allow
        periodStart:
          format: date-time
          type:
            - string
            - 'null'
        reason:
          description: Reason the calls were denied.
          enum:
            - SPEND_DENY_REASON_UNSPECIFIED
            - SPEND_DENY_REASON_TENANT_FROZEN
            - SPEND_DENY_REASON_SUSPENDED_BY_ADMIN
            - SPEND_DENY_REASON_APP_SUSPENDED
            - SPEND_DENY_REASON_APP_PAUSED_BY_YOU
            - SPEND_DENY_REASON_NO_SUPPLY
          type: string
          x-speakeasy-unknown-values: allow
        requestTaskId:
          description: ID of the access request task associated with this episode.
          type: string
        requestTaskState:
          description: Current state of the associated access request task.
          enum:
            - TASK_STATE_UNSPECIFIED
            - TASK_STATE_OPEN
            - TASK_STATE_CLOSED
          type: string
          x-speakeasy-unknown-values: allow
        scopeAppId:
          description: Application ID for application-scoped episodes.
          type: string
        scopeKind:
          description: Budget scope that denied the calls.
          enum:
            - SPEND_SCOPE_KIND_UNSPECIFIED
            - SPEND_SCOPE_KIND_TENANT
            - SPEND_SCOPE_KIND_SUBJECT
            - SPEND_SCOPE_KIND_APP
            - SPEND_SCOPE_KIND_SUBJECT_APP
          type: string
          x-speakeasy-unknown-values: allow
        scopeUserId:
          description: User ID for user-scoped episodes.
          type: string
        state:
          description: Whether this denial episode remains open.
          enum:
            - SPEND_BLOCK_STATE_UNSPECIFIED
            - SPEND_BLOCK_STATE_OPEN
            - SPEND_BLOCK_STATE_CLOSED
          type: string
          x-speakeasy-unknown-values: allow
      title: Denial Episode
      type: object
      x-speakeasy-name-override: DenialEpisode
    c1.api.spendinsights.v1.DenialMoneySnapshot:
      description: DenialMoneySnapshot captures account amounts at the first refusal.
      properties:
        consumedNano:
          description: Spend already settled when the first refusal occurred.
          format: int64
          type: string
        currencyCode:
          description: Currency used for monetary values.
          type: string
        limitNano:
          description: Effective limit that caused the refusal.
          format: int64
          type: string
        requestedNano:
          description: Spend requested by the refused call.
          format: int64
          type: string
        reservedNano:
          description: Spend reserved by in-progress calls when the first refusal occurred.
          format: int64
          type: string
      title: Denial Money Snapshot
      type: object
      x-speakeasy-name-override: DenialMoneySnapshot
    c1.api.spendinsights.v1.AdmissionTrace:
      description: >-
        AdmissionTrace records the bounded authority decision made during
        admission.
      properties:
        allocations:
          description: Per-scope limits resolved during admission.
          items:
            $ref: '#/components/schemas/c1.api.spendinsights.v1.TraceAllocation'
          type:
            - array
            - 'null'
        authorityRefs:
          description: Configurations read during admission.
          items:
            $ref: '#/components/schemas/c1.api.spendinsights.v1.AuthorityRef'
          type:
            - array
            - 'null'
      title: Admission Trace
      type: object
      x-speakeasy-name-override: AdmissionTrace
    c1.api.spendinsights.v1.TraceAllocation:
      description: TraceAllocation records one scope's historical limit and its source.
      properties:
        budgetKey:
          description: Stable identifier for the scope's budget account.
          type: string
        limit:
          oneOf:
            - $ref: '#/components/schemas/c1.api.spendinsights.v1.ResolvedLimit'
            - type: 'null'
        period:
          description: Length of the budget period.
          enum:
            - PERIOD_KIND_UNSPECIFIED
            - PERIOD_KIND_DAILY
            - PERIOD_KIND_WEEKLY
            - PERIOD_KIND_MONTHLY
            - PERIOD_KIND_QUARTERLY
            - PERIOD_KIND_YEARLY
          type: string
          x-speakeasy-unknown-values: allow
        source:
          oneOf:
            - $ref: '#/components/schemas/c1.api.spendinsights.v1.AuthorityRef'
            - type: 'null'
      title: Trace Allocation
      type: object
      x-speakeasy-name-override: TraceAllocation
    c1.api.spendinsights.v1.AuthorityRef:
      description: AuthorityRef identifies a configuration and the revision admission read.
      properties:
        absent:
          description: Whether admission found no configuration of this kind.
          type: boolean
        appEntitlementId:
          description: Application entitlement ID, for entitlement-binding authorities.
          type: string
        appId:
          description: Application ID the configuration applies to.
          type: string
        appUserId:
          description: Application user ID, for application-user authorities.
          type: string
        kind:
          description: Type of configuration.
          enum:
            - AUTHORITY_KIND_UNSPECIFIED
            - AUTHORITY_KIND_FUND_POLICY
            - AUTHORITY_KIND_FUND_ASSIGNMENT
            - AUTHORITY_KIND_FUND_RULE
            - AUTHORITY_KIND_TENANT_APP_CAP
            - AUTHORITY_KIND_SUBJECT_APP_LIMIT
            - AUTHORITY_KIND_ENTITLEMENT_BINDING
            - AUTHORITY_KIND_APP_USER
            - AUTHORITY_KIND_USER
          type: string
          x-speakeasy-unknown-values: allow
        ruleId:
          description: Fund rule ID, for fund-rule authorities.
          type: string
        userId:
          description: User ID the configuration applies to.
          type: string
        version:
          description: Configuration revision read during admission.
          format: int64
          type: string
      title: Authority Ref
      type: object
      x-speakeasy-name-override: AuthorityRef
    c1.api.spendinsights.v1.ResolvedLimit:
      description: >
        ResolvedLimit records the historical limit of an admitted account.


        This message contains a oneof named kind. Only a single field of the
        following list may be set at a time:
          - unlimited
          - amount
      properties:
        amount:
          oneOf:
            - $ref: '#/components/schemas/c1.api.spendinsights.v1.ResolvedAmount'
            - type: 'null'
        unlimited:
          oneOf:
            - $ref: '#/components/schemas/c1.api.spendinsights.v1.ResolvedUnlimited'
            - type: 'null'
      title: Resolved Limit
      type: object
      x-speakeasy-name-override: ResolvedLimit
    c1.api.spendinsights.v1.ResolvedAmount:
      description: ResolvedAmount records the admitted nano-unit limit.
      properties:
        amountNano:
          description: Admitted limit, in nano-units.
          format: int64
          type: string
      title: Resolved Amount
      type: object
      x-speakeasy-name-override: ResolvedAmount
    c1.api.spendinsights.v1.ResolvedUnlimited:
      description: ResolvedUnlimited records accounting without a finite admission limit.
      title: Resolved Unlimited
      type: object
      x-speakeasy-name-override: ResolvedUnlimited
  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

````