Register email sign-in application
curl --request POST \
--url https://app.gtm-api.com/email/v4/api/email-oauth-apps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"name": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"service_account_email": "jsmith@example.com",
"service_account_json": "<string>",
"microsoft_tenant": "<string>",
"callback_host": "<string>",
"google_pubsub_topic": "<string>",
"is_default": true
}
'import requests
url = "https://app.gtm-api.com/email/v4/api/email-oauth-apps"
payload = {
"name": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"service_account_email": "jsmith@example.com",
"service_account_json": "<string>",
"microsoft_tenant": "<string>",
"callback_host": "<string>",
"google_pubsub_topic": "<string>",
"is_default": True
}
headers = {
"Authorization": "Bearer <token>",
"Team-SID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Team-SID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
client_id: '<string>',
client_secret: '<string>',
service_account_email: 'jsmith@example.com',
service_account_json: '<string>',
microsoft_tenant: '<string>',
callback_host: '<string>',
google_pubsub_topic: '<string>',
is_default: true
})
};
fetch('https://app.gtm-api.com/email/v4/api/email-oauth-apps', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'client_id' => '<string>',
'client_secret' => '<string>',
'service_account_email' => 'jsmith@example.com',
'service_account_json' => '<string>',
'microsoft_tenant' => '<string>',
'callback_host' => '<string>',
'google_pubsub_topic' => '<string>',
'is_default' => true
]),
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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"service_account_email\": \"jsmith@example.com\",\n \"service_account_json\": \"<string>\",\n \"microsoft_tenant\": \"<string>\",\n \"callback_host\": \"<string>\",\n \"google_pubsub_topic\": \"<string>\",\n \"is_default\": true\n}")
req, _ := http.NewRequest("POST", 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.post("https://app.gtm-api.com/email/v4/api/email-oauth-apps")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"service_account_email\": \"jsmith@example.com\",\n \"service_account_json\": \"<string>\",\n \"microsoft_tenant\": \"<string>\",\n \"callback_host\": \"<string>\",\n \"google_pubsub_topic\": \"<string>\",\n \"is_default\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/email/v4/api/email-oauth-apps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Team-SID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"service_account_email\": \"jsmith@example.com\",\n \"service_account_json\": \"<string>\",\n \"microsoft_tenant\": \"<string>\",\n \"callback_host\": \"<string>\",\n \"google_pubsub_topic\": \"<string>\",\n \"is_default\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "create",
"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>"
},
"already_exists": true,
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
}
}
email_oauth_apps
Register email sign-in application
Register the team’s own sign-in application and check its credentials at the provider in the call: a Google or Microsoft OAuth client (client_id and client_secret), a Google service account with domain-wide delegation (service_account_json, the key file as Google hands it out) or a Microsoft app-only registration (auth_kind app_only). item.status is the verdict; a failed application is still saved, so the provider side can be fixed and verified again without sending the secret twice. is_default true makes it the provider’s default and demotes the previous one. The same client id again answers the existing row (already_exists). 30 calls an hour. Requires can_manage_email_accounts.
Contract:
- REST only: no MCP tool serves this route (registry package
mcp.email/email_oauth_apps, surface api). - Operation
create, response envelopecreate. - Flags: none.
POST
/
api
/
email-oauth-apps
Register email sign-in application
curl --request POST \
--url https://app.gtm-api.com/email/v4/api/email-oauth-apps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"name": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"service_account_email": "jsmith@example.com",
"service_account_json": "<string>",
"microsoft_tenant": "<string>",
"callback_host": "<string>",
"google_pubsub_topic": "<string>",
"is_default": true
}
'import requests
url = "https://app.gtm-api.com/email/v4/api/email-oauth-apps"
payload = {
"name": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"service_account_email": "jsmith@example.com",
"service_account_json": "<string>",
"microsoft_tenant": "<string>",
"callback_host": "<string>",
"google_pubsub_topic": "<string>",
"is_default": True
}
headers = {
"Authorization": "Bearer <token>",
"Team-SID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Team-SID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
client_id: '<string>',
client_secret: '<string>',
service_account_email: 'jsmith@example.com',
service_account_json: '<string>',
microsoft_tenant: '<string>',
callback_host: '<string>',
google_pubsub_topic: '<string>',
is_default: true
})
};
fetch('https://app.gtm-api.com/email/v4/api/email-oauth-apps', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'client_id' => '<string>',
'client_secret' => '<string>',
'service_account_email' => 'jsmith@example.com',
'service_account_json' => '<string>',
'microsoft_tenant' => '<string>',
'callback_host' => '<string>',
'google_pubsub_topic' => '<string>',
'is_default' => true
]),
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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"service_account_email\": \"jsmith@example.com\",\n \"service_account_json\": \"<string>\",\n \"microsoft_tenant\": \"<string>\",\n \"callback_host\": \"<string>\",\n \"google_pubsub_topic\": \"<string>\",\n \"is_default\": true\n}")
req, _ := http.NewRequest("POST", 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.post("https://app.gtm-api.com/email/v4/api/email-oauth-apps")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"service_account_email\": \"jsmith@example.com\",\n \"service_account_json\": \"<string>\",\n \"microsoft_tenant\": \"<string>\",\n \"callback_host\": \"<string>\",\n \"google_pubsub_topic\": \"<string>\",\n \"is_default\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/email/v4/api/email-oauth-apps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Team-SID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"service_account_email\": \"jsmith@example.com\",\n \"service_account_json\": \"<string>\",\n \"microsoft_tenant\": \"<string>\",\n \"callback_host\": \"<string>\",\n \"google_pubsub_topic\": \"<string>\",\n \"is_default\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "create",
"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>"
},
"already_exists": true,
"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 create_email_oauth_app.