# Set a unique key once per new action; persist it and reuse it for every retry.
: "${REFLECTIONS_KEY:?Set REFLECTIONS_KEY before running this example}"
: "${REFLECTIONS_REVOKE_TEST_LICENSE_IDEMPOTENCY_KEY:?Set REFLECTIONS_REVOKE_TEST_LICENSE_IDEMPOTENCY_KEY before running this example}"
curl --fail-with-body --max-time 30 -X POST 'https://app.reflections.ai/v1/test_helpers/licenses/lic_k5zba2q8v1m3n7p4r6s9t0wxyh/revoke' \
-H "Authorization: Bearer $REFLECTIONS_KEY" \
-H "Reflections-Version: 2026-10-15" \
-H "Idempotency-Key: $REFLECTIONS_REVOKE_TEST_LICENSE_IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
--data-raw '{
"action": "revoke",
"for_cause": true,
"cause": "Outputs used outside the licensed territories."
}'import { env, exit } from "node:process";
// Set a unique key once per new action; persist it and reuse it for every retry.
const apiKey = env.REFLECTIONS_KEY;
if (!apiKey) throw new Error("Set REFLECTIONS_KEY before running this example");
const idempotencyKey = env.REFLECTIONS_REVOKE_TEST_LICENSE_IDEMPOTENCY_KEY;
if (!idempotencyKey) throw new Error("Set REFLECTIONS_REVOKE_TEST_LICENSE_IDEMPOTENCY_KEY before running this example");
const response = await fetch("https://app.reflections.ai/v1/test_helpers/licenses/lic_k5zba2q8v1m3n7p4r6s9t0wxyh/revoke", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Reflections-Version": "2026-10-15",
"Idempotency-Key": idempotencyKey,
"Content-Type": "application/json",
},
body: JSON.stringify({
"action": "revoke",
"for_cause": true,
"cause": "Outputs used outside the licensed territories."
}),
signal: AbortSignal.timeout(30_000),
});
const responseBody = await response.text();
if (!response.ok) {
console.error(`HTTP ${response.status}: ${responseBody}`);
exit(1);
}
console.log(responseBody);
import json
import os
from urllib.error import HTTPError
from urllib.request import Request, urlopen
# Set a unique key once per new action; persist it and reuse it for every retry.
apiKey = os.environ["REFLECTIONS_KEY"]
if not apiKey:
raise ValueError("Set REFLECTIONS_KEY before running this example")
idempotencyKey = os.environ["REFLECTIONS_REVOKE_TEST_LICENSE_IDEMPOTENCY_KEY"]
if not idempotencyKey:
raise ValueError("Set REFLECTIONS_REVOKE_TEST_LICENSE_IDEMPOTENCY_KEY before running this example")
headers = {
"Authorization": f"Bearer {apiKey}",
"Reflections-Version": "2026-10-15",
"Idempotency-Key": idempotencyKey,
"Content-Type": "application/json",
}
data = json.dumps({
"action": "revoke",
"for_cause": True,
"cause": "Outputs used outside the licensed territories.",
}).encode("utf-8")
request = Request("https://app.reflections.ai/v1/test_helpers/licenses/lic_k5zba2q8v1m3n7p4r6s9t0wxyh/revoke",
method="POST", headers=headers, data=data)
try:
with urlopen(request, timeout=30) as response:
print(response.read().decode("utf-8"))
except HTTPError as error:
error_body = error.read().decode("utf-8")
raise RuntimeError(f"HTTP {error.code}: {error_body}") from error
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
"time"
)
func main() {
// Set a unique key once per new action; persist it and reuse it for every retry.
apiKey := os.Getenv("REFLECTIONS_KEY")
if apiKey == "" {
panic("Set REFLECTIONS_KEY before running this example")
}
idempotencyKey := os.Getenv("REFLECTIONS_REVOKE_TEST_LICENSE_IDEMPOTENCY_KEY")
if idempotencyKey == "" {
panic("Set REFLECTIONS_REVOKE_TEST_LICENSE_IDEMPOTENCY_KEY before running this example")
}
body := strings.NewReader(`{
"action": "revoke",
"for_cause": true,
"cause": "Outputs used outside the licensed territories."
}`)
request, err := http.NewRequest("POST", "https://app.reflections.ai/v1/test_helpers/licenses/lic_k5zba2q8v1m3n7p4r6s9t0wxyh/revoke", body)
if err != nil {
panic(err)
}
request.Header.Set("Authorization", "Bearer " + apiKey)
request.Header.Set("Reflections-Version", "2026-10-15")
request.Header.Set("Idempotency-Key", idempotencyKey)
request.Header.Set("Content-Type", "application/json")
client := &http.Client{Timeout: 30 * time.Second}
response, err := client.Do(request)
if err != nil {
panic(err)
}
defer response.Body.Close()
responseBody, err := io.ReadAll(response.Body)
if err != nil {
panic(err)
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
panic(fmt.Sprintf("HTTP %d: %s", response.StatusCode, responseBody))
}
fmt.Print(string(responseBody))
}
{
"id": "lic_97bb8qgh1b9zk81anbjkmprxh4",
"object": "license",
"livemode": false,
"status": "revoked",
"talent": "tal_9t0wxyhk5zba2q8v1m3n7p4r6s",
"licensee": "acct_7p4r6s9t0wxyhk5zba2q8v1m3n",
"issued_by": {
"party": "talent",
"account": null
},
"handle": "T8M3QX",
"current_revision": "lrv_f96ktjt9bw2j3xg69xbnt1xrqa",
"revision_number": 2,
"pending_revision": null,
"scope": {
"facets": [
"fct_5zba2q8v1m3n7p4r6s9t0wxyhk",
"fct_v1m3n7p4r6s9t0wxyhk5zba2q8"
],
"modalities": [
"image",
"video",
"speech"
],
"kinds": [
"depiction"
],
"purposes": [
"advertising"
],
"commercial": true,
"channels": [
"social",
"web",
"tv"
],
"territories": [
"US",
"CA"
],
"rules": {
"never": [
"Do not show alcohol or tobacco."
],
"always": [],
"brief": null
},
"release_policy": "after_checks",
"sessions": {
"permitted": false
},
"platforms": {
"mode": "any_connected",
"accounts": []
},
"sublicense": "none",
"training": "prohibited",
"disclosure": "licensed",
"post_revocation": {
"policy": "withdraw",
"withdraw_within": "P7D"
}
},
"acceptance_url": null,
"accepted_at": "2026-09-02T10:00:00Z",
"suspended_at": null,
"revoked_at": "2026-10-17T19:40:22Z",
"declined_at": null,
"metadata": {},
"created_at": "2026-09-02T10:00:00Z"
}Revoke a license
Planned contract — unavailable in test and live modes. This operation is a protocol reference, not a callable endpoint. Start with the working sandbox quickstart.
Test mode only. Revokes or suspends a test license as its talent would, and sends the same events, stream messages and revocation a live revocation sends.
Needs an unrestricted key.
# Set a unique key once per new action; persist it and reuse it for every retry.
: "${REFLECTIONS_KEY:?Set REFLECTIONS_KEY before running this example}"
: "${REFLECTIONS_REVOKE_TEST_LICENSE_IDEMPOTENCY_KEY:?Set REFLECTIONS_REVOKE_TEST_LICENSE_IDEMPOTENCY_KEY before running this example}"
curl --fail-with-body --max-time 30 -X POST 'https://app.reflections.ai/v1/test_helpers/licenses/lic_k5zba2q8v1m3n7p4r6s9t0wxyh/revoke' \
-H "Authorization: Bearer $REFLECTIONS_KEY" \
-H "Reflections-Version: 2026-10-15" \
-H "Idempotency-Key: $REFLECTIONS_REVOKE_TEST_LICENSE_IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
--data-raw '{
"action": "revoke",
"for_cause": true,
"cause": "Outputs used outside the licensed territories."
}'import { env, exit } from "node:process";
// Set a unique key once per new action; persist it and reuse it for every retry.
const apiKey = env.REFLECTIONS_KEY;
if (!apiKey) throw new Error("Set REFLECTIONS_KEY before running this example");
const idempotencyKey = env.REFLECTIONS_REVOKE_TEST_LICENSE_IDEMPOTENCY_KEY;
if (!idempotencyKey) throw new Error("Set REFLECTIONS_REVOKE_TEST_LICENSE_IDEMPOTENCY_KEY before running this example");
const response = await fetch("https://app.reflections.ai/v1/test_helpers/licenses/lic_k5zba2q8v1m3n7p4r6s9t0wxyh/revoke", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Reflections-Version": "2026-10-15",
"Idempotency-Key": idempotencyKey,
"Content-Type": "application/json",
},
body: JSON.stringify({
"action": "revoke",
"for_cause": true,
"cause": "Outputs used outside the licensed territories."
}),
signal: AbortSignal.timeout(30_000),
});
const responseBody = await response.text();
if (!response.ok) {
console.error(`HTTP ${response.status}: ${responseBody}`);
exit(1);
}
console.log(responseBody);
import json
import os
from urllib.error import HTTPError
from urllib.request import Request, urlopen
# Set a unique key once per new action; persist it and reuse it for every retry.
apiKey = os.environ["REFLECTIONS_KEY"]
if not apiKey:
raise ValueError("Set REFLECTIONS_KEY before running this example")
idempotencyKey = os.environ["REFLECTIONS_REVOKE_TEST_LICENSE_IDEMPOTENCY_KEY"]
if not idempotencyKey:
raise ValueError("Set REFLECTIONS_REVOKE_TEST_LICENSE_IDEMPOTENCY_KEY before running this example")
headers = {
"Authorization": f"Bearer {apiKey}",
"Reflections-Version": "2026-10-15",
"Idempotency-Key": idempotencyKey,
"Content-Type": "application/json",
}
data = json.dumps({
"action": "revoke",
"for_cause": True,
"cause": "Outputs used outside the licensed territories.",
}).encode("utf-8")
request = Request("https://app.reflections.ai/v1/test_helpers/licenses/lic_k5zba2q8v1m3n7p4r6s9t0wxyh/revoke",
method="POST", headers=headers, data=data)
try:
with urlopen(request, timeout=30) as response:
print(response.read().decode("utf-8"))
except HTTPError as error:
error_body = error.read().decode("utf-8")
raise RuntimeError(f"HTTP {error.code}: {error_body}") from error
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
"time"
)
func main() {
// Set a unique key once per new action; persist it and reuse it for every retry.
apiKey := os.Getenv("REFLECTIONS_KEY")
if apiKey == "" {
panic("Set REFLECTIONS_KEY before running this example")
}
idempotencyKey := os.Getenv("REFLECTIONS_REVOKE_TEST_LICENSE_IDEMPOTENCY_KEY")
if idempotencyKey == "" {
panic("Set REFLECTIONS_REVOKE_TEST_LICENSE_IDEMPOTENCY_KEY before running this example")
}
body := strings.NewReader(`{
"action": "revoke",
"for_cause": true,
"cause": "Outputs used outside the licensed territories."
}`)
request, err := http.NewRequest("POST", "https://app.reflections.ai/v1/test_helpers/licenses/lic_k5zba2q8v1m3n7p4r6s9t0wxyh/revoke", body)
if err != nil {
panic(err)
}
request.Header.Set("Authorization", "Bearer " + apiKey)
request.Header.Set("Reflections-Version", "2026-10-15")
request.Header.Set("Idempotency-Key", idempotencyKey)
request.Header.Set("Content-Type", "application/json")
client := &http.Client{Timeout: 30 * time.Second}
response, err := client.Do(request)
if err != nil {
panic(err)
}
defer response.Body.Close()
responseBody, err := io.ReadAll(response.Body)
if err != nil {
panic(err)
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
panic(fmt.Sprintf("HTTP %d: %s", response.StatusCode, responseBody))
}
fmt.Print(string(responseBody))
}
{
"id": "lic_97bb8qgh1b9zk81anbjkmprxh4",
"object": "license",
"livemode": false,
"status": "revoked",
"talent": "tal_9t0wxyhk5zba2q8v1m3n7p4r6s",
"licensee": "acct_7p4r6s9t0wxyhk5zba2q8v1m3n",
"issued_by": {
"party": "talent",
"account": null
},
"handle": "T8M3QX",
"current_revision": "lrv_f96ktjt9bw2j3xg69xbnt1xrqa",
"revision_number": 2,
"pending_revision": null,
"scope": {
"facets": [
"fct_5zba2q8v1m3n7p4r6s9t0wxyhk",
"fct_v1m3n7p4r6s9t0wxyhk5zba2q8"
],
"modalities": [
"image",
"video",
"speech"
],
"kinds": [
"depiction"
],
"purposes": [
"advertising"
],
"commercial": true,
"channels": [
"social",
"web",
"tv"
],
"territories": [
"US",
"CA"
],
"rules": {
"never": [
"Do not show alcohol or tobacco."
],
"always": [],
"brief": null
},
"release_policy": "after_checks",
"sessions": {
"permitted": false
},
"platforms": {
"mode": "any_connected",
"accounts": []
},
"sublicense": "none",
"training": "prohibited",
"disclosure": "licensed",
"post_revocation": {
"policy": "withdraw",
"withdraw_within": "P7D"
}
},
"acceptance_url": null,
"accepted_at": "2026-09-02T10:00:00Z",
"suspended_at": null,
"revoked_at": "2026-10-17T19:40:22Z",
"declined_at": null,
"metadata": {},
"created_at": "2026-09-02T10:00:00Z"
}Authorizations
Your secret key, rk_test_… or rk_live_…, sent as Authorization: Bearer <key>. Keep it
on your server. Restricted keys carry only the scopes you give them.
Headers
The dated API version. Defaults to the version your account is pinned to.
"2026-10-15"
Act for a connected licensee. The value is the licensee's account ID. Requires an active connection between that account and yours.
^acct_[0-9a-hjkmnp-tv-z]{26}$A unique key for this operation, up to 255 characters. In test mode, POST keys are scoped to your account and mode and bind the endpoint and body for 24 hours. A different endpoint or body with the same key is refused.
Initial live check and generation creation require a nonempty key. Each operation has a
separate account-scoped namespace; retain the same API key, body and idempotency key for
retries within 24 hours of creation. A pending check returns 202 with status: "checking".
Completed checks replay their sealed response; successful generation POSTs replay the
original accepted 202, so use GET for current state. Live verification is a read-only
query that returns a fresh verification ID on each call, without exact response caching.
The broader delegated-account contract also scopes keys to Reflections-Account;
delegated requests and the other planned live POST operations remain unsupported.
255Path Parameters
The license's ID.
^lic_[0-9a-hjkmnp-tv-z]{26}$Body
suspend pauses the license until resume; revoke ends it.
revoke, suspend, resume Revoke for a breach of the license, stated in cause. Only a revocation for cause can withdraw released outputs.
Required when for_cause is true.
1000Response
The license after the action.
Unique identifier for the license, lic_….
^lic_[0-9a-hjkmnp-tv-z]{26}$Always license.
"license"true for a live-mode license, false for a test-mode one.
Where the license is in its life. Checks are decided on its terms only while it is
active; under every other status they deny.
pending_acceptance, scheduled, active, suspended, expired, declined, revoked, void The talent who granted the license.
^tal_[0-9a-hjkmnp-tv-z]{26}$The account that holds the license and answers for every use made under it. Null on a
pending_acceptance license its talent reads before anyone accepts the invitation.
^acct_[0-9a-hjkmnp-tv-z]{26}$A six-character name for the license that people can read aloud, such as K7Q4M2.
^[0-9BCDFGHJKMNPQRSTVWXYZ]{6}$The revision in force. While the license is pending_acceptance, the first revision, waiting to be accepted.
^lrv_[0-9a-hjkmnp-tv-z]{26}$The number of current_revision, starting at 1.
x >= 1The terms of current_revision in normalized form. A pending revision does not change
it until the licensee accepts.
Show child attributes
Show child attributes
When the talent's side signed the first revision.
Who signed the first revision.
Show child attributes
Show child attributes
A new revision the talent's side signed, such as a change the licensee requested, an
amendment or a renewal, waiting for the licensee to accept it at acceptance_url.
current_revision stays in force until then.
^lrv_[0-9a-hjkmnp-tv-z]{26}$The digest of the current revision's signed terms. Checks, authorizations and receipts
decided under that revision carry the same value. A live read returns the digest of
the full signed terms, not a digest of the partial scope; live revision retrieval
and live decision endpoints remain planned.
^sha256:[0-9a-f]{64}$The hosted page where the licensee reads and accepts the license, or its pending_revision. Present while pending_acceptance, and while a revision is pending.
When the licensee accepted the license. null until then.
When the current suspension began. null unless the license is suspended.
When the license was revoked. null unless it is revoked.
When the licensee declined the license. null unless it is declined.
Key-value pairs stored on the license.
Show child attributes
Show child attributes