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

# Create a subscription entitlement

> Creates a new entitlement for a subscription



## OpenAPI

````yaml specs/entitlements_api_docs.json post /api/v1/sub-entitlement
openapi: 3.1.0
info:
  title: Entitlement API
  version: 1.0.0
  description: API for managing entitlements and plan entitlement quotas.
servers:
  - url: https://dev-entitlements-api.iqraa.ai/api/v1
    description: Production server
security: []
tags: []
paths:
  /api/v1/sub-entitlement:
    post:
      tags:
        - Subscription Entitlements
      summary: Create a subscription entitlement
      description: Creates a new entitlement for a subscription
      operationId: SubEntitlementController_createSubscriptionEntitlement
      parameters:
        - name: x-admin-api-key
          in: header
          description: The API key to access the admin API
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSubEntitlementDto'
      responses:
        '201':
          description: Subscription entitlement created successfully
        '400':
          description: Bad Request - Invalid input data
        '401':
          description: Unauthorized - Missing or invalid admin API key
        '404':
          description: Not Found - Plan or entitlement not found
        '409':
          description: Conflict - Entitlement already exists
components:
  schemas:
    CreateSubEntitlementDto:
      type: object
      properties:
        subscriptionId:
          type: string
          description: The ID of the subscription
          example: 123e4567-e89b-12d3-a456-426614174000
        planId:
          type: string
          description: The ID of the plan
          example: 123e4567-e89b-12d3-a456-426614174001
        entitlementCode:
          type: string
          description: The code of the entitlement
          example: storage_quota
        quota:
          type: number
          description: The quota value (-1 for unlimited)
          example: 1000
      required:
        - subscriptionId
        - planId
        - entitlementCode
        - quota

````