GET /analysis/{analysis_id}/results repeatedly, you can ask Ochy to push
status updates to an HTTPS endpoint you control. Your server receives JSON payloads as the
analysis moves from queued to running, through progress milestones, to success or failure.
Overview
- Register a webhook URL once for your partner account with
PUT /webhook. UseGET /webhookto read the current URL,enabledflag, andupdated_at. - Opt in per analysis when you call
POST /analysis/startwithnotify_via_webhook: true. If you omit it or set it tofalse, behaviour is unchanged and no webhook events are sent for that analysis. - Handle incoming POST requests on your URL. Each payload includes an event type, status,
percentage, a monotonic
sequenceper analysis, and a timestamp.
2xx) and process
the payload in the background if needed.
Read the webhook configuration
GET /webhook returns the stored url, enabled, and updated_at for your partner.
If nothing has been saved yet, the response body is an empty JSON object ({}).
Configure the webhook
UsePUT /webhook with a JSON body:
| Field | Type | Description |
|---|---|---|
url | string | HTTPS URL that will receive POST requests from Ochy. |
enabled | boolean | When false, no webhook traffic is sent until you enable it again. |
PUT returns the same shape as GET: url, enabled, and updated_at.
This call creates your webhook configuration if none exists, or updates the URL and/or
enabled flag. You configure the webhook once per partner; you do not pass the URL on every
POST /analysis/start.
When notify_via_webhook is true on start, the API checks that your partner webhook is valid
and enabled. The decision to send webhooks for that analysis is fixed at start time and stored
with the analysis.
Start an analysis with webhooks
Add an optional field to the same multipart request you already use forPOST /analysis/start:
| Field | Type | Default | Description |
|---|---|---|---|
notify_via_webhook | boolean | false | If true, progress and completion events are delivered to your configured webhook URL for this analysis only. |
Events and frequency
For each analysis, events are emitted when:- processing starts (status moves to
analyzing); - progress crosses each 10% boundary from 10% through 90% (if progress jumps, all crossed milestones are sent in order);
- the analysis completes successfully (
success, 100%); - the analysis fails (
failed), at any progress value.
event_type | Typical status | Notes |
|---|---|---|
analysis.started | analyzing | First processing signal for the run. |
analysis.progress | analyzing | Progress milestones at 10%, 20%, … 90%. |
analysis.completed | success | Final success; percentage is 100. |
analysis.failed | failed | Terminal failure; percentage reflects last known progress. |
Payload format
Ochy sendsPOST requests to your webhook URL with a JSON body like:
| Field | Description |
|---|---|
analysis_id | Same identifier as video_id from the start endpoint. |
event_type | One of analysis.started, analysis.progress, analysis.completed, analysis.failed. |
status | Current analysis status (analyzing, success, or failed). |
percentage | Progress from 0 to 100. |
sequence | Per-analysis monotonic counter. Use it to order and deduplicate events. |
timestamp | Time of the event in UTC (ISO 8601). |
Ordering and out-of-order delivery
Webhook delivery is asynchronous. In rare cases an older event might arrive after a newer one.- Each payload includes a
sequencethat increases for thatanalysis_id. - Process events in
sequenceorder; if you receive a payload whosesequenceis less than or equal to the last one you applied for that analysis, you can ignore it.
sequence.
Fallback: polling
You can always call:status is success), whether or not webhooks are enabled. Use it for integration testing,
manual checks, or when you need a single source of truth after delivery issues.
See also
- Analysis workflow — video requirements, status codes, and polling
GET /webhook— read current webhook settingsPUT /webhook— register or update your webhook URLPOST /analysis/start—notify_via_webhookfield