Read the outcome of a connection
const url = 'https://api.clearance.rest/emails/gmail/oauth/result?token=example';const options = {method: 'GET', headers: {'X-API-Key': '<X-API-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.clearance.rest/emails/gmail/oauth/result?token=example' \ --header 'X-API-Key: <X-API-Key>'Call this from your backend with the result_token your return_url received. The token is single use: it is consumed on first read, a second call returns 404, and it expires after about 10 minutes.
A failed connection is still HTTP 200, with success: false and the reason in error.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Mail provider.
Query Parameters
Section titled “Query Parameters”The result_token from the return_url redirect.
Responses
Section titled “Responses”Outcome of the connection.
object
The connected address. Present on success.
Why the connection failed. Present on failure.
The client_state you passed to oauth/start.
Examples
{ "success": true, "email": "user@gmail.com", "client_state": "user-42"}{ "success": false, "error": "google refresh_token döndürmedi (prompt=consent ile tekrar deneyin)", "client_state": "user-42"}The X-API-Key header is missing or invalid.
Error envelope returned with a non-2xx status.
object
Human-readable error message.
Example
{ "success": false, "error": "geçersiz API anahtarı"}The result belongs to a different project.
Error envelope returned with a non-2xx status.
object
Human-readable error message.
Example
{ "success": false, "error": "invalid json body"}The token is invalid, expired, or already consumed.
Error envelope returned with a non-2xx status.
object
Human-readable error message.
Example
{ "success": false, "error": "geçersiz veya süresi dolmuş token"}