Skip to main content
Many Cobalt API operations are asynchronous. When you create an appointment, patient, or other record via the API, Cobalt returns immediately with a job_id and processes the request in the background. Normally, you’d set up webhooks to receive the result. Awaiting results is an alternative pattern that lets you poll for the outcome directly, giving you a synchronous-style workflow without needing a webhook endpoint. This is useful for:
  • Getting started quickly without configuring webhook infrastructure
  • Simple scripts or one-off integrations
  • Environments where receiving inbound HTTP requests is difficult
  • Prototyping and testing
This pattern uses the Get Webhook Events endpoint to poll for results by job_id. Every asynchronous operation returns a job_id that you can use to track its outcome.

How It Works

  1. Make the API call - Create an appointment, patient, or other record. The response includes a job_id.
  2. Poll for the result - Call GET /v1/webhook-events?job_id={job_id} on an interval until a matching event appears.
  3. Handle the outcome - The event tells you whether the operation succeeded or failed, with full details.
POST /v1/appointments ──► { job_id: "12345" }


GET /v1/webhook-events?job_id=12345  ──► (empty, not ready)
          │  wait 1 second

GET /v1/webhook-events?job_id=12345  ──► (empty, not ready)
          │  wait 1 second

GET /v1/webhook-events?job_id=12345  ──► { type: "appointment.created", data: {...} }