{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Products","product_name":"Integration Hub","type":"markdown"},"seo":{"title":"Postback API","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"postback-api","__idx":0},"children":["Postback API"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Data users can ingest data through the public REST API. You can use Treasure Data to create custom webhooks into your data. This article describes the specification of the data import REST API."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["REST API to control databases, tables, jobs, and such; refer to ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/td-api"},"children":["REST APIs in Treasure Data"]},"."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An improved option is available using the Data Ingestion API. Learn more about ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/integration-hub/streaming/importing-table-records-using-the-data-ingestion-api"},"children":["Importing Table Records Using the Data Ingestion API"]},"."]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/integration-hub/streaming/postback-api#prerequisites"},"children":["Prerequisites"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/integration-hub/streaming/postback-api#endpoint"},"children":["Endpoint"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/integration-hub/streaming/postback-api#limitation"},"children":["Limitation"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/integration-hub/streaming/postback-api#post-postbackv3eventdatabasetable"},"children":["POST /postback/v3/event/{database}/{table}"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prerequisites","__idx":1},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Basic knowledge of Treasure Data"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"endpoint","__idx":2},"children":["Endpoint"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All API requests should be sent to the appropriate ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/endpoints/endpoints"},"children":["endpoint for your region."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"limitation","__idx":3},"children":["Limitation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Data does not throttle access at the moment. However, we might limit access to our API, if deemed necessary to ensure the health of our system."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"post-postbackv3eventdatabasetable","__idx":4},"children":["POST /postback/v3/event/{database}/{table}"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"authentication","__idx":5},"children":["Authentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every request must contain ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["authentication information"]},". Authentication can be provided in two ways:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["specifying X-TD-Write-Key HTTP header. The header format is as follows:",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"code","attributes":{},"children":["X-TD-Write-Key: <APIKEY>"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["specifying the td_write_key URL parameter. For example:",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/postback/v3/event/{database}/{table}?td_write_key=<APIKEY>"]}," ","The API key should be URL encoded as all other key/values parameters."]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In case both header and URL parameters are provided, the header takes precedence."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The API key can be retrieved from the Treasure Console. It’s recommended to use ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/control-panel/security/#access-control"},"children":["Write Only API Keys"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"parameters","__idx":6},"children":["Parameters"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["{database}: specify the destination database name in URL. only alphabets/numbers or _ are allowed."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["{table}: specify destination table name in URL. only alphabets/numbers or _ are allowed."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"request-body","__idx":7},"children":["Request Body"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Specify JSON as a body. The JSON content immediately becomes a record in Treasure Data. Also include Content-Type: application/json in HTTP request headers."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"response","__idx":8},"children":["Response"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["HTTP 200 : Success"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["HTTP 400 : Bad Request"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["HTTP 403 : Forbidden"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example","__idx":9},"children":["Example"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Here’s the example curl command to import the record via POST method."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ curl -D a -X POST \\\n-H 'Content-Type: application/json' \\\n-H 'X-TD-Write-Key: XXXX' \\\n--data-binary '{\"param1\":\"value1\", \"param2\":1234}' \\\nhttps://in.treasuredata.com/postback/v3/event/test_db/test_tbl\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ cat a\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"HTTP/1.1 200 OK\nContent-Type: application/json\nDate: Thu, 03 Dec 2015 02:31:32 GMT\nContent-Length: 2\nConnection: keep-alive\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This will ingest the records as shown:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"time\": \"1448344701\",\n  \"param1\": \"value1\",\n  \"param2\": 1234\n}\n","lang":"json"},"children":[]}]},"headings":[{"value":"Postback API","id":"postback-api","depth":1},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"Endpoint","id":"endpoint","depth":2},{"value":"Limitation","id":"limitation","depth":2},{"value":"POST /postback/v3/event/{database}/{table}","id":"post-postbackv3eventdatabasetable","depth":2},{"value":"Authentication","id":"authentication","depth":2},{"value":"Parameters","id":"parameters","depth":3},{"value":"Request Body","id":"request-body","depth":3},{"value":"Response","id":"response","depth":3},{"value":"Example","id":"example","depth":3}],"frontmatter":{"seo":{"title":"Postback API"}},"lastModified":"2026-06-01T09:09:59.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/integration-hub/streaming/postback-api","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}