Create or update customer ingest aliases
curl --request POST \
--url https://api.metronome.com/v1/customers/{customer_id}/setIngestAliases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ingest_aliases": [
"team@example.com"
]
}
'import requests
url = "https://api.metronome.com/v1/customers/{customer_id}/setIngestAliases"
payload = { "ingest_aliases": ["team@example.com"] }
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({ingest_aliases: ['team@example.com']})
};
fetch('https://api.metronome.com/v1/customers/{customer_id}/setIngestAliases', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.metronome.com/v1/customers/{customer_id}/setIngestAliases",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ingest_aliases' => [
'team@example.com'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.metronome.com/v1/customers/{customer_id}/setIngestAliases"
payload := strings.NewReader("{\n \"ingest_aliases\": [\n \"team@example.com\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.metronome.com/v1/customers/{customer_id}/setIngestAliases")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ingest_aliases\": [\n \"team@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.metronome.com/v1/customers/{customer_id}/setIngestAliases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ingest_aliases\": [\n \"team@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_bodyCustomers
Create or update customer ingest aliases
Sets the ingest aliases for a customer. Use this endpoint to associate a Metronome customer with an internal ID for easier tracking between systems. Ingest aliases can be used in the customer_id field when sending usage events to Metronome.
Usage guidelines:
- This call is idempotent and fully replaces the set of ingest aliases for the given customer.
- Switching an ingest alias from one customer to another will associate all corresponding usage to the new customer.
- Use multiple ingest aliases to model child organizations within a single Metronome customer.
POST
/
v1
/
customers
/
{customer_id}
/
setIngestAliases
Create or update customer ingest aliases
curl --request POST \
--url https://api.metronome.com/v1/customers/{customer_id}/setIngestAliases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ingest_aliases": [
"team@example.com"
]
}
'import requests
url = "https://api.metronome.com/v1/customers/{customer_id}/setIngestAliases"
payload = { "ingest_aliases": ["team@example.com"] }
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({ingest_aliases: ['team@example.com']})
};
fetch('https://api.metronome.com/v1/customers/{customer_id}/setIngestAliases', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.metronome.com/v1/customers/{customer_id}/setIngestAliases",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ingest_aliases' => [
'team@example.com'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.metronome.com/v1/customers/{customer_id}/setIngestAliases"
payload := strings.NewReader("{\n \"ingest_aliases\": [\n \"team@example.com\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.metronome.com/v1/customers/{customer_id}/setIngestAliases")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ingest_aliases\": [\n \"team@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.metronome.com/v1/customers/{customer_id}/setIngestAliases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ingest_aliases\": [\n \"team@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
The aliases to add
Maximum array length:
2000Required string length:
1 - 128Response
200
Success