curl --request POST \
--url https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"provider": "google",
"redirectUrl": "https://partner.example/oauth/callback",
"email": "user@example.com"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
provider: 'google',
redirectUrl: 'https://partner.example/oauth/callback',
email: 'user@example.com'
})
};
fetch('https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
provider: 'google',
redirectUrl: 'https://partner.example/oauth/callback',
email: 'user@example.com'
})
};
fetch('https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link';
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
provider: 'google',
redirectUrl: 'https://partner.example/oauth/callback',
email: 'user@example.com'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link"
payload = {
"provider": "google",
"redirectUrl": "https://partner.example/oauth/callback",
"email": "user@example.com"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link"
payload := strings.NewReader("{\n \"provider\": \"google\",\n \"redirectUrl\": \"https://partner.example/oauth/callback\",\n \"email\": \"user@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"google\",\n \"redirectUrl\": \"https://partner.example/oauth/callback\",\n \"email\": \"user@example.com\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"provider\": \"google\",\n \"redirectUrl\": \"https://partner.example/oauth/callback\",\n \"email\": \"user@example.com\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link",
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([
'provider' => 'google',
'redirectUrl' => 'https://partner.example/oauth/callback',
'email' => 'user@example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"provider\": \"google\",\n \"redirectUrl\": \"https://partner.example/oauth/callback\",\n \"email\": \"user@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"url": "https://accounts.google.com/o/oauth2/auth?..."
}{
"data": [
{
"createdAt": "<string>",
"type": "email",
"value": "<string>"
}
],
"message": "<string>"
}{
"data": [
{
"createdAt": "<string>",
"type": "email",
"value": "<string>"
}
],
"message": "<string>"
}Create mailbox OAuth link
Returns a Google or Outlook OAuth URL for connecting a mailbox. After the user authorizes, they are redirected to redirectUrl. The mailbox is auto-provisioned in Warmforge under the matching workspace.
curl --request POST \
--url https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"provider": "google",
"redirectUrl": "https://partner.example/oauth/callback",
"email": "user@example.com"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
provider: 'google',
redirectUrl: 'https://partner.example/oauth/callback',
email: 'user@example.com'
})
};
fetch('https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
provider: 'google',
redirectUrl: 'https://partner.example/oauth/callback',
email: 'user@example.com'
})
};
fetch('https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link';
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
provider: 'google',
redirectUrl: 'https://partner.example/oauth/callback',
email: 'user@example.com'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link"
payload = {
"provider": "google",
"redirectUrl": "https://partner.example/oauth/callback",
"email": "user@example.com"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link"
payload := strings.NewReader("{\n \"provider\": \"google\",\n \"redirectUrl\": \"https://partner.example/oauth/callback\",\n \"email\": \"user@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"google\",\n \"redirectUrl\": \"https://partner.example/oauth/callback\",\n \"email\": \"user@example.com\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"provider\": \"google\",\n \"redirectUrl\": \"https://partner.example/oauth/callback\",\n \"email\": \"user@example.com\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link",
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([
'provider' => 'google',
'redirectUrl' => 'https://partner.example/oauth/callback',
'email' => 'user@example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/oauth-link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"provider\": \"google\",\n \"redirectUrl\": \"https://partner.example/oauth/callback\",\n \"email\": \"user@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"url": "https://accounts.google.com/o/oauth2/auth?..."
}{
"data": [
{
"createdAt": "<string>",
"type": "email",
"value": "<string>"
}
],
"message": "<string>"
}{
"data": [
{
"createdAt": "<string>",
"type": "email",
"value": "<string>"
}
],
"message": "<string>"
}Authorizations
Path Parameters
Workspace ID
Body
OAuth link request
OAuth link request
Mail provider to connect: "google" or "outlook". Mailboxes on any other provider connect with their own credentials through POST /workspaces/{workspaceID}/mailboxes instead.
google, outlook "google"
Absolute https URL the user returns to once they have authorized the mailbox. It must be registered with Salesforge beforehand — ask support to add it — and may carry a path and query but no fragment or embedded credentials.
Salesforge appends the result to it: mailboxId and address on success, or connection_status=failed and an error code on failure. Query parameters already present are preserved, so state can be round-tripped through this URL.
"https://partner.example/oauth/callback"
Address to pre-select on the provider's consent screen. Optional; the user can still choose a different account, so treat the address returned on the redirect as authoritative.
"user@example.com"
Response
OAuth authorization URL
"https://accounts.google.com/o/oauth2/auth?..."
