Register a webhook
POST /api/v2/webhooks — create the source and the webhook that feeds it, in one call.
Creates the source and registers the webhook that will feed it. Call it once; the webhook_id it returns is what your systems notify from then on.
POST /api/v2/webhooksHeaders
Same as any authenticated JaaS call — see Authentication. You need x-api-key, x-skt-workspace, x-skt-account and Content-Type: application/json.
Body
| Field | Type | Required | What it does |
|---|---|---|---|
name | string | Yes | Source name, as it will appear in the platform. |
webhook | object | Yes | The webhook configuration. All three of its sections have defaults. |
folder_id | integer | No | Folder to create the source in. |
notification_config | object | No | Where to call you back as files move. See Status notifications. |
webhook.file_mapping
Where to read the file's URL and name from in the notifications you'll send.
| Field | Default | What it does |
|---|---|---|
url_field | file_url | Path to the file URL in your payload. |
filename_field | filename | Path to the file name. |
Both accept dot and index notation, so you can point at a field nested inside the payload your platform already emits — data.file.url, files[0].url. See Send a notification for how it resolves.
webhook.credentials
How Simetrik authenticates when it downloads the file from your URL.
type | Fields | What is sent |
|---|---|---|
basic_auth | username, password | HTTP Basic authentication. |
api_key | api_key | An X-API-Key header. |
bearer | token | An Authorization: Bearer header. |
Omit credentials entirely if your URLs are pre-signed or otherwise public — the file is then fetched with no authentication.
webhook.response_config
What Simetrik answers your systems with. Useful when the platform sending the notification expects a specific acknowledgement.
| Field | Default | What it does |
|---|---|---|
status_code | 200 | Status code of the reply. |
content_type | application/json | Content type of the reply. |
body | {"status": "accepted"} | Body of the reply, verbatim. |
Example
curl -X POST "$SIMETRIK_INGESTION_URL/api/v2/webhooks" \
-H "x-api-key: $SIMETRIK_API_KEY" \
-H "x-skt-workspace: 886" \
-H "x-skt-account: 23" \
-H "Content-Type: application/json" \
-d '{
"name": "Settlement files from the core",
"webhook": {
"file_mapping": {
"url_field": "data.file.url",
"filename_field": "data.file.name"
},
"credentials": {
"type": "bearer",
"token": "'"$FILE_SERVER_TOKEN"'"
},
"response_config": {
"status_code": 202,
"content_type": "application/json",
"body": {"notification": "accepted"}
}
}
}'Response
201 Created:
{
"id": 61171,
"name": "Settlement files from the core",
"webhook_id": "61171_wh_9d200105"
}| Field | What to do with it |
|---|---|
id | The source id. |
webhook_id | Goes in the path of every notification you send. |
webhook_id is a credential. Anyone who has it can queue files into your source, so store it the way you'd store an API key and rotate it — by registering a new webhook — if it leaks.
Errors
| Status | Meaning | What to change |
|---|---|---|
400 | The platform rejected the source definition. | Check the errors array; a duplicate name is the usual cause. |
403 | Authorization failed. | See Authentication. |
422 | Missing name or webhook, or a field that didn't validate. | The errors array names each one. |
502 | Storage provisioning failed upstream. | Transient. Retry. |
500 | Unexpected error. | Retry; if it persists, contact support. |