Update email sign-in application
curl --request PATCH \
--url https://app.gtm-api.com/email/v4/api/email-oauth-apps/{sid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"name": "<string>",
"microsoft_tenant": "<string>",
"callback_host": "<string>",
"google_pubsub_topic": "<string>",
"is_default": true,
"client_secret": "<string>"
}
'import requests
url = "https://app.gtm-api.com/email/v4/api/email-oauth-apps/{sid}"
payload = {
"name": "<string>",
"microsoft_tenant": "<string>",
"callback_host": "<string>",
"google_pubsub_topic": "<string>",
"is_default": True,
"client_secret": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Team-SID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'Team-SID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
microsoft_tenant: '<string>',
callback_host: '<string>',
google_pubsub_topic: '<string>',
is_default: true,
client_secret: '<string>'
})
};
fetch('https://app.gtm-api.com/email/v4/api/email-oauth-apps/{sid}', 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://app.gtm-api.com/email/v4/api/email-oauth-apps/{sid}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'microsoft_tenant' => '<string>',
'callback_host' => '<string>',
'google_pubsub_topic' => '<string>',
'is_default' => true,
'client_secret' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Team-SID: <api-key>"
],
]);
$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://app.gtm-api.com/email/v4/api/email-oauth-apps/{sid}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"microsoft_tenant\": \"<string>\",\n \"callback_host\": \"<string>\",\n \"google_pubsub_topic\": \"<string>\",\n \"is_default\": true,\n \"client_secret\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Team-SID", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.gtm-api.com/email/v4/api/email-oauth-apps/{sid}")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"microsoft_tenant\": \"<string>\",\n \"callback_host\": \"<string>\",\n \"google_pubsub_topic\": \"<string>\",\n \"is_default\": true,\n \"client_secret\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/email/v4/api/email-oauth-apps/{sid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Team-SID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"microsoft_tenant\": \"<string>\",\n \"callback_host\": \"<string>\",\n \"google_pubsub_topic\": \"<string>\",\n \"is_default\": true,\n \"client_secret\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "update",
"item": {
"sid": "<string>",
"team_sid": "<string>",
"provider": "google",
"name": "<string>",
"client_id": "<string>",
"microsoft_tenant": "<string>",
"callback_host": "<string>",
"google_pubsub_topic": "<string>",
"publishing_status": "unknown",
"is_default": true,
"status": "verified",
"last_verified_at": "<string>",
"last_error_code": "<string>",
"accounts_count": 123,
"auth_kind": "oauth_client",
"service_account_email": "<string>",
"created_by": {
"actor_type": "user",
"actor_sid": "<string>",
"team_sid": "<string>",
"permissions": {},
"actor_name": "<string>",
"oauth_client_sid": "<string>",
"reason": "<string>",
"cluster_id": 123,
"trace_id": "<string>"
},
"created_at": "<string>",
"updated_at": "<string>",
"deleted_at": "<string>"
},
"updated_fields": [
"<string>"
],
"previous_values": {},
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
}
}email_oauth_apps
Update email sign-in application
Change a sign-in application: its name, whether it is the provider’s default (true demotes the previous one, false leaves the provider with none, so connects fall back to the platform’s application), the callback host, the Microsoft tenant, the Google Pub/Sub topic or the declared publishing status. The client id and the provider cannot change: another client id is another application. Over REST the route also takes client_secret and checks it at the provider; a tool does not, because a secret never passes through a model. Requires can_manage_email_accounts.
Contract:
- MCP tool
update_email_oauth_app, registry packagemcp.email/email_oauth_apps, mountemail.infrastructure. - Operation
update, response envelopeupdate. - Flags: none.
- REST only fields:
client_secret. This route takes them; the MCP tool does not offer them, because a secret never passes through a model.
PATCH
/
api
/
email-oauth-apps
/
{sid}
Update email sign-in application
curl --request PATCH \
--url https://app.gtm-api.com/email/v4/api/email-oauth-apps/{sid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"name": "<string>",
"microsoft_tenant": "<string>",
"callback_host": "<string>",
"google_pubsub_topic": "<string>",
"is_default": true,
"client_secret": "<string>"
}
'import requests
url = "https://app.gtm-api.com/email/v4/api/email-oauth-apps/{sid}"
payload = {
"name": "<string>",
"microsoft_tenant": "<string>",
"callback_host": "<string>",
"google_pubsub_topic": "<string>",
"is_default": True,
"client_secret": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Team-SID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'Team-SID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
microsoft_tenant: '<string>',
callback_host: '<string>',
google_pubsub_topic: '<string>',
is_default: true,
client_secret: '<string>'
})
};
fetch('https://app.gtm-api.com/email/v4/api/email-oauth-apps/{sid}', 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://app.gtm-api.com/email/v4/api/email-oauth-apps/{sid}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'microsoft_tenant' => '<string>',
'callback_host' => '<string>',
'google_pubsub_topic' => '<string>',
'is_default' => true,
'client_secret' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Team-SID: <api-key>"
],
]);
$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://app.gtm-api.com/email/v4/api/email-oauth-apps/{sid}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"microsoft_tenant\": \"<string>\",\n \"callback_host\": \"<string>\",\n \"google_pubsub_topic\": \"<string>\",\n \"is_default\": true,\n \"client_secret\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Team-SID", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.gtm-api.com/email/v4/api/email-oauth-apps/{sid}")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"microsoft_tenant\": \"<string>\",\n \"callback_host\": \"<string>\",\n \"google_pubsub_topic\": \"<string>\",\n \"is_default\": true,\n \"client_secret\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/email/v4/api/email-oauth-apps/{sid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Team-SID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"microsoft_tenant\": \"<string>\",\n \"callback_host\": \"<string>\",\n \"google_pubsub_topic\": \"<string>\",\n \"is_default\": true,\n \"client_secret\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "update",
"item": {
"sid": "<string>",
"team_sid": "<string>",
"provider": "google",
"name": "<string>",
"client_id": "<string>",
"microsoft_tenant": "<string>",
"callback_host": "<string>",
"google_pubsub_topic": "<string>",
"publishing_status": "unknown",
"is_default": true,
"status": "verified",
"last_verified_at": "<string>",
"last_error_code": "<string>",
"accounts_count": 123,
"auth_kind": "oauth_client",
"service_account_email": "<string>",
"created_by": {
"actor_type": "user",
"actor_sid": "<string>",
"team_sid": "<string>",
"permissions": {},
"actor_name": "<string>",
"oauth_client_sid": "<string>",
"reason": "<string>",
"cluster_id": 123,
"trace_id": "<string>"
},
"created_at": "<string>",
"updated_at": "<string>",
"deleted_at": "<string>"
},
"updated_fields": [
"<string>"
],
"previous_values": {},
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
}
}Authorizations
Headers
Body
application/json
Request body of update_email_oauth_app.