Get oauth session status
curl --request GET \
--url https://api.instantly.ai/api/v2/oauth/session/status/{sessionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.instantly.ai/api/v2/oauth/session/status/{sessionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.instantly.ai/api/v2/oauth/session/status/{sessionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api.instantly.ai/api/v2/oauth/session/status/{sessionId}")
.header("Authorization", "Bearer <token>")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.instantly.ai/api/v2/oauth/session/status/{sessionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.instantly.ai/api/v2/oauth/session/status/{sessionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "success",
"email": "user@example.com",
"name": "John Doe",
"error": "access_denied",
"error_description": "User denied access to the application"
}OAuth
Get oauth session status
Poll this endpoint to check the OAuth session result. Works for both Google and Microsoft OAuth sessions. Returns pending while waiting, success with account details when complete, or error if something went wrong. Sessions expire after 10 minutes.
GET
/
api
/
v2
/
oauth
/
session
/
status
/
{sessionId}
Get oauth session status
curl --request GET \
--url https://api.instantly.ai/api/v2/oauth/session/status/{sessionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.instantly.ai/api/v2/oauth/session/status/{sessionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.instantly.ai/api/v2/oauth/session/status/{sessionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api.instantly.ai/api/v2/oauth/session/status/{sessionId}")
.header("Authorization", "Bearer <token>")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.instantly.ai/api/v2/oauth/session/status/{sessionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.instantly.ai/api/v2/oauth/session/status/{sessionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "success",
"email": "user@example.com",
"name": "John Doe",
"error": "access_denied",
"error_description": "User denied access to the application"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Session ID from init response
Example:
"abc123def456"
Response
200 - application/json
Default Response
Current status of the OAuth session
Available options:
pending, success, error, expired Example:
"success"
Email of the connected account (on success)
Example:
"user@example.com"
Name of the account owner (on success)
Example:
"John Doe"
Error code (on error)
Example:
"access_denied"
Human-readable error description (on error)
Example:
"User denied access to the application"