API referenceEmail oauth apps
POST
/email/api/v1/oauth_apps

Swarmhit's own. The app the engine refreshes your Google or Microsoft mailboxes' tokens with (kind: oauth), or one that reaches a domain's mailboxes itself (kind: service: Google domain-wide delegation with service_client and service_key; Microsoft app-only with tenant_id). route: api uses the Gmail API / Graph, imap IMAP and SMTP. The secrets go to the engine only and are never answered.

Authorization

X-API-KEY<token>

Your API key from the console (gw_live_…).

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/email/api/v1/oauth_apps" \  -H "Content-Type: application/json" \  -d '{    "provider": "GOOGLE",    "kind": "oauth",    "route": "api",    "name": "Acme Google",    "client_id": "1234-example.apps.googleusercontent.com",    "client_secret": "GOCSPX-example"  }'
{  "object": "OAuthApp",  "id": "string",  "provider": "GOOGLE",  "kind": "oauth",  "route": "imap",  "name": "string",  "tenant_id": "string",  "created_at": "2019-08-24T14:15:22Z",  "adopted": true}