> For the complete documentation index, see [llms.txt](https://docs.devtodev.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devtodev.com/3rd-party-sources/3-rd-party-attribution/custom-postback-api.md).

# Custom postback API

We created special custom postback API endpoint to allow our customers integrate trackers we have not impemented yet. Also you can use this API to transfer data about attribution from your own server if you have such data.

You need your project's API Key which can be obtained by going to Settings -> SDK -> Integration section in Application menu.

```
URL: https://api.devtodev.com/track/install/v1/custom/?apikey={API_KEY}
```

The endpoint accepts request in either GET or POST form. Examples:

```json
POST 
https://api.devtodev.com/track/install/v1/custom/?apikey={API_KEY}  
{
	"field":"value",
	"field":"value",
}

GET 
https://api.devtodev.com/track/install/v1/custom/?apikey={API_KEY}&field=value&field2=value
```

### Field formats

* string: ordinary text string
* uuid: identifiers with following format 0123456789ab-cdef-0123-456789abcde
* country: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
* number: float number (99.99)

### Field list &#x20;

<table data-header-hidden><thead><tr><th>Field</th><th width="181">Type</th><th width="106">Required</th><th>Description</th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Type</strong></td><td><strong>Required</strong></td><td><strong>Description</strong></td></tr><tr><td>install_timestamp</td><td>time</td><td>optional</td><td>Install time, defaults to event time</td></tr><tr><td>click_timestamp</td><td>time</td><td>optional</td><td>Click time, defaults to install time</td></tr><tr><td>publisher_name</td><td>string</td><td>required</td><td>Source</td></tr><tr><td>campaign_name</td><td>string</td><td>optional</td><td>Campaign</td></tr><tr><td>campaign_id</td><td>string</td><td>optional</td><td>Campaign identifier</td></tr><tr><td>country_code</td><td>ISO 3166-1 alpha-2</td><td>optional</td><td>Country</td></tr><tr><td>s_publisher_name</td><td>string</td><td>optional</td><td>Sub-publisher</td></tr><tr><td>s_publisher</td><td>string</td><td>optional</td><td>Sub-publisher identifier</td></tr><tr><td>s_site_name</td><td>string</td><td>optional</td><td>Sub-site</td></tr><tr><td>s_site</td><td>string</td><td>optional</td><td>Sub-site identifier</td></tr><tr><td>s_adgroup_name</td><td>string</td><td>optional</td><td>Sub-ad group</td></tr><tr><td>s_adgroup</td><td>string</td><td>optional</td><td>Sub-ad group identifier</td></tr><tr><td>s_ad_name</td><td>string</td><td>optional</td><td>Sub-ad</td></tr><tr><td>s_ad</td><td>string</td><td>optional</td><td>Sub-ad identifier</td></tr><tr><td>s_keyword_name</td><td>string</td><td>optional</td><td>Keyword</td></tr><tr><td>s_placement_name</td><td>string</td><td>optional</td><td>Placement</td></tr><tr><td>device_model</td><td>string</td><td>optional</td><td>Device model</td></tr><tr><td>device_brand</td><td>string</td><td>optional</td><td>Device brand</td></tr><tr><td>event_name</td><td>string</td><td>fixed value</td><td>I.e. install</td></tr><tr><td>cost</td><td>number, USD</td><td>optional</td><td>Cost per install (CPI)</td></tr><tr><td>id</td><td>string</td><td>optional</td><td>Unique install identifier usually used by trackers to prevent duplicate installs (if exists)</td></tr><tr><td><strong>At least one of the following identifiers should exist in request:</strong></td><td></td><td></td><td></td></tr><tr><td>ios_ifa</td><td>uuid</td><td>at least one</td><td></td></tr><tr><td>ios_ifv</td><td>uuid</td><td>at least one</td><td></td></tr><tr><td>os_id</td><td>string</td><td>at least one</td><td></td></tr><tr><td>google_aid</td><td>uuid</td><td>at least one</td><td></td></tr><tr><td>windows_aid</td><td>uuid</td><td>at least one</td><td></td></tr><tr><td>user_id</td><td>string</td><td>at least one</td><td>Custom user id. You can apply it if it's set as a <a href="https://docs.devtodev.com/integration/integration-of-sdk-v2/sdk-integration/android#sdk-initialization"><code>userId</code></a> param during SDK init or in <a href="https://docs.devtodev.com/integration/integration-of-sdk-v2/setting-up-events/user-profile#user-id"><code>setUserId</code></a>SDK method or <a href="https://docs.devtodev.com/integration/server-api/data-api"><code>userId</code></a> field in case you are using data API.</td></tr></tbody></table>

### Example request

```json
{
  "install_timestamp": "2024-01-02 18:01:23",
  "click_timestamp": "2024-01-02 18:01:01",
  "publisher_name": "Publisher",
  "campaign_name": "Campaign",  
  "country_code": "US",
  "s_campaign_name": "Advertising campaign name",
  "s_site_name": "Advertisement site",
  "s_adgroup_name": "Ad group",
  "s_ad_name": "Ad",
  "device_model": "Pixel 4",
  "device_brand": "Google",
  "google_aid": "0123456789ab-cdef-0123-456789abcdef",
  "cost": 0.12,
  "event_name": "install"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.devtodev.com/3rd-party-sources/3-rd-party-attribution/custom-postback-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
