Agent Identities
Create disposable email + password identity pairs for AI agents. Automate sign-ups, extract verification codes, and long-poll for incoming messages. Requires Pro or Business plan.
/api/agent/identitiesCreate Identity
Create a new agent identity with an auto-generated email address and password. By default, a new inbox is created. Pass an existing inboxId to attach the identity to an existing inbox instead. The password is encrypted and can be retrieved later via the list or get endpoints.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
inboxId | string | No | Attach identity to an existing inbox instead of creating a new one. The inbox must be active and not already have an identity. |
ttlMinutes | number | No | Inbox lifetime in minutes (1-1440, default: 30). Ignored when inboxId is provided. |
prefix | string | No | Email prefix (lowercase alphanumeric, max 20 chars). Ignored when inboxId is provided. |
domain | string | No | Email domain. Defaults to your primary domain. Ignored when inboxId is provided. |
label | string | No | Human-readable label (e.g. 'twitter-signup') |
passwordLength | number | No | Password length (8-64, default: 16) |
persona | boolean | No | Generate a fictional persona (name, address, phone, DOB). Pro/Business only. |
country | string | No | ISO country code for persona (US, UK, AU, CA, DE, FR, JP, BR, IN, ES, IT, NL, KR, MX, SE, PL, NZ). Random if omitted. |
gender | string | No | Persona gender: 'male' or 'female'. Random if omitted. |
{
"ttlMinutes": 30,
"prefix": "agent",
"label": "twitter-signup",
"passwordLength": 16,
"persona": true,
"country": "US",
"gender": "female"
}Response 201
| Field | Type | Description |
|---|---|---|
id | string | Identity ID |
email | string | Generated email address |
password | string | Generated password (retrievable via list/get endpoints) |
inboxId | string | Associated inbox ID |
expiresAt | string | ISO-8601 inbox expiry timestamp |
ttlMinutes | number | Configured TTL |
label | string | null | Identity label |
persona | object | null | Generated persona with firstName, lastName, fullName, gender, country, username, dateOfBirth, address, and phone. Null when not requested. |
{
"id": "ai_Kp9xMn2qLr4vTt7bYw3cZ",
"email": "agentx7k4@748392.best",
"password": "Kx9#mL2pQr4!vB7w",
"inboxId": "ibx_Yh8wNm5tRp2qKs6fVd4eX",
"expiresAt": "2025-02-01T12:30:00.000Z",
"ttlMinutes": 30,
"label": "twitter-signup",
"persona": {
"firstName": "Jessica",
"lastName": "Martinez",
"fullName": "Jessica Martinez",
"gender": "female",
"country": "US",
"username": "jessica_martinez_91",
"dateOfBirth": "1991-06-14",
"address": {
"street": "4721 Oak Street",
"city": "Austin",
"state": "TX",
"zip": "78701",
"formatted": "4721 Oak Street, Austin, TX 78701"
},
"phone": "+1 555-482-7365"
}
}Errors
| Status | Message |
|---|---|
| 403 | Agent identities require a Pro or Business plan |
| 404 | Inbox not found (when inboxId is invalid or not owned by you) |
| 409 | This inbox already has an agent identity attached |
| 429 | Maximum 10 active agent identities allowed |
| 429 | Inbox limit reached |
Code Examples
curl -X POST https://destroy.network/api/agent/identities \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"ttlMinutes": 30, "prefix": "agent", "label": "twitter-signup"}'/api/agent/identitiesList Identities
List all agent identities for the authenticated user, including expired ones. Passwords are decrypted server-side for the authenticated owner.
Response 200
{
"identities": [
{
"id": "ai_Kp9xMn2qLr4vTt7bYw3cZ",
"email": "agentx7k4@748392.best",
"password": "Kx9#mL2pQr4!vB7w",
"inboxId": "ibx_Yh8wNm5tRp2qKs6fVd4eX",
"label": "twitter-signup",
"expiresAt": "2025-02-01T12:30:00.000Z",
"expired": false,
"createdAt": "2025-02-01T12:00:00.000Z",
"persona": null
}
]
}Code Examples
curl https://destroy.network/api/agent/identities \
-H "Authorization: Bearer sk_live_your_api_key"/api/agent/identities/:idGet Identity
Get metadata for a specific identity, including message count and decrypted password.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Identity ID |
Response 200
{
"id": "ai_Kp9xMn2qLr4vTt7bYw3cZ",
"email": "agentx7k4@748392.best",
"password": "Kx9#mL2pQr4!vB7w",
"inboxId": "ibx_Yh8wNm5tRp2qKs6fVd4eX",
"label": "twitter-signup",
"expiresAt": "2025-02-01T12:30:00.000Z",
"expired": false,
"createdAt": "2025-02-01T12:00:00.000Z",
"messageCount": 3,
"persona": null
}Errors
| Status | Message |
|---|---|
| 404 | Identity not found |
Code Examples
curl https://destroy.network/api/agent/identities/{id} \
-H "Authorization: Bearer sk_live_your_api_key"/api/agent/identities/:idDelete Identity
Permanently delete an identity. By default, also deletes the associated inbox and all messages. Pass ?keepInbox=true to remove only the identity and keep the inbox active.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Identity ID |
keepInbox | boolean | No | Query param. When true, only the identity is deleted; the inbox and messages remain. Default: false. |
Response 200
{ "deleted": true }Errors
| Status | Message |
|---|---|
| 404 | Identity not found |
Code Examples
curl -X DELETE https://destroy.network/api/agent/identities/{id} \
-H "Authorization: Bearer sk_live_your_api_key"/api/agent/identities/:idExtend / Update Identity
Extend the inbox TTL from the current time, or update the identity label. Useful when an agent's workflow takes longer than expected and the inbox is about to expire.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Identity ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
ttlMinutes | number | No | New TTL in minutes from now (1-1440). Defaults to plan's extension minutes. |
label | string | No | Updated label for the identity. |
{
"ttlMinutes": 60,
"label": "twitter-signup-retry"
}Response 200
| Field | Type | Description |
|---|---|---|
id | string | Identity ID |
expiresAt | string | New expiry timestamp |
ttlMinutes | number | TTL that was applied |
label | string | null | Current label |
{
"id": "ai_Kp9xMn2qLr4vTt7bYw3cZ",
"expiresAt": "2025-02-01T13:30:00.000Z",
"ttlMinutes": 60,
"label": "twitter-signup-retry"
}Errors
| Status | Message |
|---|---|
| 404 | Identity not found |
Code Examples
curl -X PATCH https://destroy.network/api/agent/identities/{id} \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"ttlMinutes": 60}'/api/agent/identities/:id/verifyExtract Verification
Scan inbox emails for verification codes (OTP, 2FA) and confirmation links. Returns the highest-confidence match. Supports optional long-polling with the timeout parameter. Pass a custom regex pattern for non-standard verification formats.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Identity ID |
timeout | number | No | Long-poll timeout in seconds (0 = instant, max depends on plan: Pro 30s, Business 120s) |
pattern | string | No | Custom regex pattern for code extraction. The first capture group is used as the value. Bypasses built-in extraction when provided. |
Response 200
| Field | Type | Description |
|---|---|---|
found | boolean | Whether a verification code/link was found |
type | string | null | 'code' or 'link' |
value | string | null | The extracted code or URL |
confidence | number | Confidence score (0-1) |
source.messageId | string | ID of the source message |
source.from | string | Sender address |
source.subject | string | Email subject |
rawMatches | array | All matches sorted by confidence |
{
"found": true,
"type": "code",
"value": "847293",
"confidence": 0.95,
"source": {
"messageId": "msg_Rt5wKp8mNq2xYh6cVb3dZ",
"from": "noreply@twitter.com",
"subject": "Your verification code"
},
"rawMatches": [
{ "type": "code", "value": "847293", "confidence": 0.95 }
]
}Errors
| Status | Message |
|---|---|
| 404 | Identity not found |
Code Examples
# Instant check
curl "https://destroy.network/api/agent/identities/{id}/verify" \
-H "Authorization: Bearer sk_live_your_api_key"
# Long-poll for up to 30 seconds
curl "https://destroy.network/api/agent/identities/{id}/verify?timeout=30" \
-H "Authorization: Bearer sk_live_your_api_key"
# Custom regex pattern for non-standard codes
curl "https://destroy.network/api/agent/identities/{id}/verify?timeout=30&pattern=code%3A%20(%5BA-Z0-9%5D%7B3%7D-%5BA-Z0-9%5D%7B3%7D)" \
-H "Authorization: Bearer sk_live_your_api_key"Code patterns: labeled numeric (0.95), labeled alphanumeric (0.93), prefixed like G-847293 (0.90), bold/emphasized HTML (0.85), large-font/styled HTML (0.82), dashed digits (0.80), spaced digits (0.80), standalone 4-8 digit (0.55-0.65)
Link patterns: keyword in URL + text (0.95), keyword in URL or token query param (0.90), keyword in button text (0.85), plain-text URLs near keywords (0.85), standalone URLs when subject matches (0.70)
Confidence boosted by +0.05 for verification subject keywords and +0.03 for noreply/verify sender addresses. Unsubscribe links are automatically filtered out.
Custom pattern: pass a regex via the pattern query param. First capture group is used as value (confidence: 1.0). Built-in extraction is skipped when a pattern is provided.
/api/agent/identities/:id/messagesList Messages
List messages received by this identity's inbox, newest first. Returns up to 50 messages with snippet previews.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Identity ID |
Response 200
{
"messages": [
{
"id": "msg_Rt5wKp8mNq2xYh6cVb3dZ",
"from": "noreply@twitter.com",
"fromName": "Twitter",
"subject": "Your verification code",
"snippet": "Your verification code is 847293. This code expires in 10 minutes...",
"receivedAt": "2025-02-01T12:05:00.000Z"
}
]
}Errors
| Status | Message |
|---|---|
| 404 | Identity not found |
Code Examples
curl https://destroy.network/api/agent/identities/{id}/messages \
-H "Authorization: Bearer sk_live_your_api_key"/api/agent/identities/:id/messages/:msgIdGet Message
Get the full body (text + HTML) of a single message. Use this when the snippet from list messages isn't enough, or to parse custom verification formats yourself.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Identity ID |
msgId | string | Yes | Message ID |
Response 200
| Field | Type | Description |
|---|---|---|
id | string | Message ID |
from | string | Sender address |
fromName | string | null | Sender display name |
subject | string | null | Email subject |
bodyText | string | null | Full plain-text body |
bodyHtml | string | null | Full HTML body |
snippet | string | null | First 200 chars of text body |
receivedAt | string | ISO-8601 timestamp |
{
"id": "msg_Rt5wKp8mNq2xYh6cVb3dZ",
"from": "noreply@twitter.com",
"fromName": "Twitter",
"subject": "Your verification code",
"bodyText": "Your verification code is 847293. This code expires in 10 minutes. If you didn't request this, ignore this email.",
"bodyHtml": "<html>...<strong>847293</strong>...</html>",
"snippet": "Your verification code is 847293. This code expires in 10 minutes...",
"receivedAt": "2025-02-01T12:05:00.000Z"
}Errors
| Status | Message |
|---|---|
| 404 | Identity not found |
| 404 | Message not found |
Code Examples
curl https://destroy.network/api/agent/identities/{id}/messages/{msgId} \
-H "Authorization: Bearer sk_live_your_api_key"/api/agent/identities/:id/waitWait for Email
Long-poll until a new email arrives in this identity's inbox. Returns the message when received, or times out. Useful for waiting on confirmation emails after sign-up.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Identity ID |
timeout | number | No | Max wait time in seconds (default: 30, max: Pro 30s, Business 120s) |
Response 200
| Field | Type | Description |
|---|---|---|
timedOut | boolean | Whether the request timed out without receiving a message |
message | object | null | The received message, or null if timed out |
message.id | string | Message ID |
message.from | string | Sender address |
message.subject | string | Email subject |
message.snippet | string | First 200 chars of body |
message.receivedAt | string | ISO-8601 timestamp |
{
"timedOut": false,
"message": {
"id": "msg_Rt5wKp8mNq2xYh6cVb3dZ",
"from": "noreply@twitter.com",
"subject": "Your verification code",
"snippet": "Your verification code is 847293...",
"receivedAt": "2025-02-01T12:05:00.000Z"
}
}Errors
| Status | Message |
|---|---|
| 404 | Identity not found |
Code Examples
# Wait up to 30 seconds for an email
curl "https://destroy.network/api/agent/identities/{id}/wait?timeout=30" \
-H "Authorization: Bearer sk_live_your_api_key"