You can manage licenses programmatically via the Cashmere API, enabling you to retrieve, search, and update licenses for your collections.
All license API endpoints require Bearer token authentication. Include your API key in the
Authorizationheader of each request. You can receive yours in the Console
Overview
The License API allows publishers to:
- Grant licenses to a user or organization
- Retrieve specific licenses by ID
- Search for licenses by user email
- Update license approval status
- Manage which collections are included in a license
Important: You can only view and manage licenses that contain collections you own. Changing a license needs a Read & Write key.
API Reference
The license endpoints are under /api/v2/licenses. See the Licenses section of the API reference for every field.
Common Workflows
Grant a license
POST /api/v2/licenses with collection_ids and either target_email (for a person's personal organization) or target_organization_handle. The response lists the new license_ids. GET /api/v2/licenses/rights lists the license rights you can grant.
Approve a pending license request
- Find the license by user email:
GET /api/v2/licenses?email=user@example.com - Update the status:
PUT /api/v2/licenses/{license_id}/statuswith{"approval_status": "Approved"}
Add a collection to an existing license
- Get the current license:
GET /api/v2/licenses/{license_id} - Extract the current
publisher_collectionsarray - Add the new collection ID to the array
- Update collections:
PUT /api/v2/licenses/{license_id}/collectionswith{"collection_ids": [...]}. This replaces the license's collections, so send the complete list.
Supercharge your API usage
- Turn usage data into automated invoices - Pull each month's usage for your content from
GET /api/v2/report?view=publisher(see Usage Data via API), total the billed amounts per licensee, and feed the results into Stripe or your billing system. This makes usage-based billing automatic instead of a manual copy-paste job.