curl --request POST \
--url https://api.getoneprofile.ai/mailboxes/{mailbox_id}/verify/ \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.getoneprofile.ai/mailboxes/{mailbox_id}/verify/"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.getoneprofile.ai/mailboxes/{mailbox_id}/verify/', 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://api.getoneprofile.ai/mailboxes/{mailbox_id}/verify/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-Key: <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"
"net/http"
"io"
)
func main() {
url := "https://api.getoneprofile.ai/mailboxes/{mailbox_id}/verify/"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.getoneprofile.ai/mailboxes/{mailbox_id}/verify/")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getoneprofile.ai/mailboxes/{mailbox_id}/verify/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"connection_status": "connected",
"created_at": "2023-11-07T05:31:56Z",
"daily_send_limit": 123,
"daily_send_limit_cap": "personal_gmail",
"daily_send_limit_ceiling": 123,
"daily_send_limit_max": 123,
"disconnected_at": "2023-11-07T05:31:56Z",
"disconnected_reason": "<string>",
"effective_daily_send_limit": 123,
"email_address": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider": "google_workspace",
"sender_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updated_at": "2023-11-07T05:31:56Z",
"bounce_rate": 123,
"daily_send_limit_cap_ends_at": "2023-11-07T05:31:56Z",
"last_verified_at": "2023-11-07T05:31:56Z",
"microsoft_tenant_id": "<string>",
"reply_rate": 123,
"usage": {
"sent_today": 123,
"sent_yesterday": 123
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>",
"issues": [
{
"input": "<string>",
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Verify a mailbox's connection still works
Checks that a mailbox’s connection to Google or Microsoft still works by reading the account’s own profile, refreshing the access token first if it needs it. Sends no email. A mailbox that passes is stamped last_verified_at, as the hourly check and a status refresh stamp it. A refused grant disconnects the mailbox, and the refusal carries the reason stored on it; so does a mailbox disconnected on purpose, which is not checked. A definite error the provider answers with (Gmail turned off for that user, say) fails the check and clears the stamp, but leaves the mailbox connected. When the provider cannot answer just now (no answer, a server error or a timeout), nothing is checked and the mailbox keeps the status it had. Each refusal names the provider: Google, or Microsoft for an Outlook mailbox.
curl --request POST \
--url https://api.getoneprofile.ai/mailboxes/{mailbox_id}/verify/ \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.getoneprofile.ai/mailboxes/{mailbox_id}/verify/"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.getoneprofile.ai/mailboxes/{mailbox_id}/verify/', 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://api.getoneprofile.ai/mailboxes/{mailbox_id}/verify/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-Key: <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"
"net/http"
"io"
)
func main() {
url := "https://api.getoneprofile.ai/mailboxes/{mailbox_id}/verify/"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.getoneprofile.ai/mailboxes/{mailbox_id}/verify/")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getoneprofile.ai/mailboxes/{mailbox_id}/verify/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"connection_status": "connected",
"created_at": "2023-11-07T05:31:56Z",
"daily_send_limit": 123,
"daily_send_limit_cap": "personal_gmail",
"daily_send_limit_ceiling": 123,
"daily_send_limit_max": 123,
"disconnected_at": "2023-11-07T05:31:56Z",
"disconnected_reason": "<string>",
"effective_daily_send_limit": 123,
"email_address": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider": "google_workspace",
"sender_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updated_at": "2023-11-07T05:31:56Z",
"bounce_rate": 123,
"daily_send_limit_cap_ends_at": "2023-11-07T05:31:56Z",
"last_verified_at": "2023-11-07T05:31:56Z",
"microsoft_tenant_id": "<string>",
"reply_rate": 123,
"usage": {
"sent_today": 123,
"sent_yesterday": 123
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>",
"issues": [
{
"input": "<string>",
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Response
Successful Response
Which email provider a mailbox connects through.
Every provider is implemented behind providers.EmailProviderBase, so callers
never see which one a mailbox uses.
GOOGLE_WORKSPACE holds a per-mailbox OAuth grant (consent screen,
refresh token). GOOGLE_WORKSPACE_DWD holds no grant at all: tokens are
minted on demand via domain-wide delegation as the platform service
account, so its rows carry an empty refresh_token forever. It is the path
imported fleets (e.g. InboxKit) connect through. GOOGLE_CLERK is the Google
sign-in itself: the onboarding wizard's person consents to Gmail once, at sign-up,
and Clerk keeps that grant, so the row's refresh_token holds the Clerk user id
whose Google connection each fresh token is read from.
MICROSOFT_CLERK is the Microsoft 365 twin of GOOGLE_CLERK: Outlook through
Microsoft Graph, with the grant held by the person's Clerk Microsoft sign-in. The row's
refresh_token holds the Clerk user id and provider_account_id the Clerk
external account the token is read from. MICROSOFT_365_APP is the twin of
GOOGLE_WORKSPACE_DWD: Graph with an application token for a tenant whose admin
granted Oneprofile once: its rows' refresh_token holds that tenant's id, which is
no secret (MailboxDTO.microsoft_tenant_id reads it).
google_workspace, google_workspace_dwd, google_clerk, microsoft_clerk, microsoft_365_app Was this page helpful?