Skip to main content
POST/v1/sources

Create a source

Creates a new ingestion source and returns the write key prefix plus installation metadata.

Authentication

Requires Authorization: Bearer ${API_KEY}. Create and rotate keys from the TrackLayer dashboard.

Request body schema

{
  "name": "string",
  "type": "web | server | mobile | warehouse",
  "domain": "string"
}

Response schema · 201

{
  "id": "src_123",
  "write_key_prefix": "tl_src_",
  "created_at": "2026-05-05T10:15:00Z"
}

Response example

{
  "id": "src_123",
  "write_key_prefix": "tl_src_",
  "created_at": "2026-05-05T10:15:00Z"
}

Code examples

curl https://api.tracklayer.com/v1/sources \
  -X POST \
  -H "Authorization: Bearer ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"event_name":"purchase","user_id":"u_123","properties":{"order_id":"100045","value":129}}'

Try it out

Use the dashboard to create an API key, then run one of the examples above with TRACKLAYER_API_KEY set in your environment.

Open API key settings

We use essential cookies to keep the site secure and functional. Analytics and third-party tags run only with your consent. See our Cookie Policy.

We use essential cookies to keep the site secure and functional. Analytics and third-party tags run only with your consent. See our Cookie Policy.