Api referenceConnections
Get or Create Scannable Connection
Get a connection ready to scan, reusing an idle one if available.
POST /api/connections/get-or-create
Returns a connection in scan_qr state with a fresh QR code. If the user has an existing idle connection (scan_qr, pending, or failed), it restarts that one instead of creating a new one. This avoids wasted connections piling up.
One call, one response — no need to list connections, filter, and decide whether to restart or create.
Authentication
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer token. Format: Bearer <token> |
Response
{
"id": "c1a2b3c4-d5e6-7f89-0abc-def123456789",
"status": "scan_qr",
"qr": "iVBORw0KGgoAAAANSUhEUg..."
}The qr field is a base64-encoded PNG image. It will be null if the QR is not ready yet (worker still booting) or if the connection is already linked (status: "working").
{
"id": "c1a2b3c4-d5e6-7f89-0abc-def123456789",
"status": "working",
"qr": null
}{
"id": "c1a2b3c4-d5e6-7f89-0abc-def123456789",
"status": "pending",
"qr": null
}SDK Examples
const result = await client.getOrCreateScannableConnection();
// result.id, result.status, result.qr (base64 PNG or null)result = client.get_or_create_scannable_connection()
# result["id"], result["status"], result["qr"]wahooks connections quick