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

# Attach an entitlement to a plan

> Links an entitlement definition to a plan with optional limits.



## OpenAPI

````yaml post /v1/plan-entitlements/{planId}
openapi: 3.0.0
info:
  title: Revstack API
  version: 1.0.0
  description: >-
    Open Source Billing OS for Developers. The scalable, developer-first billing
    engine with subscriptions, invoicing, usage metering, and entitlements.
servers:
  - url: http://localhost:6900
    description: Revstack API (Local Development)
security: []
paths:
  /v1/plan-entitlements/{planId}:
    post:
      tags:
        - Plan Entitlements
      summary: Attach an entitlement to a plan
      description: Links an entitlement definition to a plan with optional limits.
      parameters:
        - schema:
            type: string
            example: plan_abc123
          required: true
          name: planId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                entitlementId:
                  type: string
                  minLength: 1
                limit:
                  type: integer
                  minimum: 0
              required:
                - entitlementId
      responses:
        '201':
          description: Plan entitlement created
          content:
            application/json:
              schema:
                nullable: true
        '400':
          description: Validation error

````