## Webhook overview

One-Shot API can send **event notifications** to a URL when request status changes. Each change triggers an HTTP **POST** to that URL with a JSON body.

**Asynchronous flow** — The only flow where you pass the URL in the API: use the **`callback`** parameter together with `useasync=true` in the [Create](/products/namirialpkiaas/one-shot/openapi#operation/call_create_api_v1_create_post) Request call.

**VideoID flows** — For eIDAS VideoID and VideoID External mode, the webhook URL is **not** sent in the API. In both sandbox and production, the URL must be defined in your **Registration Authority (RA)**. Contact the Operations Department to configure it.

## Callback payload

Each status change sends a JSON object. Example:


```json
{
  "event_type": "REQUEST_CREATED",
  "sent_at": "20250715083633",
  "request": {
    "status": "VIDEOPENDING",
    "profile": "PFnubeNC",
    "registration_authority": 7,
    "scratchcard": "2678100",
    "pk": 1012632
  },
  "certificates": []
}
```

Relevant fields:

- **status** — The status that triggered the notification (most recent).
- **date** — Date and time of the status change (when present).
- **previous_status** — The status immediately before the change (when present).
- **request** — Request data including unique id (`pk`), `registration_authority`, etc.


Your endpoint should accept HTTP POST, read the JSON body, and return a successful HTTP status (e.g. 200). Store or process the payload as needed for your application (e.g. update UI, trigger next step).

## Webhook URL format

The callback URL is the full address where your server receives POST requests, for example:


```
https://{host}/videoid
```

where `{host}` is the IP or domain of the server exposing the webhook. It must be reachable from Uanataca services.

## Sample implementation (Python)

This example appends each received JSON to a file named `videoid`:


```python
import web

urls = ('/videoid', 'videoid')
app = web.application(urls, globals())

class videoid:
    def POST(self):
        data = web.data()
        f = open("videoid", 'a+')
        f.write(data)
        f.close()
        return ''

if __name__ == "__main__":
    app.run()
```

## Sample implementation (PHP)


```php
<?php
$post = file_get_contents('php://input', true);
$file_handle = fopen('/videoid/status.json', 'w');
fwrite($file_handle, $post);
fclose($file_handle);
?>
```

Implement your webhook to parse the JSON and handle different `status` and `event_type` values (e.g. VIDEOPENDING, VIDEOREVIEW, ENROLLREADY) as required by your flow.

## Related documentation

- [Signing flow](/products/namirialpkiaas/one-shot/enterprise-documentation/get-started/signing-flow) — Overview of workflow types
- [Asynchronous flow](/products/namirialpkiaas/one-shot/enterprise-documentation/products-and-modules/workflows/asynchronous-flow) — Using callback with `useasync=true`
- [eIDAS VideoID](/products/namirialpkiaas/one-shot/enterprise-documentation/products-and-modules/workflows/videoid-eidas)
- [API reference](/products/namirialpkiaas/one-shot/openapi)