Schematic credits API

The credits API from Schematic — 20 operation(s) for credits.

Documentation

Specifications

SDKs

Schemas & Data

Other Resources

OpenAPI Specification

schematic-credits-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Schematic accesstokens credits API
  version: '0.1'
  description: Schematic API
  x-rules-engine-schema-version: v97288f60
servers:
- url: https://api.schematichq.com
security:
- ApiKeyAuth: []
tags:
- name: credits
paths:
  /billing/credits:
    get:
      operationId: listBillingCredits
      summary: List billing credits
      tags:
      - credits
      parameters:
      - name: ids
        in: query
        schema:
          type: array
          items:
            type: string
          maxItems: 100
      - name: name
        in: query
        schema:
          type: string
          maxLength: 255
      - name: limit
        in: query
        description: Page limit (default 100)
        schema:
          type: integer
          description: Page limit (default 100)
          format: int64
          example: '100'
      - name: offset
        in: query
        description: Page offset (default 0)
        schema:
          type: integer
          description: Page offset (default 0)
          format: int64
          example: '0'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/BillingCreditResponseData'
                    title: ListBillingCreditsResponseData
                    maxItems: 250
                  params:
                    type: object
                    description: Input parameters
                    properties:
                      ids:
                        type: array
                        items:
                          type: string
                        maxItems: 100
                      limit:
                        type: integer
                        description: Page limit (default 100)
                        format: int64
                        example: '100'
                      name:
                        type: string
                        maxLength: 255
                      offset:
                        type: integer
                        description: Page offset (default 0)
                        format: int64
                        example: '0'
                    title: ListBillingCreditsParams
                required:
                - data
                - params
                title: ListBillingCreditsResponse
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
    post:
      operationId: createBillingCredit
      summary: Create billing credit
      tags:
      - credits
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBillingCreditRequestBody'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/BillingCreditResponseData'
                  params:
                    type: object
                    description: Input parameters
                    title: CreateBillingCreditParams
                required:
                - data
                - params
                title: CreateBillingCreditResponse
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
  /billing/credits/{credit_id}:
    get:
      operationId: getSingleBillingCredit
      summary: Get single billing credit
      tags:
      - credits
      parameters:
      - name: credit_id
        in: path
        description: credit_id
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/BillingCreditResponseData'
                  params:
                    type: object
                    description: Input parameters
                    title: GetSingleBillingCreditParams
                required:
                - data
                - params
                title: GetSingleBillingCreditResponse
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
    put:
      operationId: updateBillingCredit
      summary: Update billing credit
      tags:
      - credits
      parameters:
      - name: credit_id
        in: path
        description: credit_id
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateBillingCreditRequestBody'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/BillingCreditResponseData'
                  params:
                    type: object
                    description: Input parameters
                    title: UpdateBillingCreditParams
                required:
                - data
                - params
                title: UpdateBillingCreditResponse
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
    delete:
      operationId: softDeleteBillingCredit
      summary: Soft delete billing credit
      tags:
      - credits
      parameters:
      - name: credit_id
        in: path
        description: credit_id
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DeleteResponse'
                  params:
                    type: object
                    description: Input parameters
                    title: SoftDeleteBillingCreditParams
                required:
                - data
                - params
                title: SoftDeleteBillingCreditResponse
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
  /billing/credits/balance:
    get:
      operationId: listCompanyCreditBalances
      summary: List company credit balances
      tags:
      - credits
      parameters:
      - name: company_id
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/CompanyCreditBalanceResponseData'
                    title: ListCompanyCreditBalancesResponseData
                    maxItems: 250
                  params:
                    type: object
                    description: Input parameters
                    properties:
                      company_id:
                        type: string
                    title: ListCompanyCreditBalancesParams
                required:
                - data
                - params
                title: ListCompanyCreditBalancesResponse
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
  /billing/credits/bundles:
    get:
      operationId: listCreditBundles
      summary: List credit bundles
      tags:
      - credits
      parameters:
      - name: ids
        in: query
        schema:
          type: array
          items:
            type: string
          maxItems: 100
      - name: credit_id
        in: query
        schema:
          type: string
      - name: status
        in: query
        schema:
          $ref: '#/components/schemas/BillingCreditBundleStatus'
      - name: bundle_type
        in: query
        schema:
          $ref: '#/components/schemas/BillingCreditBundleType'
      - name: limit
        in: query
        description: Page limit (default 100)
        schema:
          type: integer
          description: Page limit (default 100)
          format: int64
          example: '100'
      - name: offset
        in: query
        description: Page offset (default 0)
        schema:
          type: integer
          description: Page offset (default 0)
          format: int64
          example: '0'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/BillingCreditBundleResponseData'
                    title: ListCreditBundlesResponseData
                    maxItems: 250
                  params:
                    type: object
                    description: Input parameters
                    properties:
                      bundle_type:
                        $ref: '#/components/schemas/BillingCreditBundleType'
                      credit_id:
                        type: string
                      ids:
                        type: array
                        items:
                          type: string
                        maxItems: 100
                      limit:
                        type: integer
                        description: Page limit (default 100)
                        format: int64
                        example: '100'
                      offset:
                        type: integer
                        description: Page offset (default 0)
                        format: int64
                        example: '0'
                      status:
                        $ref: '#/components/schemas/BillingCreditBundleStatus'
                    title: ListCreditBundlesParams
                required:
                - data
                - params
                title: ListCreditBundlesResponse
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
    post:
      operationId: createCreditBundle
      summary: Create credit bundle
      tags:
      - credits
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCreditBundleRequestBody'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/BillingCreditBundleResponseData'
                  params:
                    type: object
                    description: Input parameters
                    title: CreateCreditBundleParams
                required:
                - data
                - params
                title: CreateCreditBundleResponse
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
  /billing/credits/bundles/{bundle_id}:
    get:
      operationId: getCreditBundle
      summary: Get credit bundle
      tags:
      - credits
      parameters:
      - name: bundle_id
        in: path
        description: bundle_id
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/BillingCreditBundleResponseData'
                  params:
                    type: object
                    description: Input parameters
                    title: GetCreditBundleParams
                required:
                - data
                - params
                title: GetCreditBundleResponse
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
    put:
      operationId: updateCreditBundleDetails
      summary: Update credit bundle details
      tags:
      - credits
      parameters:
      - name: bundle_id
        in: path
        description: bundle_id
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCreditBundleDetailsRequestBody'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/BillingCreditBundleResponseData'
                  params:
                    type: object
                    description: Input parameters
                    title: UpdateCreditBundleDetailsParams
                required:
                - data
                - params
                title: UpdateCreditBundleDetailsResponse
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
    delete:
      operationId: deleteCreditBundle
      summary: Delete credit bundle
      tags:
      - credits
      parameters:
      - name: bundle_id
        in: path
        description: bundle_id
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DeleteResponse'
                  params:
                    type: object
                    description: Input parameters
                    title: DeleteCreditBundleParams
                required:
                - data
                - params
                title: DeleteCreditBundleResponse
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
  /billing/credits/bundles/count:
    get:
      operationId: countCreditBundles
      summary: Count credit bundles
      tags:
      - credits
      parameters:
      - name: ids
        in: query
        schema:
          type: array
          items:
            type: string
          maxItems: 100
      - name: credit_id
        in: query
        schema:
          type: string
      - name: status
        in: query
        schema:
          $ref: '#/components/schemas/BillingCreditBundleStatus'
      - name: bundle_type
        in: query
        schema:
          $ref: '#/components/schemas/BillingCreditBundleType'
      - name: limit
        in: query
        description: Page limit (default 100)
        schema:
          type: integer
          description: Page limit (default 100)
          format: int64
          example: '100'
      - name: offset
        in: query
        description: Page offset (default 0)
        schema:
          type: integer
          description: Page offset (default 0)
          format: int64
          example: '0'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CountResponse'
                  params:
                    type: object
                    description: Input parameters
                    properties:
                      bundle_type:
                        $ref: '#/components/schemas/BillingCreditBundleType'
                      credit_id:
                        type: string
                      ids:
                        type: array
                        items:
                          type: string
                        maxItems: 100
                      limit:
                        type: integer
                        description: Page limit (default 100)
                        format: int64
                        example: '100'
                      offset:
                        type: integer
                        description: Page offset (default 0)
                        format: int64
                        example: '0'
                      status:
                        $ref: '#/components/schemas/BillingCreditBundleStatus'
                    title: CountCreditBundlesParams
                required:
                - data
                - params
                title: CountCreditBundlesResponse
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
  /billing/credits/count:
    get:
      operationId: countBillingCredits
      summary: Count billing credits
      tags:
      - credits
      parameters:
      - name: ids
        in: query
        schema:
          type: array
          items:
            type: string
          maxItems: 100
      - name: name
        in: query
        schema:
          type: string
          maxLength: 255
      - name: limit
        in: query
        description: Page limit (default 100)
        schema:
          type: integer
          description: Page limit (default 100)
          format: int64
          example: '100'
      - name: offset
        in: query
        description: Page offset (default 0)
        schema:
          type: integer
          description: Page offset (default 0)
          format: int64
          example: '0'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CountResponse'
                  params:
                    type: object
                    description: Input parameters
                    properties:
                      ids:
                        type: array
                        items:
                          type: string
                        maxItems: 100
                      limit:
                        type: integer
                        description: Page limit (default 100)
                        format: int64
                        example: '100'
                      name:
                        type: string
                        maxLength: 255
                      offset:
                        type: integer
                        description: Page offset (default 0)
                        format: int64
                        example: '0'
                    title: CountBillingCreditsParams
                required:
                - data
                - params
                title: CountBillingCreditsResponse
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
  /billing/credits/grants/{grant_id}/zero-out:
    put:
      operationId: zeroOutGrant
      summary: Zero out grant
      tags:
      - credits
      parameters:
      - name: grant_id
        in: path
        description: grant_id
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ZeroOutGrantRequestBody'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/BillingCreditGrantResponseData'
                  params:
                    type: object
                    description: Input parameters
                    title: ZeroOutGrantParams
                required:
                - data
                - params
                title: ZeroOutGrantResponse
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
  /billing/credits/grants/company:
    post:
      operationId: grantBillingCreditsToCompany
      summary: Grant billing credits to company
      tags:
      - credits
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCompanyCreditGrant'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/BillingCreditGrantResponseData'
                  params:
                    type: object
                    description: Input parameters
                    title: GrantBillingCreditsToCompanyParams
                required:
                - data
                - params
                title: GrantBillingCreditsToCompanyResponse
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
  /billing/credits/grants/company/count:
    get:
      operationId: countCompanyGrants
      summary: Count company grants
      tags:
      - credits
      parameters:
      - name: company_id
        in: query
        schema:
          type: string
      - name: order
        in: query
        schema:
          $ref: '#/components/schemas/CreditGrantSortOrder'
      - name: dir
        in: query
        schema:
          $ref: '#/components/schemas/SortDirection'
      - name: limit
        in: query
        description: Page limit (default 100)
        schema:
          type: integer
          description: Page limit (default 100)
          format: int64
          example: '100'
      - name: offset
        in: query
        description: Page offset (default 0)
        schema:
          type: integer
          description: Page offset (default 0)
          format: int64
          example: '0'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CountResponse'
                  params:
                    type: object
                    description: Input parameters
                    properties:
                      company_id:
                        type: string
                      dir:
                        $ref: '#/components/schemas/SortDirection'
                      limit:
                        type: integer
                        description: Page limit (default 100)
                        format: int64
                        example: '100'
                      offset:
                        type: integer
                        description: Page offset (default 0)
                        format: int64
                        example: '0'
                      order:
                        $ref: '#/components/schemas/CreditGrantSortOrder'
                    title: CountCompanyGrantsParams
                required:
                - data
                - params
                title: CountCompanyGrantsResponse
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
  /billing/credits/grants/company/list:
    get:
      operationId: listCompanyGrants
      summary: List company grants
      tags:
      - credits
      parameters:
      - name: company_id
        in: query
        schema:
          type: string
      - name: order
        in: query
        schema:
          $ref: '#/components/schemas/CreditGrantSortOrder'
      - name: dir
        in: query
        schema:
          $ref: '#/components/schemas/SortDirection'
      - name: limit
        in: query
        description: Page limit (default 100)
        schema:
          type: integer
          description: Page limit (default 100)
          format: int64
          example: '100'
      - name: offset
        in: query
        description: Page offset (default 0)
        schema:
          type: integer
          description: Page offset (default 0)
          format: int64
          example: '0'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/BillingCreditGrantResponseData'
                    title: ListCompanyGrantsResponseData
                    maxItems: 250
                  params:
                    type: object
                    description: Input parameters
                    properties:
                      company_id:
                        type: string
                      dir:
                        $ref: '#/components/schemas/SortDirection'
                      limit:
                        type: integer
                        description: Page limit (default 100)
                        format: int64
                        example: '100'
                      offset:
                        type: integer
                        description: Page offset (default 0)
                        format: int64
                        example: '0'
                      order:
                        $ref: '#/components/schemas/CreditGrantSortOrder'
                    title: ListCompanyGrantsParams
                required:
                - data
                - params
                title: ListCompanyGrantsResponse
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
  /billing/credits/grants/count:
    get:
      operationId: countBillingCreditsGrants
      summary: Count billing credits grants
      tags:
      - credits
      parameters:
      - name: credit_id
        in: query
        schema:
          type: string
      - name: ids
        in: query
        schema:
          type: array
          items:
            type: string
          maxItems: 100
      - name: limit
        in: query
        description: Page limit (default 100)
        schema:
          type: integer
          description: Page limit (default 100)
          format: int64
          example: '100'
      - name: offset
        in: query
        description: Page offset (default 0)
        schema:
          type: integer
          description: Page offset (default 0)
          format: int64
          example: '0'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CountResponse'
                  params:
                    type: object
                    description: Input parameters
                    properties:
                      credit_id:
                        type: string
                      ids:
                        type: array
                        items:
                          type: string
                        maxItems: 100
                      limit:
                        type: integer
                        description: Page limit (default 100)
                        format: int64
                        example: '100'
                      offset:
                        type: integer
                        description: Page offset (default 0)
                        format: int64
                        example: '0'
                    title: CountBillingCreditsGrantsParams
                required:
                - data
                - params
                title: CountBillingCreditsGrantsResponse
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
  /billing/credits/grants/list:
    get:
      operationId: l

# --- truncated at 32 KB (91 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/schematic/refs/heads/main/openapi/schematic-credits-api-openapi.yml