Create a source
POST /api/v2/sources — declare the name and column schema of the source your records will feed.
Creates the source in Simetrik and registers it for ingestion. Call it once per source; every record you post afterwards refers to the id it returns.
POST /api/v2/sourcesHeaders
| Header | Required | Value |
|---|---|---|
x-api-key | Yes | Your API key. |
x-skt-workspace | Yes | Workspace to create the source in. |
x-skt-account | Yes | Account id. |
Content-Type | Yes | application/json |
See Authentication.
Body
| Field | Type | Required | What it does |
|---|---|---|---|
name | string | Yes | Source name, as it will appear in the platform. |
columns | array | Yes | The column schema. At least one column. |
folder_id | integer | No | Folder to create the source in. Omitted means the default location. |
notification_config | object | No | Where to call you back as files move. See Status notifications. |
Each entry in columns:
| Field | Type | What it does |
|---|---|---|
name | string | Column name in the resulting CSV. |
position | integer | Order in the CSV, starting at 1. |
mapping | string | Path to the value in your JSON. Dot notation for nested objects. |
data_type | string | string, numeric, integer, boolean, date, datetime or time. |
format_notation | string | Input format, mostly for dates. "" when it doesn't apply. |
Example
curl -X POST "$SIMETRIK_INGESTION_URL/api/v2/sources" \
-H "x-api-key: $SIMETRIK_API_KEY" \
-H "x-skt-workspace: 886" \
-H "x-skt-account: 23" \
-H "Content-Type: application/json" \
-d '{
"name": "Card settlements",
"columns": [
{"name": "id", "position": 1, "mapping": "id", "data_type": "string", "format_notation": ""},
{"name": "amount", "position": 2, "mapping": "amount", "data_type": "numeric", "format_notation": ""},
{"name": "method", "position": 3, "mapping": "payment.method", "data_type": "string", "format_notation": ""},
{"name": "paid_at", "position": 4, "mapping": "paid_at", "data_type": "datetime", "format_notation": "yyyy-MM-dd HH:mm:ss"}
]
}'Response
201 Created:
{
"id": 61171,
"name": "Card settlements",
"resource_type": "SOURCE",
"path": "…/source_id=61171/"
}| Field | What to do with it |
|---|---|
id | The source id. Keep it — it's what ties your files to this source. |
name | As created. |
resource_type | Which delivery target your workspace uses. See Key concepts. |
path | Where the processed files are delivered. |
Keep the id: it goes in the path of every record you post.
Errors
| Status | Meaning | What to change |
|---|---|---|
400 | The platform rejected the source definition. The errors array says which field. | Usually a duplicate name or an invalid column. |
403 | Authorization failed. | See Authentication. |
422 | The body didn't validate — missing field, unknown data_type, malformed notification_config. | The errors array lists each problem as field: message. |
502 | Storage provisioning failed upstream. | Transient. Retry; if it persists, contact support. |
500 | Unexpected error. | Retry; if it persists, contact support. |
An earlier path, POST /v1/create-source, is still served for existing integrations.
Creating a source is not idempotent. A retry after a timeout can leave you with two sources of the same name — check before you call again.