Generate activation code batch
const url = 'https://example.com/api/v1/provision/admin/entitlements/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/activation-codes/batch/generate';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"count":1,"policyOverride":{"enabled":true,"template":"example","alphabet":"CrockfordBase32","customAlphabet":"example","caseStyle":"Upper","checksum":"None","sequenceScope":"Entitlement","sequenceStart":1,"collisionRetryLimit":1,"normalizeStripSeparators":true,"normalizeCaseInsensitive":true,"normalizeMapConfusables":true,"sequenceCurrent":1},"workflowDefaults":{"requiredAuthenticationLevel":"Default","fingerprint":"example","maxDeviceActivations":1,"useEntitlementMaxActivations":true,"activationCode":"example","email":"example","sendUserNotification":true,"organizationGroupId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","requiredUserId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","expiresAt":"2026-04-15T12:00:00Z"},"batchLabel":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/provision/admin/entitlements/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/activation-codes/batch/generate \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "count": 1, "policyOverride": { "enabled": true, "template": "example", "alphabet": "CrockfordBase32", "customAlphabet": "example", "caseStyle": "Upper", "checksum": "None", "sequenceScope": "Entitlement", "sequenceStart": 1, "collisionRetryLimit": 1, "normalizeStripSeparators": true, "normalizeCaseInsensitive": true, "normalizeMapConfusables": true, "sequenceCurrent": 1 }, "workflowDefaults": { "requiredAuthenticationLevel": "Default", "fingerprint": "example", "maxDeviceActivations": 1, "useEntitlementMaxActivations": true, "activationCode": "example", "email": "example", "sendUserNotification": true, "organizationGroupId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "requiredUserId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "expiresAt": "2026-04-15T12:00:00Z" }, "batchLabel": "example" }'Starts minting a batch of activation codes from the entitlement’s key-issuance policy, as a background
operation: a batch of thousands takes longer than a request should wait. Read the operation at the
Location until it succeeds; it then holds the codes and the batch they are tagged with. Send an
Idempotency-Key, and a retry answers with the same operation instead of making a second batch.
A batch always renders from a template, so a policy override with enabled set to false is refused
with 400 instead of falling back to the platform default random code.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Target entitlement.
Header Parameters
Section titled “Header Parameters”An id of your own for the call. The answer returns it in the same header, and the server log carries it; when you send none, the server makes one.
A key of your own that makes a retry safe: a call repeated with the same key and the same body answers the first call’s result instead of running again. Send one key per call, and reuse it only to retry that call.
Request Bodyrequired
Section titled “Request Bodyrequired”How many codes to cut (1 to 5000), an optional policy override (its enabled must be true), and the limits copied onto each one.
Admin request to mint a batch of activation codes on an entitlement. Each code becomes an ordinary activation workflow, so a pre-registered code is redeemed through the normal activation pipeline.
object
How many codes to mint.
Shape to render the codes from; when null the entitlement’s key-issuance policy applies.
object
When false the platform default random code is issued and Template is ignored.
Template the code is rendered from, e.g. ACME-{DATE:yyMM}-{SEQ:6}-{RAND:4}{CHK}.
Character set {RAND} draws from.
Characters {RAND} draws from when Alphabet is KeyAlphabet.Custom.
Casing applied to the rendered code.
Check-character algorithm used by the {CHK} token.
Counter the {SEQ} token draws from.
First value the counter issues.
How many times generation re-rolls the random segment after a uniqueness collision before the
item fails. Templates whose only variable part is {SEQ} have nothing to re-roll, so they
depend on the counter only ever moving forward.
Ignore separators (spaces and dashes) in a submitted code before lookup.
Match a submitted code without regard to case.
Fold characters the alphabet excludes onto the ones it keeps before lookup, so a user who types O for 0 or I for 1 still resolves. Only defined for alphabets that omit the confusable pair.
Value the counter will issue next. Populated when one entitlement is read by id (a list page leaves it null); ignored on writes. A snapshot taken while other requests may be reserving blocks, so treat it as advisory rather than a count.
Limits and restrictions copied onto every workflow in the batch (device caps, expiration,
authentication level). ActivationCode on the defaults is ignored — the codes come from
the policy.
object
Authentication level a user must meet before a license activation is permitted. Used on activation policies and activation workflows.
Whether the “Activation code ready” mail is sent to Email when the workflow is
created. False sends nothing. When null the route’s default applies: the single-workflow
route sends the mail (true), the batch import and generate routes do not (false).
Vendor’s own label for the batch, e.g. a campaign or reseller order it was cut for.
Responses
Section titled “Responses”The operation that makes the batch.
An admin action that runs in the background on the server, such as a large batch of activation codes or an offer push. The request that starts it answers 202 Accepted with this resource; read it again until Status is OperationStatus.Succeeded or OperationStatus.Failed.
object
The operation’s identifier.
What the operation does.
Where the operation is.
How many items the operation has done so far.
How many items the operation does in all; null until the operation knows.
When the operation was started.
When the server began to run the operation; null while it waits.
When the operation succeeded or failed; null while it runs.
The batch the operation made, once an OperationKind.ActivationCodeBatch operation succeeded.
object
Identifier the created workflows are tagged with, for later filtering and export.
Label echoed from the request.
Codes asked for.
Codes actually created.
The issued codes, in generation order. Large batches may return this empty and expose the codes through the batch export endpoint instead; read CreatedCount for the tally.
Items that could not be minted, e.g. after exhausting the collision retry limit.
Why one item of a batch was rejected.
object
Zero-based position of the item in the submitted list.
The offending code, when reporting it is meaningful.
Human-readable explanation, e.g. a duplicate or a policy mismatch.
What the push changed, once an OperationKind.OfferPush operation succeeded.
object
True when nothing was changed and the counts say what the push would do.
The offer’s plan the push sets; null when the offer has none, and plans are left as they are.
The add-ons the offer gives, which the push grants where they are missing.
The promotion the push gives: the offer’s, when the push includes it and it is running. Null otherwise, and promotions are left as they are.
object
The campaign it runs under; each entitlement given it counts as a plan-override touch of the campaign.
Recorded as the reason of each temporary override it becomes.
The entitlements made from the offer, try licenses left out.
Entitlements the push changed, or would change.
Entitlements that already hold what the offer gives.
Deviating entitlements left as they are: not included, or held by a running temporary override other than this offer’s promotion, which a push never ends.
Entitlements the push could not change, or would not be able to; Failed says why.
Every entitlement that deviates from the offer, with why, whether it was skipped or included.
One entitlement made from an offer (its OriginOfferId), and whether it deviates from what the offer gave it: a change made to this customer since, which wins over the offer.
object
Admin-controlled lifecycle state of an entitlement.
True when at least one facet deviates; Deviations says which and why.
Each facet whose current value differs from what the offer gave the entitlement, with the reason.
A facet of an entitlement whose current value differs from what its offer gave it.
object
A part of an entitlement that an offer gives it and that can later be changed for that customer alone.
What changed and, where it is recorded, what changed it; for example an approved plan-change request.
The entitlements the push could not change, each with the reason. The others are changed all the same.
An entitlement a push could not change, and why.
object
Example
{ "kind": "ActivationCodeBatch", "status": "Queued", "offerPush": { "deviating": [ { "status": "Draft", "deviations": [ { "facet": "Plan" } ] } ] }}Headers
Section titled “Headers”The correlation id of the call: the one you sent, or the one the server made.
A count outside 1 to 5000, no usable key-issuance policy, or limits a code may not carry.
The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.
object
A reference to the code’s entry on the error-codes page.
A short summary of the problem.
The HTTP status of the answer.
What went wrong in this call, in a sentence.
The path of the call.
The stable numeric error code. The error-codes page lists them.
The stable name of the error code, for example resource.not_found.
The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.
The scope or condition the caller is missing, on a refusal that names one.
The limiter that shed the call, on a 429.
On a validation failure, the messages for each field, keyed by the field’s name.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": 1, "codeName": "example", "traceId": "example", "requires": "example", "scope": "example", "errors": "example"}Headers
Section titled “Headers”The correlation id of the call: the one you sent, or the one the server made.
The request carries no valid access token (auth.required).
The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.
object
A reference to the code’s entry on the error-codes page.
A short summary of the problem.
The HTTP status of the answer.
What went wrong in this call, in a sentence.
The path of the call.
The stable numeric error code. The error-codes page lists them.
The stable name of the error code, for example resource.not_found.
The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.
The scope or condition the caller is missing, on a refusal that names one.
The limiter that shed the call, on a 429.
On a validation failure, the messages for each field, keyed by the field’s name.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": 1, "codeName": "example", "traceId": "example", "requires": "example", "scope": "example", "errors": "example"}Headers
Section titled “Headers”The correlation id of the call: the one you sent, or the one the server made.
How to authenticate: the bearer challenge.
The caller may not make this call. The code and requires members say why: a missing scope, or a plan that does not include it.
The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.
object
A reference to the code’s entry on the error-codes page.
A short summary of the problem.
The HTTP status of the answer.
What went wrong in this call, in a sentence.
The path of the call.
The stable numeric error code. The error-codes page lists them.
The stable name of the error code, for example resource.not_found.
The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.
The scope or condition the caller is missing, on a refusal that names one.
The limiter that shed the call, on a 429.
On a validation failure, the messages for each field, keyed by the field’s name.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": 1, "codeName": "example", "traceId": "example", "requires": "example", "scope": "example", "errors": "example"}Headers
Section titled “Headers”The correlation id of the call: the one you sent, or the one the server made.
No such entitlement.
The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.
object
A reference to the code’s entry on the error-codes page.
A short summary of the problem.
The HTTP status of the answer.
What went wrong in this call, in a sentence.
The path of the call.
The stable numeric error code. The error-codes page lists them.
The stable name of the error code, for example resource.not_found.
The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.
The scope or condition the caller is missing, on a refusal that names one.
The limiter that shed the call, on a 429.
On a validation failure, the messages for each field, keyed by the field’s name.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": 1, "codeName": "example", "traceId": "example", "requires": "example", "scope": "example", "errors": "example"}Headers
Section titled “Headers”The correlation id of the call: the one you sent, or the one the server made.
A call with the same Idempotency-Key is still running. Send the call again once it has finished.
The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.
object
A reference to the code’s entry on the error-codes page.
A short summary of the problem.
The HTTP status of the answer.
What went wrong in this call, in a sentence.
The path of the call.
The stable numeric error code. The error-codes page lists them.
The stable name of the error code, for example resource.not_found.
The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.
The scope or condition the caller is missing, on a refusal that names one.
The limiter that shed the call, on a 429.
On a validation failure, the messages for each field, keyed by the field’s name.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": 1, "codeName": "example", "traceId": "example", "requires": "example", "scope": "example", "errors": "example"}Headers
Section titled “Headers”The correlation id of the call: the one you sent, or the one the server made.
The body is not sent as application/json (request.unsupported).
The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.
object
A reference to the code’s entry on the error-codes page.
A short summary of the problem.
The HTTP status of the answer.
What went wrong in this call, in a sentence.
The path of the call.
The stable numeric error code. The error-codes page lists them.
The stable name of the error code, for example resource.not_found.
The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.
The scope or condition the caller is missing, on a refusal that names one.
The limiter that shed the call, on a 429.
On a validation failure, the messages for each field, keyed by the field’s name.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": 1, "codeName": "example", "traceId": "example", "requires": "example", "scope": "example", "errors": "example"}Headers
Section titled “Headers”The correlation id of the call: the one you sent, or the one the server made.
The Idempotency-Key was used before with a different request body (operation.idempotency-key-reused).
The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.
object
A reference to the code’s entry on the error-codes page.
A short summary of the problem.
The HTTP status of the answer.
What went wrong in this call, in a sentence.
The path of the call.
The stable numeric error code. The error-codes page lists them.
The stable name of the error code, for example resource.not_found.
The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.
The scope or condition the caller is missing, on a refusal that names one.
The limiter that shed the call, on a 429.
On a validation failure, the messages for each field, keyed by the field’s name.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": 1, "codeName": "example", "traceId": "example", "requires": "example", "scope": "example", "errors": "example"}Headers
Section titled “Headers”The correlation id of the call: the one you sent, or the one the server made.
Too many requests. Wait the seconds in Retry-After, then send the call again (service.too-many-requests).
The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.
object
A reference to the code’s entry on the error-codes page.
A short summary of the problem.
The HTTP status of the answer.
What went wrong in this call, in a sentence.
The path of the call.
The stable numeric error code. The error-codes page lists them.
The stable name of the error code, for example resource.not_found.
The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.
The scope or condition the caller is missing, on a refusal that names one.
The limiter that shed the call, on a 429.
On a validation failure, the messages for each field, keyed by the field’s name.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": 1, "codeName": "example", "traceId": "example", "requires": "example", "scope": "example", "errors": "example"}Headers
Section titled “Headers”The correlation id of the call: the one you sent, or the one the server made.
The seconds to wait before the call is sent again.
The calls the limiter allows in its window, when it knows.
The calls left in the window, when the limiter knows.
The seconds until the window resets, when the limiter knows.
Names the limiter that shed the call.