Managing licenses via the API

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 Authorization header 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

  1. Find the license by user email: GET /api/v2/licenses?email=user@example.com
  2. Update the status: PUT /api/v2/licenses/{license_id}/status with {"approval_status": "Approved"}

Add a collection to an existing license

  1. Get the current license: GET /api/v2/licenses/{license_id}
  2. Extract the current publisher_collections array
  3. Add the new collection ID to the array
  4. Update collections: PUT /api/v2/licenses/{license_id}/collections with {"collection_ids": [...]}. This replaces the license's collections, so send the complete list.

Supercharge your API usage

  1. 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.