Email domain policy admin
Package: agentrouter.billing.v1 Service: EmailDomainPolicyAdminService
Endpoints
List email domain policies
Changed in v0.9.0 (new features): Administrators can list, export, create, edit, deactivate and import email domain policies through the API. One import takes at most 100000 rows. The API answers only where bonus claims are on: ENABLE_BONUS_CLAIM is "true" on the management plane API and corporate login is off. Otherwise every call returns FAILED_PRECONDITION.
What it does: Returns one page of policies, the number of matches, and the counts of every policy.
Request fields:
| Field | Required | Description |
|---|---|---|
customer_id | yes | The organization the caller reads as. Required. Every organization sees the same global list. |
category | no | Only policies of this category. UNSPECIFIED means every category. |
is_active | no | Only active (true) or inactive (false) policies. Absent means both. |
search | no | A case-insensitive substring of the domain, normalized domain or reason. At most 255 characters. |
page_size | no | Page size, 1 to 100. 0 selects 10. |
offset | no | Number of matching policies to skip. |
Response fields:
| Field | Required | Description |
|---|---|---|
policies | no | The page, most recently changed first. |
total_count | no | Number of policies that match the filters. |
stats | no | Counts of every policy, whatever the filters. |
{"signatures":{"go":"c.EmailDomainPolicyAdmin().ListEmailDomainPolicies(ctx, \u0026billingv1.ListEmailDomainPoliciesRequest{...})","python":"client.emaildomainpolicyadmin.listemaildomainpolicies(...)","typescript":"client.emaildomainpolicyadmin.listemaildomainpolicies({...})","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/billing/email-domain-policies?customer_id=cust_01H...\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"examples":{"go":"// No Go SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/billing/email-domain-policies?customer_id=cust_01H...\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"persona":"Admin","httpVerb":"GET","httpPath":"/v1/billing/email-domain-policies","slug":"list-email-domain-policies"}
Get an email domain policy
Changed in v0.9.0 (new features): Administrators can list, export, create, edit, deactivate and import email domain policies through the API. One import takes at most 100000 rows. The API answers only where bonus claims are on: ENABLE_BONUS_CLAIM is "true" on the management plane API and corporate login is off. Otherwise every call returns FAILED_PRECONDITION.
What it does: Returns one policy.
Request fields:
| Field | Required | Description |
|---|---|---|
customer_id | yes | The organization the caller reads as. Required. |
id | yes | UUID of the policy. |
Response fields:
| Field | Required | Description |
|---|---|---|
policy | no | The policy. |
{"signatures":{"go":"c.EmailDomainPolicyAdmin().GetEmailDomainPolicy(ctx, \u0026billingv1.GetEmailDomainPolicyRequest{...})","python":"client.emaildomainpolicyadmin.getemaildomainpolicy(...)","typescript":"client.emaildomainpolicyadmin.getemaildomainpolicy({...})","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/billing/email-domain-policies/01H...?customer_id=cust_01H...\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"examples":{"go":"// No Go SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/billing/email-domain-policies/01H...?customer_id=cust_01H...\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"persona":"Admin","httpVerb":"GET","httpPath":"/v1/billing/email-domain-policies/{id}","slug":"get-an-email-domain-policy"}
Export email domain policies
Changed in v0.9.0 (new features): Administrators can list, export, create, edit, deactivate and import email domain policies through the API. One import takes at most 100000 rows. The API answers only where bonus claims are on: ENABLE_BONUS_CLAIM is "true" on the management plane API and corporate login is off. Otherwise every call returns FAILED_PRECONDITION.
What it does: Returns every policy that matches the filters.
Request fields:
| Field | Required | Description |
|---|---|---|
customer_id | yes | The organization the caller reads as. Required. |
category | no | Only policies of this category. UNSPECIFIED means every category. |
is_active | no | Only active (true) or inactive (false) policies. Absent means both. |
search | no | A case-insensitive substring of the domain, normalized domain or reason. |
Response fields:
| Field | Required | Description |
|---|---|---|
policies | no | Every matching policy, most recently changed first. |
{"signatures":{"go":"c.EmailDomainPolicyAdmin().ExportEmailDomainPolicies(ctx, \u0026billingv1.ExportEmailDomainPoliciesRequest{...})","python":"client.emaildomainpolicyadmin.exportemaildomainpolicies(...)","typescript":"client.emaildomainpolicyadmin.exportemaildomainpolicies({...})","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/billing/email-domain-policies:export?customer_id=cust_01H...\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"examples":{"go":"// No Go SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/billing/email-domain-policies:export?customer_id=cust_01H...\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"persona":"Admin","httpVerb":"GET","httpPath":"/v1/billing/email-domain-policies:export","slug":"export-email-domain-policies"}
Create an email domain policy
Changed in v0.9.0 (new features): Administrators can list, export, create, edit, deactivate and import email domain policies through the API. One import takes at most 100000 rows. The API answers only where bonus claims are on: ENABLE_BONUS_CLAIM is "true" on the management plane API and corporate login is off. Otherwise every call returns FAILED_PRECONDITION.
What it does: Adds a policy.
Request fields:
| Field | Required | Description |
|---|---|---|
customer_id | yes | Must be the deployment organization, unless the caller holds platform_bonus_claims_admin. |
domain | yes | A host name, at most 255 characters. A domain that another policy holds, after normalization, returns ALREADY_EXISTS. |
category | yes | How bonus claims from this domain are treated. |
reason | no | At most 500 characters. Blank means no reason. |
is_active | no | Absent means true. |
Response fields:
| Field | Required | Description |
|---|---|---|
policy | no | The new policy. |
{"signatures":{"go":"c.EmailDomainPolicyAdmin().CreateEmailDomainPolicy(ctx, \u0026billingv1.CreateEmailDomainPolicyRequest{...})","python":"client.emaildomainpolicyadmin.createemaildomainpolicy(...)","typescript":"client.emaildomainpolicyadmin.createemaildomainpolicy({...})","curl":"curl -X POST \"${AGENTROUTER_BASE_URL}/v1/billing/email-domain-policies\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"customer_id\": \"...\",\n \"domain\": \"...\",\n \"category\": \"...\",\n \"reason\": \"...\",\n \"is_active\": false\n }'"},"examples":{"go":"// No Go SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","curl":"curl -X POST \"${AGENTROUTER_BASE_URL}/v1/billing/email-domain-policies\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"customer_id\": \"...\",\n \"domain\": \"...\",\n \"category\": \"...\",\n \"reason\": \"...\",\n \"is_active\": false\n }'"},"persona":"Admin","httpVerb":"POST","httpPath":"/v1/billing/email-domain-policies","slug":"create-an-email-domain-policy"}
Update an email domain policy
Changed in v0.9.0 (new features): Administrators can list, export, create, edit, deactivate and import email domain policies through the API. One import takes at most 100000 rows. The API answers only where bonus claims are on: ENABLE_BONUS_CLAIM is "true" on the management plane API and corporate login is off. Otherwise every call returns FAILED_PRECONDITION.
What it does: Changes the fields the request sets.
Request fields:
| Field | Required | Description |
|---|---|---|
customer_id | yes | Must be the deployment organization, unless the caller holds platform_bonus_claims_admin. |
id | yes | UUID of the policy. |
domain | no | Each field that is set is changed; at least one must be set. A change to domain, category, reason or is_active also sets last_reviewed_at to now, unless the request sets last_reviewed_at. |
category | no | UNSPECIFIED leaves the category as it is. |
reason | no | An empty reason removes the reason. |
is_active | no | Turns the policy on or off. |
last_reviewed_at | no | When a person last reviewed the policy. |
Response fields:
| Field | Required | Description |
|---|---|---|
policy | no | The changed policy. |
{"signatures":{"go":"c.EmailDomainPolicyAdmin().UpdateEmailDomainPolicy(ctx, \u0026billingv1.UpdateEmailDomainPolicyRequest{...})","python":"client.emaildomainpolicyadmin.updateemaildomainpolicy(...)","typescript":"client.emaildomainpolicyadmin.updateemaildomainpolicy({...})","curl":"curl -X PATCH \"${AGENTROUTER_BASE_URL}/v1/billing/email-domain-policies/01H...\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"customer_id\": \"...\",\n \"domain\": \"...\",\n \"category\": \"...\",\n \"reason\": \"...\",\n \"is_active\": false,\n \"last_reviewed_at\": {}\n }'"},"examples":{"go":"// No Go SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","curl":"curl -X PATCH \"${AGENTROUTER_BASE_URL}/v1/billing/email-domain-policies/01H...\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"customer_id\": \"...\",\n \"domain\": \"...\",\n \"category\": \"...\",\n \"reason\": \"...\",\n \"is_active\": false,\n \"last_reviewed_at\": {}\n }'"},"persona":"Admin","httpVerb":"PATCH","httpPath":"/v1/billing/email-domain-policies/{id}","slug":"update-an-email-domain-policy"}
Deactivate an email domain policy
Changed in v0.9.0 (new features): Administrators can list, export, create, edit, deactivate and import email domain policies through the API. One import takes at most 100000 rows. The API answers only where bonus claims are on: ENABLE_BONUS_CLAIM is "true" on the management plane API and corporate login is off. Otherwise every call returns FAILED_PRECONDITION.
What it does: Stops a policy from applying. The policy is kept; UpdateEmailDomainPolicy with is_active=true turns it back on.
Request fields:
| Field | Required | Description |
|---|---|---|
customer_id | yes | Must be the deployment organization, unless the caller holds platform_bonus_claims_admin. |
id | yes | UUID of the policy. |
Response fields:
| Field | Required | Description |
|---|---|---|
policy | no | The policy, now inactive. |
{"signatures":{"go":"c.EmailDomainPolicyAdmin().DeactivateEmailDomainPolicy(ctx, \u0026billingv1.DeactivateEmailDomainPolicyRequest{...})","python":"client.emaildomainpolicyadmin.deactivateemaildomainpolicy(...)","typescript":"client.emaildomainpolicyadmin.deactivateemaildomainpolicy({...})","curl":"curl -X POST \"${AGENTROUTER_BASE_URL}/v1/billing/email-domain-policies/01H...:deactivate\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"customer_id\": \"...\"\n }'"},"examples":{"go":"// No Go SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","curl":"curl -X POST \"${AGENTROUTER_BASE_URL}/v1/billing/email-domain-policies/01H...:deactivate\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"customer_id\": \"...\"\n }'"},"persona":"Admin","httpVerb":"POST","httpPath":"/v1/billing/email-domain-policies/{id}:deactivate","slug":"deactivate-an-email-domain-policy"}
Import email domain policies
Changed in v0.9.0 (new features): Administrators can list, export, create, edit, deactivate and import email domain policies through the API. One import takes at most 100000 rows. The API answers only where bonus claims are on: ENABLE_BONUS_CLAIM is "true" on the management plane API and corporate login is off. Otherwise every call returns FAILED_PRECONDITION.
What it does: Creates and updates policies from a file. Each valid row is written; each row that fails is reported, and the others still commit. validate_only previews the import and writes nothing. Requests up to 64 MiB are accepted.
Request fields:
| Field | Required | Description |
|---|---|---|
customer_id | yes | Must be the deployment organization, unless the caller holds platform_bonus_claims_admin. |
rows | no | The rows, at least one and at most 100000. A row whose domain a policy already holds updates that policy. |
validate_only | no | When true, nothing is written and the response carries a preview. |
preview_sample_limit | no | The number of sample rows of each kind in a preview. 0 selects 50; at most 1000. |
Response fields:
| Field | Required | Description |
|---|---|---|
preview | no | Set when validate_only was true. |
result | no | Set when validate_only was false. |
{"signatures":{"go":"c.EmailDomainPolicyAdmin().ImportEmailDomainPolicies(ctx, \u0026billingv1.ImportEmailDomainPoliciesRequest{...})","python":"client.emaildomainpolicyadmin.importemaildomainpolicies(...)","typescript":"client.emaildomainpolicyadmin.importemaildomainpolicies({...})","curl":"curl -X POST \"${AGENTROUTER_BASE_URL}/v1/billing/email-domain-policies:import\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"customer_id\": \"...\",\n \"rows\": [],\n \"validate_only\": false,\n \"preview_sample_limit\": 0\n }'"},"examples":{"go":"// No Go SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for EmailDomainPolicyAdminService yet -- use the CLI or curl example below.","curl":"curl -X POST \"${AGENTROUTER_BASE_URL}/v1/billing/email-domain-policies:import\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"customer_id\": \"...\",\n \"rows\": [],\n \"validate_only\": false,\n \"preview_sample_limit\": 0\n }'"},"persona":"Admin","httpVerb":"POST","httpPath":"/v1/billing/email-domain-policies:import","slug":"import-email-domain-policies"}