Skip to main content
POST
Create a hosted credential session
Creates a short-lived hosted form. Open hosted_url for the end user (same-tab redirect is typical), then either wait for their return via return_url or poll GET /credential-sessions/{id} until status is completed.

Notes

  • strategy_id is provisioned by Rubie for your account — one per system you connect to.
  • return_url is optional. If set, its origin must be allowlisted on your account. Rubie redirects there with session_id appended; confirm the session server-side before saving credential_id.
  • Credentials are validated against the target system on first Blueprint run, not when the form is submitted.
See Hosted credential collection for the full connect flow, including polling and return_url handling.

Authorizations

Authorization
string
header
required

Your Rubie API key as a bearer token.

Headers

Idempotency-Key
string

Unique key for safely retrying mutating requests. Matching key + body replays the original response for 24 hours. Matching key + different body returns 409 conflict.

Body

application/json
strategy_id
string
required

Provisioned authentication strategy id (strat_...).

Example:

"strat_NQ"

name
string

Optional display name for the vaulted credential shell.

Maximum string length: 256
return_url
string<uri>

Optional URL to send the end user back to after credential collection. Its exact origin (scheme, host, and port) must be allowlisted for your account by Rubie. The redirect appends session_id; confirm the session server-side before saving credential_id.

Maximum string length: 2048
Example:

"https://app.example.com/settings/integrations/connected"

Response

Session created

id
string
required
Example:

"sess_MQ"

status
enum<string>
required

Lifecycle status of the session. completed always means terminal and usable: the credential is vaulted and may be passed to a run. expired is terminal and not usable. pending means the end user has not finished the hosted form yet.

Treat this as an open string set rather than a fixed enum. Additional non-terminal statuses may be introduced between collection and completed — for example while Rubie verifies the credential against the target system. Keep polling on any status you do not recognise, and only branch on the three values above. Code written as if (status === "completed") { save(credential_id) } stays correct.

Available options:
pending,
completed,
expired
strategy_id
string
required
Example:

"strat_NQ"

expires_at
string<date-time>
required
created_at
string<date-time>
required
hosted_url
string | null

Rubie-hosted form URL. Open for the end user while status is pending.

return_url
string<uri> | null

Customer URL supplied when the session was created. After collection, Rubie redirects here with session_id appended as a query parameter.

credential_id
string | null

Present only when status is completed, and stable for the life of the credential. Retain it against your user record. Do not persist an id read from a session in any other status.

Example:

"cred_NDc"

completed_at
string<date-time> | null