Skip to main content
POST
/
v1
/
subscriptions
/
entitlements
JavaScript
import Hercules from '@usehercules/sdk';

const client = new Hercules({
  apiVersion: '2025-12-09',
  apiKey: process.env['HERCULES_API_KEY'], // This is the default and can be omitted
});

const entitlement = await client.beta.subscriptions.entitlements.create({ key: 'key', name: 'name' });

console.log(entitlement.id);
{
  "id": "<string>",
  "name": "<string>",
  "key": "<string>",
  "active": true,
  "livemode": true
}

Authorizations

Authorization
string
header
required

API key authentication. Include your API key in the Authorization header as: Bearer

Body

application/json

Request to create a new entitlement. After creating, attach it to plans to grant access to subscribed customers.

name
string
required

Display name for the entitlement (e.g., API Access, Premium Support)

key
string
required

Unique key to identify the entitlement when checking access. Use a descriptive, stable key (e.g., api_access, premium_support).

Response

201 - application/json

The created entitlement object

The entitlement attached to the plan

id
string
required

Unique identifier for the entitlement

name
string
required

Display name for the entitlement (e.g., API Access, Premium Support)

key
string
required

Unique key to identify the entitlement when checking access in your app

active
boolean
required

Whether the entitlement is active and can be attached to plans

livemode
boolean
required

Whether this is a live mode entitlement (vs test mode)