- Connect — once per user, per system. Your user hands over their credentials through a form Rubie hosts, and you get back an id to store against them.
- Run — as often as you need. You trigger a Blueprint with that id and poll until it finishes, then fetch its outputs.
What you’ll need
The API key is a secret, so keep it in your server-side environment or secret
manager:
API keys are account-scoped and every endpoint here is server-to-server, so
keys must never reach a browser. See Authentication.
Part 1 — Connect an account
Do this once, when a user first connects a system. The credentials go straight from your user to Rubie’s vault — they never touch your servers.1
Create a credential session
strategy_id tells Rubie which system the user is connecting, so it renders
the right fields on the form. return_url sends them back to your app when
they’re done. Ask Rubie to allowlist its exact origin on the account that
owns the API key making this request, then open the returned hosted_url in
the same tab or a new one.name is just a label for your team in the Rubie dashboard. Something that
identifies the connection is a good choice.2
Confirm the session, then store the credential id
After collection, Rubie redirects to your When
return_url with the session id:https://app.example.com/integrations/rubie/connected?session_id=sess_...Read session_id from the query string and confirm the session from your
backend before saving credential_id:status is completed, credential_id is populated. Save it in your
application’s integration settings. Rubie already stores the underlying
credential under the account associated with your API key; your application
stores only this opaque id so it can select the connection on future runs.If your application supports multiple connections, associate each
credential_id with the corresponding workspace or integration. Branch on
completed and expired; if the status is anything else, poll briefly until
it settles. That id is now good for as many runs as you like.Part 2 — Run a Blueprint
Now that you have acred_..., trigger a run whenever you need work done in that
system — on a schedule, on a webhook, or from a button in your UI.
1
Trigger the run
Pass the stored credential id. You’ll get
202 back: the run is queued, not
finished.2
Poll until it finishes
Poll every 2–5 seconds until On
status is completed, failed, or
cancelled. Don’t block a user-facing request on it.failed, error.code is execution_failed — offer a retry. A network
retry of the original trigger request should reuse its Idempotency-Key, but
a user-initiated retry after a terminal failure is a new logical operation
and must use a new key. Otherwise Rubie replays the original run response
instead of creating another run.This endpoint returns lifecycle facts only, never run inputs, outputs, or
file URLs, so it’s safe to poll from systems handling regulated data.3
Fetch the results
After the status is Direct responses contain each output’s records. For larger results, request
completed, fetch the Blueprint outputs. Use direct
delivery when you want records in the response body:deliveryMethod=presigned_url (the default) and download the temporary URLs
in results. Rubie automatically switches a direct request to presigned URL
delivery when the estimated payload is 5 MB or larger, so always branch on
the returned dataDeliveryMethod.Disconnecting
When a user disconnects a system, revoke the credential. This is a hard delete: the vaulted secrets are destroyed and thecred_... stops resolving, so drop
your stored mapping at the same time.
Next
- Hosted credential collection — session lifecycle, embedding, and reconnect flows
- Embedded Credential Capture — let users choose a Blueprint and connect inside an iframe
- Triggering Blueprint runs — input routing, file uploads, polling, and results in depth
- Idempotency — why every example above carries an
Idempotency-Key - Auth strategies — what sits behind a
strategy_id, if you’re curious