Open an onboarding session (no key)
const url = 'https://api.creatorain.com/v1/onboarding_sessions';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"client_name":"example","requested_scopes":["read"],"requested_livemode":true}'};
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.creatorain.com/v1/onboarding_sessions \ --header 'Content-Type: application/json' \ --data '{ "client_name": "example", "requested_scopes": [ "read" ], "requested_livemode": true }'No API key: this is how an agent without one starts. Show the human user_code and url.
session_secret is returned ONCE and is the only way to poll; store it like a key. The
requested scopes and mode are a request only: the approving human decides. 5 sessions an hour
per address, and a global per-minute ceiling, then 429 rate_limited with Retry-After.
Request Body
Section titled “Request Body”object
Shown to the human as an unverified name.
Responses
Section titled “Responses”The session. Poll it every interval seconds until it is approved, denied or expired.
object
Eight letters; the human types it in the app.
Shown once. The only way to poll this session.
15 minutes after creation.
Seconds between polls.
Example
{ "id": "obs_3f2a9c1e5b7d4a6f8e0c2b4d6f8a0c2e", "object": "onboarding_session", "status": "pending", "url": "https://app.creatorain.com/settings/api/connect?code=BCDF-GHJK", "user_code": "BCDF-GHJK", "session_secret": "crp_obs_...", "interval": 5}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.
Parameter_invalid (with field) or invalid_json.
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.