Register a seed test and get its addresses
/v1/email/inbox-insights/seed-tests// Requires Insights preview access for the organization.
const idempotencyKey = process.env.IDEMPOTENCY_KEY;
if (!idempotencyKey) throw new Error("Set IDEMPOTENCY_KEY to a unique key for this registration and retain it for retries");
let sendingDomain: string | undefined;
for await (const domain of bird.email.inboxInsights.domains.list({ search: "mail.example.com" })) {
if (domain.domain === "mail.example.com") { sendingDomain = domain.domain; break; }
}
if (!sendingDomain) throw new Error("Verify mail.example.com in this workspace first");
const configuration = await bird.email.inboxInsights.seedTests.configuration.get({ sending_domain: sendingDomain });
const pool = configuration.list_types.find(choice => choice.available);
const profile = configuration.engagement_profiles.find(choice => choice.available);
const region = configuration.regions[0];
if (!pool || !profile || !region) throw new Error("No seed-test options available");
const report = await bird.email.inboxInsights.seedTests.create({ sending_domain: sendingDomain, list_type: pool.value, engagement_profile: profile.value, regions: [region.value] }, { idempotencyKey });
console.log(report);# Requires Insights preview access for the organization.
import os
idempotency_key = os.getenv("IDEMPOTENCY_KEY")
if not idempotency_key:
raise ValueError("Set IDEMPOTENCY_KEY to a unique key for this registration and retain it for retries")
sending_domain = None
for domain in client.email.inbox_insights.domains.list(search="mail.example.com"):
if domain.domain == "mail.example.com":
sending_domain = domain.domain
break
if sending_domain is None:
raise ValueError("Verify mail.example.com in this workspace first")
configuration = client.email.inbox_insights.seed_tests.configuration.get(sending_domain=sending_domain)
pool = next((choice for choice in configuration.list_types if choice.available), None)
profile = next((choice for choice in configuration.engagement_profiles if choice.available), None)
if pool is None or profile is None or not configuration.regions:
raise ValueError("No seed-test options available")
report = client.email.inbox_insights.seed_tests.create(sending_domain=sending_domain, list_type=pool.value, engagement_profile=profile.value, regions=[configuration.regions[0].value], options={"idempotency_key": idempotency_key})
print(report.model_dump_json())// Requires Insights preview access for the organization.
idempotencyKey := os.Getenv("IDEMPOTENCY_KEY")
if idempotencyKey == "" {
log.Fatal("Set IDEMPOTENCY_KEY to a unique key for this registration and retain it for retries")
}
client, err := bird.NewClient(option.WithAPIKey(os.Getenv("BIRD_API_KEY")))
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
sendingDomain := ""
for domain, err := range client.Email.InboxInsights.Domains.List(ctx, bird.EmailInboxInsightsDomainsListParams{Search: "mail.example.com"}) {
if err != nil {
log.Fatal(err)
}
if domain.Domain != nil && *domain.Domain == "mail.example.com" {
sendingDomain = *domain.Domain
break
}
}
if sendingDomain == "" {
log.Fatal("Verify mail.example.com in this workspace first")
}
configuration, err := client.Email.InboxInsights.SeedTests.Configuration.Get(ctx, bird.EmailInboxInsightsSeedTestsConfigurationGetParams{SendingDomain: sendingDomain})
if err != nil {
log.Fatal(err)
}
var pool, profile string
for _, choice := range *configuration.ListTypes {
if choice.Available != nil && *choice.Available {
pool = string(choice.Value)
break
}
}
for _, choice := range *configuration.EngagementProfiles {
if choice.Available != nil && *choice.Available {
profile = string(choice.Value)
break
}
}
if pool == "" || profile == "" || configuration.Regions == nil || len(*configuration.Regions) == 0 {
log.Fatal("No seed-test options available")
}
report, err := client.Email.InboxInsights.SeedTests.Create(ctx, bird.EmailInboxInsightsSeedTestsCreateParams{SendingDomain: sendingDomain, ListType: bird.EmailInboxInsightsSeedListType(pool), EngagementProfile: bird.EmailInboxInsightsSeedEngagementProfile(profile), Regions: []string{*(*configuration.Regions)[0].Value}}, option.WithIdempotencyKey(idempotencyKey))
if err != nil {
log.Fatal(err)
}
fmt.Println(report)// Requires Insights preview access for the organization.
$idempotencyKey = getenv('IDEMPOTENCY_KEY');
if ($idempotencyKey === false || $idempotencyKey === '') {
throw new \RuntimeException('Set IDEMPOTENCY_KEY to a unique key for this registration and retain it for retries');
}
$sendingDomain = null;
foreach ($bird->email->inboxInsights->domains->list(['search' => 'mail.example.com']) as $domain) {
if ($domain->getDomain() === 'mail.example.com') {
$sendingDomain = $domain->getDomain();
break;
}
}
if ($sendingDomain === null) {
throw new \RuntimeException('Verify mail.example.com in this workspace first');
}
$configuration = $bird->email->inboxInsights->seedTests->configuration->get(['sending_domain' => $sendingDomain]);
$pools = array_values(array_filter($configuration->getListTypes() ?? [], static fn ($choice) => $choice->getAvailable() === true));
$profiles = array_values(array_filter($configuration->getEngagementProfiles() ?? [], static fn ($choice) => $choice->getAvailable() === true));
$regions = $configuration->getRegions() ?? [];
$region = ($regions[0] ?? null)?->getValue();
if ($pools === [] || $profiles === [] || $region === null) {
throw new \RuntimeException('No seed-test options available');
}
$params = (new \MessageBird\Wire\Model\EmailInboxInsightsSeedTestCreate())
->setSendingDomain($sendingDomain)
->setListType($pools[0]->getValue())
->setEngagementProfile($profiles[0]->getValue())
->setRegions([$region]);
$report = $bird->email->inboxInsights->seedTests->create($params, new RequestOptions(idempotencyKey: $idempotencyKey));
var_dump($report);bird email inbox-insights seed-tests create \
--engagement-profile all \
--label 'Fall preview send' \
--list-type private \
--regions 'North America - US' \
--regions 'Europe - UK' \
--sending-domain mail.acme.com \
--idempotency-key "${IDEMPOTENCY_KEY:?Set a fresh key for a new request; reuse it for retries}"curl -X POST "https://us1.platform.bird.com/v1/email/inbox-insights/seed-tests" \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: ${IDEMPOTENCY_KEY:?Set a unique key for this operation and retain it for retries}" \
-H "Content-Type: application/json" \
-d '{
"sending_domain": "mail.acme.com",
"list_type": "private",
"engagement_profile": "all",
"regions": [
"North America - US",
"Europe - UK"
],
"label": "Fall preview send"
}'{
"registration_id": "43ea66c8-6837-48a4-b81b-26fdf5cc8cd8",
"seed_addresses": [
{
"address": "sd8241.hk@example-seeds.net",
"mailbox_provider": "gmail",
"region": "North America - US",
"engaging": true
}
],
"seed_count": 212,
"expires_at": "2026-08-27T09:12:00Z"
}
Registers a seed test for a sending domain and returns the seed addresses it measures.
Registering a test does not add the addresses to a send. Include them in the recipients of the send you want measured, and results appear as the seed mail arrives. A test that receives no seed mail before it expires never produces results.
The test appears in the seed-test list for the domain once its seed mail has been measured, carrying the subject and the date of the send it rode on. Those two fields are what tell you the send has happened.
Registering spends one of the organization's seed-test allowance whether or not the send goes out, and an expired test does not return it, so register when the send you want measured is ready. The configuration endpoint reports which seed pools, regions, and engagement behaviours this domain's account can use.
Send an Idempotency-Key and reuse it with the unchanged request when retrying
a lost response. Before running the curl example, set IDEMPOTENCY_KEY to a
unique key for this registration and retain it for retries of the same intent.
If registration cannot be confirmed, the API returns
409 E27008 and retains that outcome for keyed retries while the replay result
remains available. The allowance may have been used. Contact support before
starting another test; a new key or a request without a key can register
another batch. A replay does not recover addresses from an uncertain result.
Scoped API keys, OAuth and service accounts require organization preview access.
Corps de la requête
sending_domainThe sending domain the test measures: one of the workspace's verified sending domains, exactly as it appears there.
list_typeWhich seed pool to draw addresses from. Use a value the seed-test configuration reports as available for this account.
Possible values (may grow over time): private, public, exclusive
engagement_profileWhich engagement behaviour the seeds should simulate. Mixing both behaviours is what makes the engaged-against-dormant comparison measurable.
Possible values (may grow over time): all, engaging, non_engaging
regionsThe regions to place seeds in, as the seed-test configuration names them.
labelA name attached to this registration. It is not returned in seed-test history.
Contenu de la réponse
registration_idIdentifies this registration. It is not the identifier the seed-test list reports for the resulting test.
It is here so a registration can be quoted in a support conversation, and so a client can tell two registrations apart. To read the results, find the test in the seed-test list for this domain.
seed_addressesEvery address to include in the tested send. Copy them into the send's recipients; results are measured from mail these addresses receive.
seed_countHow many seed addresses the test issued.
expires_atWhen the test expires if no seed mail has arrived. An expired test never produces results, and the allowance it spent is not returned, so send before this time.
Ressources associées
Poursuivez avec la documentation, les guides et les exemples sur ce sujet.