Create an email workspace
Creates a new email workspace used to batch-connect OAuth accounts.
- For Google Workspace (
provider: google), upload the service account JSON key viafile_key_json. - For Microsoft 365 / Outlook (
provider: outlook), pass the application's client ID, client secret value and tenant ID.
See the Google Workspace setup guide and the Outlook batch connect guide.
Body·
required
application/json
Create an email workspace
- Type: stringnamerequired
Human-readable name shown in the UI.
- Type: nullfile
_key _json Google service account key JSON. Required when
providerisgoogle. - Type: stringoutlook
_client _id Outlook app client ID. Required when
providerisoutlook. - Type: stringoutlook
_client _secret Outlook app client secret identifier. Required when
providerisoutlook. - Type: stringoutlook
_client _secret _expires _at Outlook client secret expiration date in
DD/MM/YYYYformat. - Type: stringoutlook
_client _secret _value Outlook app client secret value. Required when
providerisoutlook. - Type: stringoutlook
_tenant _id Outlook tenant ID. Required when
providerisoutlook. - Type: stringenumprovider
Workspace provider. One of
google(default) oroutlook.values- google
- outlook
Responses
- application/json
- application/json
- application/json
Request Example for post/v1/email_workspaces
curl http://api.mailreach.co/api/v1/email_workspaces \
--request POST \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: YOUR_SECRET_TOKEN' \
--data '{
"name": "Acme Sales",
"provider": "google",
"file_key_json": null,
"outlook_client_id": "82c5c74d-6ba1-42b1-9c1d-91f8a7b51b2a",
"outlook_client_secret": "",
"outlook_client_secret_value": "",
"outlook_tenant_id": "1f9e4b2c-3f67-4f8e-9b3e-0f0f6a9b1e2d",
"outlook_client_secret_expires_at": "29/01/2028"
}'
{
"id": 42,
"name": "Acme Sales",
"created_at": "2026-02-14T09:30:00.000Z",
"provider": "google",
"outlook_tenant_id": "1f9e4b2c-3f67-4f8e-9b3e-0f0f6a9b1e2d",
"outlook_client_id": "82c5c74d-6ba1-42b1-9c1d-91f8a7b51b2a",
"outlook_client_secret_expires_at": "2028-01-29T00:00:00.000Z"
}