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

# Validates a license key or instance

> Verify if a license key is valid and active for a specific instance. Check activation status and expiration.



## OpenAPI

````yaml post /v1/licenses/validate
openapi: 3.0.0
info:
  title: Creem API
  description: >-
    Creem is an all-in-one platform for managing subscriptions and recurring
    revenue, tailored specifically for today's SaaS companies. It enables you to
    boost revenue, enhance customer retention, and scale your operations
    seamlessly.
  version: v1
  contact:
    name: Creem Support
    url: https://creem.io
    email: support@creem.io
  license:
    name: Commercial
    url: https://creem.io/terms
  termsOfService: https://creem.io/terms
servers:
  - url: https://api.creem.io
  - url: https://test-api.creem.io
security: []
tags: []
externalDocs:
  description: Creem Documentation
  url: https://docs.creem.io
paths:
  /v1/licenses/validate:
    post:
      tags:
        - Licenses
      summary: Validates a license key or instance.
      description: >-
        Verify if a license key is valid and active for a specific instance.
        Check activation status and expiration.
      operationId: validateLicense
      parameters: []
      requestBody:
        required: true
        description: License validation request payload
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ValidateLicenseRequestEntity'
      responses:
        '200':
          description: Successfully validated a license key instance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseEntity'
        '400':
          description: Bad Request - Invalid input parameters
        '401':
          description: Unauthorized - Invalid or missing API key
        '404':
          description: Not Found - Resource does not exist
      security:
        - ApiKey: []
components:
  schemas:
    ValidateLicenseRequestEntity:
      type: object
      properties:
        key:
          type: string
          description: The license key to validate.
        instance_id:
          type: string
          description: Id of the instance to validate.
      required:
        - key
        - instance_id
    LicenseEntity:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the object.
        mode:
          $ref: '#/components/schemas/EnvironmentMode'
        object:
          type: string
          description: >-
            A string representing the object's type. Objects of the same type
            share the same value.
        product_id:
          type: string
          description: The ID of the product this license belongs to.
          example: prod_abc123
        status:
          $ref: '#/components/schemas/LicenseStatus'
          example: active
        key:
          type: string
          description: The license key.
          example: ABC123-XYZ456-XYZ456-XYZ456
        activation:
          type: number
          description: The number of instances that this license key was activated.
          example: 5
        activation_limit:
          type: number
          description: The activation limit. Null if activations are unlimited.
          example: 1
          nullable: true
        expires_at:
          type: string
          description: >-
            The date the license key expires. Null if it does not have an
            expiration date.
          example: '2023-09-13T00:00:00Z'
          format: date-time
          nullable: true
        created_at:
          format: date-time
          type: string
          description: The creation date of the license key.
          example: '2023-09-13T00:00:00Z'
        instance:
          description: Associated license instances.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/LicenseInstanceEntity'
      required:
        - id
        - mode
        - object
        - product_id
        - status
        - key
        - activation
        - created_at
    EnvironmentMode:
      type: string
      description: String representing the environment.
      enum:
        - test
        - prod
        - sandbox
    LicenseStatus:
      type: string
      description: The current status of the license key.
      enum:
        - inactive
        - active
        - expired
        - disabled
    LicenseInstanceEntity:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the object.
        mode:
          $ref: '#/components/schemas/EnvironmentMode'
        object:
          type: string
          description: >-
            A string representing the object’s type. Objects of the same type
            share the same value.
          example: license-instance
        name:
          type: string
          description: The name of the license instance.
          example: My Customer License Instance
        status:
          type: string
          description: The status of the license instance.
          enum:
            - active
            - deactivated
          example: active
        created_at:
          format: date-time
          type: string
          description: The creation date of the license instance.
          example: '2023-09-13T00:00:00Z'
      required:
        - id
        - mode
        - object
        - name
        - status
        - created_at
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. You can find your API key in the Creem
        dashboard under Settings > API Keys.

````