Deployments.ai Docs
Agent Email

Export agent email usage

POST /v1/agent-email/usage/export · SDK exportAgentEmailUsage · CLI deployments email-usage export

POST
/v1/agent-email/usage/export

Requires agent-email:read. A suspended organization can still call it.

Authorization

platformBearer
headerAuthorizationBearer <token>

Platform bearer credential accepted as an opaque API key or JWT.

Header Parameters

x-deployments-environment*string
Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$

Request Body

application/json
  1. body
bucket?string
Value in"day""hour""month"
format?string
Value in"csv""json"
from?string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
inboxId?string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
to?string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time

Response Body

AgentEmailUsageExportResponse

application/json
  1. response
bucket*string
Value in"day""hour""month"
csv?string
format*string
Value in"csv""json"
from*string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
rows*array<>
to*string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
curl -X POST "https://example.com/v1/agent-email/usage/export" \  -H "x-deployments-environment: string" \  -H "Content-Type: application/json" \  -d '{}'
{  "bucket": "day",  "csv": "string",  "format": "csv",  "from": "2019-08-24T14:15:22Z",  "rows": [    {      "bucketStart": "2019-08-24T14:15:22Z",      "clientId": "string",      "inboxId": "string",      "kind": "attachment_bytes",      "organizationId": "string",      "quantity": 0    }  ],  "to": "2019-08-24T14:15:22Z"}