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

# Release Resource

> Release claimed resources for a subscription. Exactly one of quantity, externalId, externalIds, or claimIds must be provided.



## OpenAPI

````yaml https://app.flowglad.com/api/openapi post /api/v1/resource-claims/{subscriptionId}/release
openapi: 3.1.0
info:
  title: Flowglad API
  version: 0.0.1
servers:
  - url: https://app.flowglad.com
security: []
externalDocs:
  url: https://docs.flowglad.com
paths:
  /api/v1/resource-claims/{subscriptionId}/release:
    post:
      tags:
        - Resource Claims
      summary: Release Resource
      description: >-
        Release claimed resources for a subscription. Exactly one of quantity,
        externalId, externalIds, or claimIds must be provided.
      operationId: resourceClaims-release
      parameters:
        - in: path
          name: subscriptionId
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                resourceSlug:
                  description: The slug of the resource to release
                  type: string
                quantity:
                  description: >-
                    Release N anonymous claims (FIFO order). Only releases
                    claims without external identifiers.
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
                externalId:
                  description: Release a specific named claim by its external identifier.
                  type: string
                  maxLength: 255
                externalIds:
                  description: Release multiple named claims by their external identifiers.
                  minItems: 1
                  type: array
                  items:
                    type: string
                    maxLength: 255
                claimIds:
                  description: >-
                    Release specific claims by their claim IDs (works for both
                    anonymous and named claims).
                  minItems: 1
                  type: array
                  items:
                    type: string
              required:
                - resourceSlug
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  releasedClaims:
                    type: array
                    items:
                      $ref: '#/components/schemas/ResourceClaimClientSelectSchema'
                  usage:
                    type: object
                    properties:
                      resourceSlug:
                        type: string
                      resourceId:
                        type: string
                      capacity:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      claimed:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      available:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                    required:
                      - resourceSlug
                      - resourceId
                      - capacity
                      - claimed
                      - available
                    additionalProperties: false
                required:
                  - releasedClaims
                  - usage
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ResourceClaimClientSelectSchema:
      type: object
      properties:
        id:
          type: string
        createdAt:
          description: Epoch milliseconds.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        updatedAt:
          description: Epoch milliseconds.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        livemode:
          type: boolean
        organizationId:
          type: string
        resourceId:
          type: string
        subscriptionId:
          type: string
        pricingModelId:
          type: string
        externalId:
          anyOf:
            - type: string
            - type: 'null'
        claimedAt:
          description: Epoch milliseconds.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        releasedAt:
          anyOf:
            - description: Epoch milliseconds.
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        releaseReason:
          anyOf:
            - type: string
            - type: 'null'
        expiredAt:
          anyOf:
            - description: Epoch milliseconds.
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        metadata:
          anyOf:
            - $ref: '#/components/schemas/Metadata'
            - type: 'null'
      required:
        - id
        - createdAt
        - updatedAt
        - livemode
        - organizationId
        - resourceId
        - subscriptionId
        - pricingModelId
        - externalId
        - claimedAt
        - releaseReason
      additionalProperties: false
    error.BAD_REQUEST:
      title: Invalid input data error (400)
      description: The error information
      example:
        code: BAD_REQUEST
        message: Invalid input data
        issues: []
      type: object
      properties:
        message:
          description: The error message
          example: Invalid input data
          type: string
        code:
          description: The error code
          example: BAD_REQUEST
          type: string
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
    error.UNAUTHORIZED:
      title: Authorization not provided error (401)
      description: The error information
      example:
        code: UNAUTHORIZED
        message: Authorization not provided
        issues: []
      type: object
      properties:
        message:
          description: The error message
          example: Authorization not provided
          type: string
        code:
          description: The error code
          example: UNAUTHORIZED
          type: string
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
    error.FORBIDDEN:
      title: Insufficient access error (403)
      description: The error information
      example:
        code: FORBIDDEN
        message: Insufficient access
        issues: []
      type: object
      properties:
        message:
          description: The error message
          example: Insufficient access
          type: string
        code:
          description: The error code
          example: FORBIDDEN
          type: string
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
    error.INTERNAL_SERVER_ERROR:
      title: Internal server error error (500)
      description: The error information
      example:
        code: INTERNAL_SERVER_ERROR
        message: Internal server error
        issues: []
      type: object
      properties:
        message:
          description: The error message
          example: Internal server error
          type: string
        code:
          description: The error code
          example: INTERNAL_SERVER_ERROR
          type: string
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
    Metadata:
      description: JSON object
      type: object
      propertyNames:
        type: string
      additionalProperties:
        anyOf:
          - type: string
            maxLength: 500
          - type: number
          - type: boolean
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````