Begin an OAuth device authorization for an A2A client
const url = 'https://api.infiniteaudience.ai/v1/oauth/device_authorization';const options = { method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: new URLSearchParams({ client_id: 'example', client_secret: 'example', resource: 'https://example.com', scope: '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://api.infiniteaudience.ai/v1/oauth/device_authorization \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data client_id=example \ --data client_secret=example \ --data resource=https://example.com \ --data scope=examplePublic and client-authenticated (RFC 8628). Returns a browser verification URL, one-time user code, secret device code, expiry, and polling interval. The request must use the A2A resource. Delegated scopes are limited to discovery and optional creator.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Space-delimited discovery and optional creator; defaults to discovery.
Examplegenerated
client_id=example&client_secret=example&resource=https%3A%2F%2Fexample.com&scope=exampleobject
Space-delimited discovery and optional creator; defaults to discovery.
Examplegenerated
{ "client_id": "example", "client_secret": "example", "resource": "https://example.com", "scope": "example"}Responses
Section titled “Responses”Device authorization details.
object
Example
{ "user_code": "ABCD-EFGH", "expires_in": 600, "interval": 5}RFC 6749-shaped OAuth protocol error — error is a fixed machine-readable code and error_description is a human-readable detail. Deliberately NOT this API’s usual {error, code, message} shape — this is the RFC’s own error contract, used only by /v1/oauth/authorize, /v1/oauth/device_authorization, /v1/oauth/token, and /v1/oauth/revoke.
RFC 6749 §5.2 / §4.1.2.1 error body — see the OAuthError response component.
object
Example
{ "error": "invalid_request"}RFC 6749-shaped OAuth protocol error — error is a fixed machine-readable code and error_description is a human-readable detail. Deliberately NOT this API’s usual {error, code, message} shape — this is the RFC’s own error contract, used only by /v1/oauth/authorize, /v1/oauth/device_authorization, /v1/oauth/token, and /v1/oauth/revoke.
RFC 6749 §5.2 / §4.1.2.1 error body — see the OAuthError response component.
object
Example
{ "error": "invalid_request"}RFC 6749-shaped OAuth protocol error — error is a fixed machine-readable code and error_description is a human-readable detail. Deliberately NOT this API’s usual {error, code, message} shape — this is the RFC’s own error contract, used only by /v1/oauth/authorize, /v1/oauth/device_authorization, /v1/oauth/token, and /v1/oauth/revoke.
RFC 6749 §5.2 / §4.1.2.1 error body — see the OAuthError response component.
object
Example
{ "error": "invalid_request"}