Exchange an app assertion for an installation bearer
const url = 'https://example.com/auth/app-installation-token';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"assertion":"eyJhbGciOiJFZERTQSIsImtpZCI6InYxIn0.eyJpc3MiOiJhY21lLWNoZWNrb3V0LWJvdCIsInN1YiI6ImFjbWUtY2hlY2tvdXQtYm90IiwiYXVkIjoiaHR0cHM6Ly9hcGkud2FtcC5kZXYvYXV0aC9hcHAtaW5zdGFsbGF0aW9uLXRva2VuIiwiaWF0IjoxNzg2MTk1MDAwLCJleHAiOjE3ODYxOTUzMDB9.9tS1oQ2vKcYy8mB0dR4nZq7fXw3LhJp5A6TgEuVbNsC","installationId":"e3f7b219-6c40-4a8e-b591-07d2c48f3a65","resourceAudience":"wamp-cloud"}'};
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/auth/app-installation-token \ --header 'Content-Type: application/json' \ --data '{ "assertion": "eyJhbGciOiJFZERTQSIsImtpZCI6InYxIn0.eyJpc3MiOiJhY21lLWNoZWNrb3V0LWJvdCIsInN1YiI6ImFjbWUtY2hlY2tvdXQtYm90IiwiYXVkIjoiaHR0cHM6Ly9hcGkud2FtcC5kZXYvYXV0aC9hcHAtaW5zdGFsbGF0aW9uLXRva2VuIiwiaWF0IjoxNzg2MTk1MDAwLCJleHAiOjE3ODYxOTUzMDB9.9tS1oQ2vKcYy8mB0dR4nZq7fXw3LhJp5A6TgEuVbNsC", "installationId": "e3f7b219-6c40-4a8e-b591-07d2c48f3a65", "resourceAudience": "wamp-cloud" }'The assertion is an Ed25519 JWT signed by the App’s registered private key. The returned token has audience wamp-cloud, is bound to one live installation, and is never a browser credential.
Request Bodyrequired
Section titled “Request Bodyrequired”object
A UUID identifying one Cloud resource; Session, Turn, Publication and Merge ids are minted by the caller so an ambiguous retry addresses the same durable command instead of creating a second one.
Example
{ "assertion": "eyJhbGciOiJFZERTQSIsImtpZCI6InYxIn0.eyJpc3MiOiJhY21lLWNoZWNrb3V0LWJvdCIsInN1YiI6ImFjbWUtY2hlY2tvdXQtYm90IiwiYXVkIjoiaHR0cHM6Ly9hcGkud2FtcC5kZXYvYXV0aC9hcHAtaW5zdGFsbGF0aW9uLXRva2VuIiwiaWF0IjoxNzg2MTk1MDAwLCJleHAiOjE3ODYxOTUzMDB9.9tS1oQ2vKcYy8mB0dR4nZq7fXw3LhJp5A6TgEuVbNsC", "installationId": "e3f7b219-6c40-4a8e-b591-07d2c48f3a65", "resourceAudience": "wamp-cloud"}Responses
Section titled “Responses”Installation token minted
Result of exchanging a signed App assertion for the installation-scoped bearer that every /v1 request carries.
object
Always true on this response; a refused exchange returns an HTTP error status with an error code instead
The bearer to send as Authorization: Bearer <token>, bound to the one installation and one exact resource audience named in the exchange
Token lifetime in seconds from issuance, currently 600; mint a new token before this elapses rather than caching it longer
Example
{ "success": true, "token": "eyJhbGciOiJFZERTQSIsImtpZCI6ImNsb3VkLTIwMjYtMDgifQ.eyJhdWQiOiJ3YW1wLWNsb3VkIiwiaW5zdGFsbGF0aW9uSWQiOiJlM2Y3YjIxOS02YzQwLTRhOGUtYjU5MS0wN2QyYzQ4ZjNhNjUiLCJpYXQiOjE3ODYxOTUwMDIsImV4cCI6MTc4NjE5NTYwMn0.Kx7Rd0uPnJ4wLbQ9mZaE2sT6yVfHgCiO5r1XjB3NtAe", "expiresIn": 600}Malformed request
Failure body returned with every non-2xx JSON response; branch on the machine code, never on prose or on the HTTP status alone.
object
Stable machine code
The installation capability the presented credential lacks, returned with insufficient_scope so an integrator knows exactly which capability to request
Advisory seconds to wait before retrying; returned on rate-limit denials, where the Retry-After header carries the same value
Example
{ "error": "invalid_request"}Missing, expired or wrong-audience bearer
Failure body returned with every non-2xx JSON response; branch on the machine code, never on prose or on the HTTP status alone.
object
Stable machine code
The installation capability the presented credential lacks, returned with insufficient_scope so an integrator knows exactly which capability to request
Advisory seconds to wait before retrying; returned on rate-limit denials, where the Retry-After header carries the same value
Example
{ "error": "unauthorized"}Live installation, scope or organization policy denies the operation
Failure body returned with every non-2xx JSON response; branch on the machine code, never on prose or on the HTTP status alone.
object
Stable machine code
The installation capability the presented credential lacks, returned with insufficient_scope so an integrator knows exactly which capability to request
Advisory seconds to wait before retrying; returned on rate-limit denials, where the Retry-After header carries the same value
Example
{ "error": "insufficient_scope", "requiredScope": "wamp.cloud.sessions:create"}The pre-authentication edge budget or durable human-membership/App-installation budget is exhausted
Failure body returned with every non-2xx JSON response; branch on the machine code, never on prose or on the HTTP status alone.
object
Stable machine code
The installation capability the presented credential lacks, returned with insufficient_scope so an integrator knows exactly which capability to request
Advisory seconds to wait before retrying; returned on rate-limit denials, where the Retry-After header carries the same value
Example
{ "error": "cloud_rate_limit_exceeded", "retryAfterSeconds": 3}Headers
Section titled “Headers”IETF HTTPAPI structured quota policy
IETF HTTPAPI structured current service limit