curl --request POST \
--url https://api.apostra.com/api/v2/inbound-email-addresses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"purpose": "reports"
}
'import requests
url = "https://api.apostra.com/api/v2/inbound-email-addresses"
payload = { "purpose": "reports" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({purpose: 'reports'})
};
fetch('https://api.apostra.com/api/v2/inbound-email-addresses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"address": "coke-reports-k7m2qz4xhd9a@in.staging.apostra.com",
"purpose": "reports",
"handler": "session_intake",
"customerId": 4503599627370495,
"advertiserId": 4503599627370495,
"revision": 4503599627370495,
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"revokedAt": "2023-11-07T05:31:56Z"
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Create inbound email address
Create an email address for briefs or reports. The address is a readable prefix from the account or advertiser name, an unguessable suffix, and the dedicated inbound domain. An advertiser, when given, must belong to this account. An address says where an email belongs, not who sent it. Admin-only. Returns FEATURE_NOT_ENABLED where this environment does not receive inbound email.
curl --request POST \
--url https://api.apostra.com/api/v2/inbound-email-addresses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"purpose": "reports"
}
'import requests
url = "https://api.apostra.com/api/v2/inbound-email-addresses"
payload = { "purpose": "reports" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({purpose: 'reports'})
};
fetch('https://api.apostra.com/api/v2/inbound-email-addresses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"address": "coke-reports-k7m2qz4xhd9a@in.staging.apostra.com",
"purpose": "reports",
"handler": "session_intake",
"customerId": 4503599627370495,
"advertiserId": 4503599627370495,
"revision": 4503599627370495,
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"revokedAt": "2023-11-07T05:31:56Z"
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Authorizations
API key or access token
Body
What the address is for. briefs receives briefs and requests; reports receives reports. The purpose is part of the readable address prefix and selects the handler.
briefs, reports "reports"
Optional advertiser the address belongs to. It must be one of your account’s advertisers; its name becomes the readable prefix.
0 < x <= 9007199254740991Response
Create inbound email address
Stable address ID. It stays the same when the address is rotated.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$The email address to send to: a readable prefix, an unguessable suffix and the dedicated inbound domain.
^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$"coke-reports-k7m2qz4xhd9a@in.staging.apostra.com"
What the address is for. briefs receives briefs and requests; reports receives reports. The purpose is part of the readable address prefix and selects the handler.
briefs, reports "reports"
Where received mail is delivered. session_intake records each message privately in the account’s shared Session.
session_intake Customer account that owns this address
0 < x <= 9007199254740991The advertiser this address belongs to, or null for an account-wide address
0 < x <= 9007199254740991Increases by one each time the address is rotated
0 < x <= 9007199254740991active addresses receive mail. Mail to a revoked or rotated-away address is refused.
active, revoked When this revision of the address was created
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$When the address stopped receiving, or null while active
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$