Using the REST API
Every endpoint follows the same conventions, so learning them once covers the whole surface. Per-endpoint request and response schemas are in the generated REST API reference, which has a separate page for each of the other services you call: Webhooks, Hardware keys, Stripe connector, Privacy and Users and organizations. This page is the contract around them.
URL structure and audiences
Section titled “URL structure and audiences”Routes are api/v1/provision/... and split by audience:
| Area | Audience | Credential |
|---|---|---|
admin/* |
Back-office: catalog authoring, entitlement management, reporting | Admin-scoped client credentials |
operational/* |
Your backend automating lifecycle operations — issue codes, renew, top up | Operational-scoped client credentials |
| unmarked | The runtime surface your shipped application calls, plus a few routes for your backend, such as the batch usage upload by entitlement | Anonymous (activation) or license session token; the backend routes take scoped client credentials |
The split is deliberate: runtime endpoints never require an API secret, so nothing secret ships inside your application.
The runtime surface
Section titled “The runtime surface”What a shipped application (or the .NET SDK on its behalf) calls:
Activation & sessions
POST /activations/jwt— activate, returns the license token only.POST /activations/license— activate, returns token plus metadata (the entitlement description and license terms link, the licensed products and their Public custom properties, feature names and descriptions).POST /activations/renew— renew the lease the way a check-in does and return the license with the new lease, without re-activating.POST /activations/borrow— borrow the seat of the session whose license token authenticates the call, so the device can work offline; returns the license with the borrowed lease.POST /activations/check-in//release— heartbeat, and seat release for floating and node-locked seats alike.
Session calls present the session’s license token, and act on the session it names: apart from the usage reads below, no session call takes a session id. A token the server no
longer accepts, because its signing key, audience or lifetime doesn’t
validate, is refused with 401 license.session_token_rejected. A session
that no longer exists, deleted or revoked, is refused with 409
license.no_active_session on every session call; a usage upload under it
is answered entitlementResolved: false and records nothing. Either way,
activate again. The .NET SDK does this once on its own.
Usage & metering
POST /usage/transactions— batch usage upload.POST /usage/metrics/{metric}/preview-consumeand/usage/metrics/{metric}/consume, each with the body{ "amount": 1 }— ask, then charge metered consumption where overuse must be blocked. Send anIdempotency-Keyheader with a consume, so a retry is charged once. The first changes nothing and reserves nothing; the second is the decision that binds. A metric the entitlement doesn’t track is refused with404license.metric_not_tracked, and a session that no longer exists is refused with409license.no_active_session; nothing is charged either way.GET /usage/sessions/{sessionId}/metrics/{metric}/usageand/consumption— current usage snapshot and remaining balance of one of the caller’s sessions;404license.metric_not_trackedfor a metric the entitlement doesn’t track,404for a session that isn’t the caller’s.GET /usage/rating-prompt— the next feature-rating prompt to show;204when there is nothing to ask,403(license.no_permission) when the subscription has no end-user ratings.
Signed-in user self-service (/consumer/me/..., user token)
GET /consumer/me/sessions— the user’s license sessions, including those you deactivated or blocked.POST /consumer/me/sessions/{sessionId}/release— frees the seat one of the user’s own devices holds. A session that isn’t the user’s is refused with404license.not_found; one you deactivated or blocked, one on a license with no lease time, or one that borrowed its seat and whose borrow has not ended, with400operation.invalid. A device that holds no seat is left as it is.GET /consumer/me/activation-codes— codes issued to the user.POST /consumer/me/activation-codes/redeem— adds the license a code was issued for to the user’s account and returns it. Nothing is activated: no seat and no device slot is taken, so the application can still activate with the same code. The code keeps its rules, and a refusal is the one an activation of the same code gets.GET /consumer/me/entitlements/{entitlementId}/plans— the plans behind a license, for in-app display (404for a license that isn’t the user’s). A license session reads its own withGET /consumer/me/session/plansand its license token.
Collections and paging
Section titled “Collections and paging”Every list endpoint pages with a cursor and returns the same envelope:
{ "items": [ … ], "nextPageToken": "MS4yMC45ZjJjMWE0ZDBiN2U2YzM1", "totalCount": null}Ask for the first page without a pageToken. To read the next page, send the
nextPageToken of the page you have as pageToken, with the same filter and
sortOrder. On the last page nextPageToken is null.
- The token is opaque. Pass it back unchanged; don’t build or decode one.
A token sent with a different
filterorsortOrder, a damaged token, or one from an older format returns400 request.page-token-invalid, or400 data.invalid_pageon the usage history lists (usage events, metrics, ratings and the audit log). Start the list again without a token. - You can change
pageSizebetween pages. The next page starts where the last one ended and holds the new number of items. - Read until
nextPageTokenisnull. A page can hold fewer items thanpageSizeand still have a next page, so a short page doesn’t mean the list has ended. totalCountisnullunless you sendincludeTotal=true. WithincludeTotal=true,totalCountis the number of items that match your filter. Ask for the total only when you show the number: counting costs the server a query on every page.pageSizedefaults to 20, with a maximum of 100. A larger value is clamped to 100 without an error,0gets the default, and a negative value becomes 1. The data-historian endpoints allow up to 1,000.
There are no page numbers, so a client that pages backwards keeps the tokens
it was given. The .NET SDK reads a whole list for you with PageFollower,
which follows nextPageToken until it is null.
filter and sortOrder take Sieve expressions:
filter—Field==Valuefor equality,Field@=textfor contains; comma-separate terms and they are ANDed (name@=acme,status==Active).sortOrder—Fieldascending,-Fielddescending, comma-separated (-createdAt,name).
Filterable and sortable fields are whitelisted per endpoint — see the
REST API reference. An expression that doesn’t parse or
names a non-whitelisted field returns 400 license.validation_error.
Updates: PATCH vs PUT
Section titled “Updates: PATCH vs PUT”PATCH <collection>/{id}is a merge: send only the fields you’re changing; absent ornullfields stay untouched. Where a field must be explicitly cleared, the DTO documents a sentinel (e.g.clearExpiresAt).PUTon a resource replaces its full editable representation — send everything.- A field the body does not have is refused with
400naming it, on the entitlementPATCHand the billingPUT; nothing is changed. Seats, lease and activation level are not on the entitlement body: set them withPOST .../policies/license-allocationandPOST .../policies/activation.providerCustomerReferenceis read-only; the billing provider’s subscription events write it. - Most toggles and anything needing a payload on delete are
POST .../{id}/<action>(e.g.enable-activations/disable-activations). A few actions and state changes, such as a balance withdrawal or a product’s status, arePUTroutes that take query parameters instead; the REST API reference shows which.
Success responses
Section titled “Success responses”A request that returns something answers 200 with it. An action on an entitlement
(publish, unpublish, enable or disable activations, revoke, reinstate, pause, resume, apply a plan, a
temporary override, add seats, renew, and set the trial, time-restricted, subscription, updates,
activation, anonymous-try or plan-change policy) answers 200 with the
entitlement it left, and a balance deposit or withdrawal with the balance, so you
don’t read the record again to see the new state. A request that changes something and
has nothing to return answers either 200 or 204 No Content with an empty body; the
REST API reference names which for each endpoint. Treat any
2xx as success.
A create answers 200 with the new record in Provision and Organization, and 201
with a Location header for a webhook subscription.
The license key is masked on a read. GET .../entitlements/{id} returns licenseKey as
four asterisks and its last 4 characters, unless the token holds provision.entitlement.update
or provision.activation.update. An answer to a write, such as the 201 of creating a license from
an offer, always carries the full key, so a token that can only create sees the key once.
Retries and idempotency
Section titled “Retries and idempotency”- Activation is retry-safe: re-activating with the same code and fingerprint returns the existing session, never a duplicate seat.
- Bulk entitlement actions are retry-safe:
POST admin/entitlements/bulk-actionsapplies one action (publish, unpublish, disable or enable activations, pause, resume, revoke or reinstate) to up to 100 entitlements and answers for each one:Applied,Unchanged,NotFoundorRefusedwith the reason. An entitlement the action already reached readsUnchanged, so repeating a request after a failure applies only what is missing. The request needs both theprovision.entitlement.updateand theprovision.activation.updatepermission. Idempotency-Keyheader — send one on the requests below if you might retry them. An operation that doesn’t accept a key refuses one with400(operation.idempotency-key-unsupported) and nothing runs, so a key is never ignored in silence. On the activation endpoints the key is durable: it persists on the session, a replay of an identical request returns the same session, and reusing the key with different parameters is rejected with409. On every createPOST(entitlements and offers, activation codes, products, features, plans, add-ons, suites, campaigns, tags, devices, organizations and their members, users, webhook subscriptions, connectors and data subject requests), the operational balance mutations, seat additions, subscription renewals, the batch usage upload by entitlement and the consumer credit grant, the key (up to 200 characters) is honored for 24 hours. A retry of the same request returns the original response. Reusing the key with a different body is refused with422(operation.idempotency-key-reused), and nothing runs. The creates that take no key are the ones a repeat can’t duplicate: linking an existing record to another one, and creating a tenant, environment or account, whose identifier is unique so that a repeat is refused as a duplicate.- Rate limits. A
429carriesRetry-AfterandX-RateLimit-Reset, both the whole number of seconds to wait from now.X-RateLimit-Resetis not a timestamp: GitHub’s header of the same name holds an epoch time, so a client written for that one must read this one as a delay.X-RateLimit-LimitandX-RateLimit-Remainingcome with it when the limiter supplies them, andX-RateLimit-Scopenames the limiter that refused. - Usage transactions carry their own ids and timestamps; upload batches can be retried after a network failure, under the same session or another session of the same license. A record already uploaded is acknowledged and not counted again. A record captured more than 90 days before it is uploaded is acknowledged but not counted.
- Metered consumption (
consume) accepts anidempotencyKeyquery parameter — a retried consume with the same key returns the original decision instead of consuming twice. A key is remembered for 24 hours. Once it is older than that, it is forgotten within the hour, and a consume that sends it again counts as a new consume. - Pass
X-Correlation-Idon any request to correlate it across your logs and Oclavex’s — echo one id through a whole business operation. - When consuming webhooks, dedupe on the
webhook-idheader — delivery is at-least-once.
Name your application in the User-Agent header
Section titled “Name your application in the User-Agent header”Send a User-Agent header with every call that names your application, such as
User-Agent: AcmeEditor/2.4. Some HTTP libraries send a default User-Agent that the
tenant host’s firewall may refuse before the request reaches the API. Python’s urllib
is one: the client then gets 403 with an HTML page instead of a problem details body.
Errors
Section titled “Errors”Failures return application/problem+json with a stable numeric code and
dotted codeName. A request body the server can’t read gets the framework’s
validation response instead, without a code.
{ "status": 404, "title": "Resource not found", "detail": "This activation code is not valid, or it was removed. Check the code or ask your software provider for a new one.", "code": 2004, "codeName": "license.not_found"}The title is the same for every occurrence of a code; what went wrong this time is in detail.
A request body the server can’t read answers errors with one message per field, keyed by the
field’s JSON name. A filter value cannot contain < or >: they are comparison operators, so the
filter is refused.
Branch on code or codeName — never on detail, which is human-facing prose
and may change. The full catalog is in
Error codes.