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

# Validate billing datasource configuration



## OpenAPI

````yaml /api-reference/openapi.json post /terraform/billingDatasources/validate
openapi: 3.0.0
info:
  title: Costory
  version: '1.0'
  description: API Documentation
servers:
  - url: https://app-api.costory.io
security: []
paths:
  /terraform/billingDatasources/validate:
    post:
      tags:
        - Admin Billing Datasources
      summary: Validate billing datasource configuration
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdminBillingDatasourceCreate'
      responses:
        '200':
          description: Validation result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminValidationResult'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  schemas:
    AdminBillingDatasourceCreate:
      oneOf:
        - type: object
          properties:
            name:
              type: string
            type:
              type: string
              enum:
                - GCP
            bqTablePath:
              type: string
            isDetailedBilling:
              type: boolean
            startDate:
              type: string
              nullable: true
              format: date-time
            endDate:
              type: string
              nullable: true
              format: date-time
          required:
            - name
            - type
            - bqTablePath
        - type: object
          properties:
            name:
              type: string
            type:
              type: string
              enum:
                - Azure
            sasUrl:
              type: string
              format: uri
            containerName:
              type: string
              minLength: 1
            storageAccountName:
              type: string
              minLength: 1
            actualsPath:
              type: string
              minLength: 1
            amortizedPath:
              type: string
              minLength: 1
          required:
            - name
            - type
            - sasUrl
            - containerName
            - storageAccountName
            - actualsPath
            - amortizedPath
        - type: object
          properties:
            name:
              type: string
            type:
              type: string
              enum:
                - AWS
            bucketName:
              type: string
            roleArn:
              type: string
              pattern: ^arn:aws:iam::\d{12}:role\/[\w+=,.@-]+$
            prefix:
              type: string
              default: ''
            eksSplitDataEnabled:
              type: boolean
              default: false
            startDate:
              type: string
              nullable: true
              format: date-time
            endDate:
              type: string
              nullable: true
              format: date-time
            eksSplit:
              type: boolean
          required:
            - name
            - type
            - bucketName
            - roleArn
        - type: object
          properties:
            name:
              type: string
            type:
              type: string
              enum:
                - Cursor
            adminApiKey:
              type: string
              minLength: 1
            startDate:
              type: string
              nullable: true
              format: date-time
            endDate:
              type: string
              nullable: true
              format: date-time
          required:
            - name
            - type
            - adminApiKey
        - type: object
          properties:
            name:
              type: string
            type:
              type: string
              enum:
                - Anthropic
            adminApiKey:
              type: string
              minLength: 1
            startDate:
              type: string
              nullable: true
              format: date-time
            endDate:
              type: string
              nullable: true
              format: date-time
          required:
            - name
            - type
            - adminApiKey
        - type: object
          properties:
            name:
              type: string
            type:
              type: string
              enum:
                - ElasticCloud
            apiKey:
              type: string
              minLength: 1
            organizationId:
              type: string
              minLength: 1
            startDate:
              type: string
              nullable: true
              format: date-time
          required:
            - name
            - type
            - apiKey
            - organizationId
        - type: object
          properties:
            name:
              type: string
            type:
              type: string
              enum:
                - ClickHouseCloud
            keyId:
              type: string
              minLength: 1
            keySecret:
              type: string
              minLength: 1
            organizationId:
              type: string
              minLength: 1
            startDate:
              type: string
              nullable: true
              format: date-time
          required:
            - name
            - type
            - keyId
            - keySecret
            - organizationId
      discriminator:
        propertyName: type
    AdminValidationResult:
      type: object
      properties:
        isSuccess:
          type: boolean
      required:
        - isSuccess
      additionalProperties: {}
    BadRequest:
      type: object
      properties:
        error:
          type: string
          description: Error code
        reason:
          type: string
          description: Human-readable reason
        details:
          description: Additional details
        summary:
          type: string
          description: Optional short summary
      required:
        - error
    Unauthorized:
      type: object
      properties:
        error:
          type: string
          description: Unauthorized error message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or Clerk ak_* API key
      description: >-
        Send `Authorization: Bearer <credential>` using either a Clerk session
        JWT or a Clerk API key (`ak_*`). API keys may identify a user (`user_*`)
        or organization (`org_*`) principal and are generated in the Clerk
        Dashboard under API keys.
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-token
      description: >-
        API token for authentication (or Admin API key). The token is scoped per
        organization and can be retrieved in the Organization Switcher.

````