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

# Create License

> Create a new license with the specified configuration.
The license will be automatically generated with a unique key.




## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/dev/teams/{teamId}/licenses
openapi: 3.0.1
info:
  title: Lukittu API
  description: >
    The Lukittu API provides comprehensive license management and verification
    services for software products.


    ## Authentication


    **Client Endpoints** (`/api/v1/client/*`): No authentication required. These
    are public endpoints for license verification.


    **Developer Endpoints** (`/api/v1/dev/*`): Require API key authentication
    via Bearer token.


    ## API Types


    - **Client API**: Used by your software to verify licenses, send heartbeats,
    and download releases

    - **Developer API**: Used for programmatic license management from your
    backend systems


    ## Rate Limiting


    All endpoints are rate-limited to prevent abuse. If you exceed the rate
    limit, you'll receive a 429 status code.


    ## Response Format


    All responses follow a consistent format with `data` and `result` objects:


    ```json

    {
      "data": {}, // Response data (null for errors)
      "result": {
        "timestamp": "2023-09-15T14:30:00Z",
        "valid": true,
        "details": "Human-readable message",
        "code": "SUCCESS_CODE" // Optional error/success code
      }
    }

    ```
  version: 1.0.0
  contact:
    name: Lukittu Community
    url: https://discord.lukittu.com
servers:
  - url: https://app.lukittu.com
    description: Production server
security: []
tags:
  - name: Client - Verify
    description: >
      Client endpoints for license verification, heartbeat monitoring, and file
      downloads.

      These endpoints are used directly by your software applications.
  - name: Dev - Licenses
    description: |
      Developer endpoints for license management operations.
      These endpoints require API key authentication.
  - name: Dev - Customers
    description: |
      Developer endpoints for customer management operations.
      These endpoints require API key authentication.
  - name: Dev - Releases
    description: |
      Developer endpoints for release management operations.
      These endpoints require API key authentication.
  - name: Dev - Statistics
    description: |
      Developer endpoints for retrieving team usage statistics.
      These endpoints require API key authentication.
paths:
  /api/v1/dev/teams/{teamId}/licenses:
    post:
      tags:
        - Dev - Licenses
      summary: Create License
      description: |
        Create a new license with the specified configuration.
        The license will be automatically generated with a unique key.
      operationId: createLicense
      parameters:
        - $ref: '#/components/parameters/TeamId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLicenseRequest'
      responses:
        '200':
          description: License created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseResponse'
        4XX:
          $ref: '#/components/responses/StandardError'
        5XX:
          $ref: '#/components/responses/StandardError'
      security:
        - bearerAuth: []
components:
  parameters:
    TeamId:
      name: teamId
      in: path
      required: true
      description: >-
        Your team's UUID. You can find this value in your team's settings on the
        Lukittu dashboard.
      schema:
        $ref: '#/components/schemas/UUID'
      example: 123e4567-e89b-12d3-a456-426614174000
  schemas:
    CreateLicenseRequest:
      type: object
      properties:
        customerIds:
          type: array
          items:
            $ref: '#/components/schemas/UUID'
          description: Customer UUIDs to associate with this license
        productIds:
          type: array
          items:
            $ref: '#/components/schemas/UUID'
          description: Product UUIDs to associate with this license
        expirationType:
          $ref: '#/components/schemas/ExpirationType'
        expirationStart:
          $ref: '#/components/schemas/ExpirationStart'
          nullable: true
        expirationDate:
          type: string
          format: date-time
          nullable: true
          description: Required when expirationType is DATE
        expirationDays:
          type: integer
          minimum: 1
          nullable: true
          description: Required when expirationType is DURATION
        ipLimit:
          type: integer
          minimum: 0
          nullable: true
        hwidLimit:
          type: integer
          minimum: 1
          nullable: true
        suspended:
          type: boolean
          description: Whether to create the license in suspended state
        sendEmailDelivery:
          type: boolean
          description: Whether to send license details via email
        metadata:
          $ref: '#/components/schemas/Metadata'
      required:
        - expirationType
        - suspended
        - sendEmailDelivery
        - productIds
        - customerIds
        - metadata
    LicenseResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessResponse'
        - type: object
          properties:
            data:
              allOf:
                - $ref: '#/components/schemas/LicenseData'
                - type: object
                  properties:
                    customers:
                      type: array
                      items:
                        $ref: '#/components/schemas/CustomerData'
                      description: Customers associated with this license
                    products:
                      type: array
                      items:
                        $ref: '#/components/schemas/ProductData'
                      description: Products associated with this license
    UUID:
      type: string
      format: uuid
      description: UUID v4 identifier
    ExpirationType:
      type: string
      enum:
        - NEVER
        - DATE
        - DURATION
      description: Defines how license expiration is calculated
    ExpirationStart:
      type: string
      enum:
        - CREATION
        - ACTIVATION
      description: Defines when the license expiration countdown begins
    Metadata:
      type: array
      description: Key-value metadata pairs
      items:
        type: object
        properties:
          key:
            type: string
            description: Metadata key
          value:
            type: string
            description: Metadata value
          locked:
            type: boolean
            description: Whether this metadata field is locked from client modification
        required:
          - key
          - value
          - locked
    SuccessResponse:
      type: object
      properties:
        data:
          type: object
          description: Response data
        result:
          allOf:
            - $ref: '#/components/schemas/StandardResult'
            - type: object
              properties:
                valid:
                  type: boolean
                  enum:
                    - true
                  description: Always true for success responses
      required:
        - data
        - result
    LicenseData:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/UUID'
          description: Unique license identifier
        licenseKey:
          $ref: '#/components/schemas/LicenseKey'
        ipLimit:
          type: integer
          nullable: true
          minimum: 0
          description: Maximum number of different IP addresses that can use this license
        hwidLimit:
          type: integer
          nullable: true
          minimum: 1
          description: Maximum number of different hardware IDs that can use this license
        expirationType:
          $ref: '#/components/schemas/ExpirationType'
        expirationStart:
          $ref: '#/components/schemas/ExpirationStart'
        expirationDate:
          type: string
          format: date-time
          nullable: true
          description: Specific expiration date (when expirationType is DATE)
        expirationDays:
          type: integer
          nullable: true
          minimum: 1
          description: Number of days until expiration (when expirationType is DURATION)
        suspended:
          type: boolean
          description: Whether the license is suspended
        metadata:
          $ref: '#/components/schemas/Metadata'
        teamId:
          $ref: '#/components/schemas/UUID'
          description: Team that owns this license
        createdByUserId:
          $ref: '#/components/schemas/UUID'
          description: User who created this license
        createdAt:
          type: string
          format: date-time
          description: License creation timestamp
        updatedAt:
          type: string
          format: date-time
          description: License last update timestamp
        lastActiveAt:
          type: string
          format: date-time
          nullable: true
          description: Last activity timestamp for this license
      required:
        - id
        - licenseKey
        - expirationType
        - suspended
        - teamId
        - createdByUserId
        - createdAt
        - updatedAt
    CustomerData:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/UUID'
          description: Unique customer identifier
        email:
          type: string
          format: email
          nullable: true
          description: Customer email address
        fullName:
          type: string
          nullable: true
          description: Customer full name
        username:
          type: string
          nullable: true
          description: Customer username
        metadata:
          $ref: '#/components/schemas/Metadata'
        address:
          $ref: '#/components/schemas/Address'
          nullable: true
          description: Customer address information
        discordAccount:
          $ref: '#/components/schemas/DiscordAccount'
          nullable: true
          description: Associated Discord account information
        teamId:
          $ref: '#/components/schemas/UUID'
          description: Team that owns this customer
        createdByUserId:
          $ref: '#/components/schemas/UUID'
          description: User who created this customer record
        createdAt:
          type: string
          format: date-time
          description: Customer record creation timestamp
        updatedAt:
          type: string
          format: date-time
          description: Customer record last update timestamp
      required:
        - id
        - teamId
        - createdByUserId
        - createdAt
        - updatedAt
    ProductData:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/UUID'
          description: Unique product identifier
        name:
          type: string
          description: Product name
        url:
          type: string
          nullable: true
          description: Product URL or homepage
        metadata:
          $ref: '#/components/schemas/Metadata'
        teamId:
          $ref: '#/components/schemas/UUID'
          description: Team that owns this product
        createdByUserId:
          $ref: '#/components/schemas/UUID'
          description: User who created this product
        createdAt:
          type: string
          format: date-time
          description: Product creation timestamp
        updatedAt:
          type: string
          format: date-time
          description: Product last update timestamp
      required:
        - id
        - name
        - teamId
        - createdByUserId
        - createdAt
        - updatedAt
    ErrorResponse:
      type: object
      properties:
        data:
          type: object
          description: Additional error-related data
          nullable: true
        result:
          allOf:
            - $ref: '#/components/schemas/StandardResult'
            - type: object
              properties:
                valid:
                  type: boolean
                  enum:
                    - false
                  description: Always false for error responses
                code:
                  type: string
                  description: Error code indicating the specific issue
                  enum:
                    - INTERNAL_SERVER_ERROR
                    - BAD_REQUEST
                    - LICENSE_NOT_FOUND
                    - IP_LIMIT_REACHED
                    - HWID_LIMIT_REACHED
                    - PRODUCT_NOT_FOUND
                    - CUSTOMER_NOT_FOUND
                    - LICENSE_EXPIRED
                    - LICENSE_SUSPENDED
                    - TEAM_NOT_FOUND
                    - RATE_LIMIT
                    - HARDWARE_IDENTIFIER_BLACKLISTED
                    - COUNTRY_BLACKLISTED
                    - IP_BLACKLISTED
                    - RELEASE_NOT_FOUND
                    - FORBIDDEN
                    - UNAUTHORIZED
                    - INVALID_SESSION_KEY
                    - NO_ACCESS_TO_RELEASE
                    - RELEASE_ARCHIVED
                    - RELEASE_DRAFT
              required:
                - code
      required:
        - result
    StandardResult:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
          description: Timestamp when the response was generated
        valid:
          type: boolean
          description: Indicates whether the operation was successful
        details:
          type: string
          description: Human-readable description of the result
      required:
        - timestamp
        - valid
        - details
    LicenseKey:
      type: string
      pattern: ^[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}$
      description: >-
        Lukittu license key format: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX where X is an
        uppercase letter (A-Z) or digit (0-9)
    Address:
      type: object
      properties:
        street:
          type: string
          nullable: true
          description: Street address
        city:
          type: string
          nullable: true
          description: City
        state:
          type: string
          nullable: true
          description: State or province
        country:
          type: string
          nullable: true
          description: Country
        postalCode:
          type: string
          nullable: true
          description: Postal or ZIP code
    DiscordAccount:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/UUID'
          description: Discord account record ID
        customerId:
          $ref: '#/components/schemas/UUID'
          description: Associated customer ID
        discordId:
          type: string
          pattern: ^\d{17,19}$
          description: Discord user ID (snowflake)
        username:
          type: string
          description: Discord username
        avatar:
          type: string
          nullable: true
          description: Discord avatar hash (null if no custom avatar)
        createdAt:
          type: string
          format: date-time
          description: Discord account record creation timestamp
        updatedAt:
          type: string
          format: date-time
          description: Discord account record last update timestamp
      required:
        - id
        - customerId
        - discordId
        - username
        - createdAt
        - updatedAt
  responses:
    StandardError:
      description: >
        Standard API error response. All errors follow the same `{data, result}`
        structure.

        The HTTP status code indicates the general error category, while
        `result.code` provides specific error details.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: apiKey
      description: >
        API key authentication for development endpoints.


        You can create API keys in your team's settings on the Lukittu
        dashboard.

        Include the API key in the Authorization header as: `Bearer
        YOUR_API_KEY`


        Example:

        ```

        Authorization: Bearer lukittu_api_key_abc123def456...

        ```

````