Poll an onboarding session (session secret, no key)
const url = 'https://api.creatorain.com/v1/onboarding_sessions/obs_3f2a9c1e5b7d4a6f8e0c2b4d6f8a0c2e';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.creatorain.com/v1/onboarding_sessions/obs_3f2a9c1e5b7d4a6f8e0c2b4d6f8a0c2e \ --header 'Authorization: Bearer <token>'Authorization: Bearer <session_secret>. The first poll after the human approves carries
key.secret; no later poll does (key_delivered: true, next_action: create_new_session
if it was lost). Polling sooner than interval is 429 slow_down: the interval grows by 5
seconds, up to 60, and Retry-After carries it. A wrong secret and an unknown id are the same
404; failures count toward the address block like bad keys.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
obs_3f2a9c1e5b7d4a6f8e0c2b4d6f8a0c2eResponses
Section titled “Responses”The session.
object
object
On the first poll after approval only.
{type: human_approval, url} while pending; {type: create_new_session} once expired or collected.
object
Why the approval cannot produce a key yet (for example live_key_requires_top_up, key_limit_reached, owner_changed).
Example
{ "object": "onboarding_session", "status": "pending", "key": { "id": "key_3f2a9c1e5b7d4a6f8e0c2b4d6f8a0c2e", "prefix": "crp_test_AbCd" }, "next_action": { "type": "human_approval" }}Headers
Section titled “Headers”This request’s id. Equal to error.request_id; quote it to support.
No-store. The answer may carry a secret.
Invalid_key, test_key_on_live or live_key_on_sandbox.
object
object
The request field at fault
Batch_invalid only. Every refused location, by its index in the request.
object
One of the error codes above.
Example
{ "error": { "type": "invalid_request_error", "code": "parameter_invalid", "doc_url": "https://www.creatorain.com/api/errors#scope_missing", "items": [ { "field": "locations.1.videos_per_month" } ] }}Headers
Section titled “Headers”This request’s id. Equal to error.request_id; quote it to support.
Not_found.
object
object
The request field at fault
Batch_invalid only. Every refused location, by its index in the request.
object
One of the error codes above.
Example
{ "error": { "type": "invalid_request_error", "code": "parameter_invalid", "doc_url": "https://www.creatorain.com/api/errors#scope_missing", "items": [ { "field": "locations.1.videos_per_month" } ] }}Headers
Section titled “Headers”This request’s id. Equal to error.request_id; quote it to support.
Rate_limited (600 a minute per workspace, an onboarding create limit, or an address blocked after failed authentication), or slow_down (an onboarding session polled too fast).
object
object
The request field at fault
Batch_invalid only. Every refused location, by its index in the request.
object
One of the error codes above.
Example
{ "error": { "type": "invalid_request_error", "code": "parameter_invalid", "doc_url": "https://www.creatorain.com/api/errors#scope_missing", "items": [ { "field": "locations.1.videos_per_month" } ] }}Headers
Section titled “Headers”This request’s id. Equal to error.request_id; quote it to support.
Seconds to wait before retrying (at least 1).
Internal_error (500) or service_unavailable (503). The message never carries a cause.
object
object
The request field at fault
Batch_invalid only. Every refused location, by its index in the request.
object
One of the error codes above.
Example
{ "error": { "type": "invalid_request_error", "code": "parameter_invalid", "doc_url": "https://www.creatorain.com/api/errors#scope_missing", "items": [ { "field": "locations.1.videos_per_month" } ] }}Headers
Section titled “Headers”This request’s id. Equal to error.request_id; quote it to support.
Internal_error (500) or service_unavailable (503). The message never carries a cause.
object
object
The request field at fault
Batch_invalid only. Every refused location, by its index in the request.
object
One of the error codes above.
Example
{ "error": { "type": "invalid_request_error", "code": "parameter_invalid", "doc_url": "https://www.creatorain.com/api/errors#scope_missing", "items": [ { "field": "locations.1.videos_per_month" } ] }}Headers
Section titled “Headers”This request’s id. Equal to error.request_id; quote it to support.