curl --request PUT \
--url https://mailcare.io/api/teams/{teamId}/automations/{id} \
--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$",
"notification_email": "ops@example.com",
"action_delete_email": true,
"disabled": false,
"payload_format": "json"
}
'import requests
url = "https://mailcare.io/api/teams/{teamId}/automations/{id}"
payload = {
"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$",
"notification_email": "ops@example.com",
"action_delete_email": True,
"disabled": False,
"payload_format": "json"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.mailcare.v1+json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/vnd.mailcare.v1+json'
},
body: JSON.stringify({
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$',
notification_email: 'ops@example.com',
action_delete_email: true,
disabled: false,
payload_format: 'json'
})
};
fetch('https://mailcare.io/api/teams/{teamId}/automations/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mailcare.io/api/teams/{teamId}/automations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'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$',
'notification_email' => 'ops@example.com',
'action_delete_email' => true,
'disabled' => false,
'payload_format' => 'json'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.mailcare.v1+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mailcare.io/api/teams/{teamId}/automations/{id}"
payload := strings.NewReader("{\n \"title\": \"Save pdf invoices\",\n \"sender\": \"shop@example.com\",\n \"inbox\": \"claire@example.com\",\n \"subject\": \"New invoice\",\n \"has_attachments\": true,\n \"action_url\": \"https://example.com/webhooks/save-pdf-invoices\",\n \"action_secret_token\": \"SECRET12345$\",\n \"notification_email\": \"ops@example.com\",\n \"action_delete_email\": true,\n \"disabled\": false,\n \"payload_format\": \"json\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.mailcare.v1+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://mailcare.io/api/teams/{teamId}/automations/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.mailcare.v1+json")
.body("{\n \"title\": \"Save pdf invoices\",\n \"sender\": \"shop@example.com\",\n \"inbox\": \"claire@example.com\",\n \"subject\": \"New invoice\",\n \"has_attachments\": true,\n \"action_url\": \"https://example.com/webhooks/save-pdf-invoices\",\n \"action_secret_token\": \"SECRET12345$\",\n \"notification_email\": \"ops@example.com\",\n \"action_delete_email\": true,\n \"disabled\": false,\n \"payload_format\": \"json\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mailcare.io/api/teams/{teamId}/automations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/vnd.mailcare.v1+json'
request.body = "{\n \"title\": \"Save pdf invoices\",\n \"sender\": \"shop@example.com\",\n \"inbox\": \"claire@example.com\",\n \"subject\": \"New invoice\",\n \"has_attachments\": true,\n \"action_url\": \"https://example.com/webhooks/save-pdf-invoices\",\n \"action_secret_token\": \"SECRET12345$\",\n \"notification_email\": \"ops@example.com\",\n \"action_delete_email\": true,\n \"disabled\": false,\n \"payload_format\": \"json\"\n}"
response = http.request(request)
puts response.read_bodyUpdate automation
Updates an existing automation with new parameters.
curl --request PUT \
--url https://mailcare.io/api/teams/{teamId}/automations/{id} \
--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$",
"notification_email": "ops@example.com",
"action_delete_email": true,
"disabled": false,
"payload_format": "json"
}
'import requests
url = "https://mailcare.io/api/teams/{teamId}/automations/{id}"
payload = {
"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$",
"notification_email": "ops@example.com",
"action_delete_email": True,
"disabled": False,
"payload_format": "json"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.mailcare.v1+json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/vnd.mailcare.v1+json'
},
body: JSON.stringify({
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$',
notification_email: 'ops@example.com',
action_delete_email: true,
disabled: false,
payload_format: 'json'
})
};
fetch('https://mailcare.io/api/teams/{teamId}/automations/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mailcare.io/api/teams/{teamId}/automations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'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$',
'notification_email' => 'ops@example.com',
'action_delete_email' => true,
'disabled' => false,
'payload_format' => 'json'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.mailcare.v1+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mailcare.io/api/teams/{teamId}/automations/{id}"
payload := strings.NewReader("{\n \"title\": \"Save pdf invoices\",\n \"sender\": \"shop@example.com\",\n \"inbox\": \"claire@example.com\",\n \"subject\": \"New invoice\",\n \"has_attachments\": true,\n \"action_url\": \"https://example.com/webhooks/save-pdf-invoices\",\n \"action_secret_token\": \"SECRET12345$\",\n \"notification_email\": \"ops@example.com\",\n \"action_delete_email\": true,\n \"disabled\": false,\n \"payload_format\": \"json\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.mailcare.v1+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://mailcare.io/api/teams/{teamId}/automations/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.mailcare.v1+json")
.body("{\n \"title\": \"Save pdf invoices\",\n \"sender\": \"shop@example.com\",\n \"inbox\": \"claire@example.com\",\n \"subject\": \"New invoice\",\n \"has_attachments\": true,\n \"action_url\": \"https://example.com/webhooks/save-pdf-invoices\",\n \"action_secret_token\": \"SECRET12345$\",\n \"notification_email\": \"ops@example.com\",\n \"action_delete_email\": true,\n \"disabled\": false,\n \"payload_format\": \"json\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mailcare.io/api/teams/{teamId}/automations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/vnd.mailcare.v1+json'
request.body = "{\n \"title\": \"Save pdf invoices\",\n \"sender\": \"shop@example.com\",\n \"inbox\": \"claire@example.com\",\n \"subject\": \"New invoice\",\n \"has_attachments\": true,\n \"action_url\": \"https://example.com/webhooks/save-pdf-invoices\",\n \"action_secret_token\": \"SECRET12345$\",\n \"notification_email\": \"ops@example.com\",\n \"action_delete_email\": true,\n \"disabled\": false,\n \"payload_format\": \"json\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier of the automation to update.
Body
Title of the automation
"Save pdf invoices"
Sender that should match (optional)
"shop@example.com"
Inbox that should match (optional)
"claire@example.com"
Subject that should match (optional)
"New invoice"
Email should have at least one attachment (optional)
true
URL that will be called (optional)
"https://example.com/webhooks/save-pdf-invoices"
Use this token to validate received payloads (optional)
"SECRET12345$"
Email address to notify on webhook failures (optional). If empty, no notification is sent. At most one notification is sent per automation per UTC day.
"ops@example.com"
Email should be deleted after processing (optional)
true
Disable this automation without deleting it (optional)
false
Payload format to use (optional)
json, raw, json_with_bodies "json"
Response
Automation successfully updated.