Guide: SCIM Provisioning
AgentMail exposes a SCIM 2.0 /Users endpoint. One SCIM user is one inbox: when your identity provider (IdP) assigns a user to the AgentMail app, the inbox is created; when it deactivates the user, the inbox is suspended; when it deletes the user, the inbox is deleted.
SCIM provisioning is enabled per organization and is available to organizations on usage billing (no inbox limit). Contact support@agentmail.to to enable it.
What you need
The base URL
https://api.agentmail.to/v0/scim
Use the API base URL for your account’s region. To provision into one pod instead of the whole organization, see Pod-scoped SCIM.
An API key
Navigate to Dashboard → API Keys and create an organization key with the Manage inboxes access preset. It grants exactly inbox_read, inbox_create, inbox_update and inbox_delete: the team that holds it can open and close inboxes, but cannot read mail or manage other keys.
The IdP sends the key as Authorization: Bearer <key>. Any organization- or pod-scoped key with those four permissions works; inbox-scoped keys are refused.
A domain
Each userName the IdP sends must be an address on agentmail.to or on a custom domain verified in your organization. Decide which domain your agents’ addresses live on before mapping attributes.
Attribute mapping
What each operation does
The SCIM id is an opaque identifier, not the address. GET /Users supports filter=userName eq "…" and filter=externalId eq "…", and pages with startIndex and count (at most 100 per page). A scope with more than 5,000 inboxes cannot be listed unfiltered; split it into pods.
Okta
Create the app integration
In the Okta admin console, go to Applications → Browse App Catalog and add SCIM 2.0 Test App (Header Auth), or enable SCIM provisioning on an existing custom app integration (General → App Settings → Provisioning).
Configure the connector
On the Provisioning tab, open Integration and set:
- SCIM connector base URL:
https://api.agentmail.to/v0/scim - Unique identifier field for users:
userName - Supported provisioning actions: Push New Users, Push Profile Updates
- Authentication Mode: HTTP Header, with your API key as the bearer token
Test Connector Configuration should succeed.
Deactivating or unassigning a user suspends its inbox; Okta does not send DELETE. A suspended inbox stays, and keeps counting toward usage, until you delete it in the console or with DELETE /inboxes/{inbox_id}.
Microsoft Entra ID
Automatic provisioning to a non-gallery application needs Microsoft Entra ID P1 or P2.
Create the application
In the Microsoft Entra admin center, go to Enterprise applications → New application → Create your own application, name it, and choose Integrate any other application you don’t find in the gallery (Non-gallery).
Connect provisioning
Open the application’s Provisioning page, choose Automatic, and under Admin Credentials set:
- Tenant URL:
https://api.agentmail.to/v0/scim - Secret Token: your API key
Test Connection should succeed.
Unassigning or soft-deleting a user in Entra suspends its inbox. Thirty days after a user is deleted in Entra, Entra sends DELETE, and the inbox is deleted with its address retired.
Pod-scoped SCIM for platforms
If you run a platform where each of your customers wants to manage their own agents from their own IdP, give each customer a pod and a pod-scoped key:
- Base URL:
https://api.agentmail.to/v0/pods/{pod_id}/scim - API key: a key scoped to that pod, created with the Manage inboxes preset
The customer’s IdP then sees and manages only that pod’s inboxes. externalId values are namespaced per pod, so two customers’ IdPs can send the same ids without colliding. Your own organization-scoped key still sees every inbox, and can also use /v0/pods/{pod_id}/scim for any pod.
Errors
Every error uses the SCIM error body:
