Read the account
Returns the brand a key belongs to, the brand's reporting settings, and the key's own name and scopes.
GET
https://mta.growthdept.ai/api/v1/exports/accountRequest#
Request
curl "https://mta.growthdept.ai/api/v1/exports/account" \
-H "Authorization: $MTA_API_KEY" \
-H "Data-Client-ID: $MTA_BRAND_ID"Response#
Response 200
{
"data_client_id": "4b8f2e61-9a3c-4d7e-8f15-6c2a9e0b7d44",
"brand": {
"id": "4b8f2e61-9a3c-4d7e-8f15-6c2a9e0b7d44",
"name": "Example Brand",
"slug": "example-brand"
},
"timezone": "America/Los_Angeles",
"currency": "USD",
"lookback_days": 90,
"attribution_models": [
{ "id": "northbeam_custom", "name": "Clicks only" },
{ "id": "first_touch", "name": "First touch" },
{ "id": "last_touch", "name": "Last touch" },
{ "id": "last_touch_non_direct", "name": "Last non-direct touch" },
{ "id": "linear", "name": "Linear" }
],
"attribution_windows": ["1", "3", "7", "14", "30", "60", "90", "lifetime"],
"api_key": {
"id": "0c5a7f12-3e9d-4b61-a8c4-5d2f1e7b9a06",
"name": "Warehouse reader",
"prefix": "mta_AbCdEfGh",
"scopes": ["export:read"]
}
}Authentication#
Send the API key in Authorization and the brand id in Data-Client-ID. Any valid key may call this endpoint, whatever its scopes.
| Header | Type | Description |
|---|---|---|
Authorizationrequired | string | The API key. See Authentication. |
Data-Client-IDrequired | uuid | The brand id. |
Response fields#
| Field | Type | Description |
|---|---|---|
data_ | string (uuid) | The brand id: the value you send as Data-Client-ID. |
brand | object | The brand's id, name and slug. |
timezone | string | The brand's IANA time zone. Every date in an export is a business date in this zone. |
currency | string | The brand's three-letter currency code. Every money column in an export is in this currency. |
lookback_ | integer | How many days before an order a touch can still earn credit: 1 to 400, 90 unless the brand changed it. |
attribution_ | array | The models enabled for the brand, in the brand's order. id is what an export request sends; name is what the app shows. |
attribution_ | array of strings | The windows enabled for the brand. lifetime is the Cash snapshot window and is never sent in a request. |
api_ | object | The key that made the request: id, name, prefix (its first 12 characters) and scopes. |
Status codes#
| Status | Meaning | Body |
|---|---|---|
| 200 | The account, as above. | |
| 401 | No key, an unknown or revoked key, or a key that belongs to another brand than Data-Client-ID. | { "detail": "Unauthorized: send a valid API key in Authorization and its brand id in Data-Client-ID." } |
| 429 | More than 100 requests in one second from this key. Wait the seconds in Retry-After. | { "detail": "Rate limit exceeded: 100 requests per second per API key. Retry after 1 seconds." } |
| 500 | Something failed on our side. Retry later. | { "detail": "Internal server error." } |
When to call it#
Call it first when you set up a client. A 200 proves that the key and the brand id belong together, and the answer lists the model ids and windows an export request can use for this brand.
Read timezone and currency before you load exports into a warehouse: dates in export files are the brand's business dates, and money is in the brand's currency.
Questions about the API: support@growthdept.ai.