POST
/
automations
Create automation
curl --request POST \
  --url https://mailcare.io/api/teams/{teamId}/automations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/vnd.mailcare.v1+json' \
  --data '{
  "title": "Save pdf invoices",
  "sender": "shop@example.com",
  "inbox": "claire@example.com",
  "subject": "New invoice",
  "has_attachments": true,
  "action_url": "https://example.com/webhooks/save-pdf-invoices",
  "action_secret_token": "SECRET12345$",
  "action_delete_email": true,
  "payload_format": "json"
}'

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/vnd.mailcare.v1+json
title
string
required

Title of the automation

Example:

"Save pdf invoices"

sender
string

Sender that should match (optional)

Example:

"shop@example.com"

inbox
string

Inbox that should match (optional)

Example:

"claire@example.com"

subject
string

Subject that should match (optional)

Example:

"New invoice"

has_attachments
boolean

Email should have at least one attachment (optional)

Example:

true

action_url
string

URL that will be called (optional)

Example:

"https://example.com/webhooks/save-pdf-invoices"

action_secret_token
string

Use this token to validate received payloads (optional)

Example:

"SECRET12345$"

action_delete_email
boolean

Email should be deleted after processing (optional)

Example:

true

payload_format
enum<string>

Payload format to use (optional)

Available options:
json,
raw,
json_with_bodies
Example:

"json"

Response

201

Automation successfully created.