Disconnect Email Provider
curl --request POST \
--url https://api.casparser.in/v4/inbox/disconnect \
--header 'x-api-key: <api-key>' \
--header 'x-inbox-token: <x-inbox-token>'import requests
url = "https://api.casparser.in/v4/inbox/disconnect"
headers = {
"x-inbox-token": "<x-inbox-token>",
"x-api-key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-inbox-token': '<x-inbox-token>', 'x-api-key': '<api-key>'}
};
fetch('https://api.casparser.in/v4/inbox/disconnect', 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.casparser.in/v4/inbox/disconnect",
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>",
"x-inbox-token: <x-inbox-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.casparser.in/v4/inbox/disconnect"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-inbox-token", "<x-inbox-token>")
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.casparser.in/v4/inbox/disconnect")
.header("x-inbox-token", "<x-inbox-token>")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.casparser.in/v4/inbox/disconnect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-inbox-token"] = '<x-inbox-token>'
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"msg": "Email disconnected successfully"
}{
"status": "failed",
"msg": "Authentication failed: API key is missing. Please provide a valid API key in the x-api-key header."
}Email Import
Disconnect Email Provider
Revoke email access and invalidate the token.
This calls the provider’s token revocation API (e.g., Google’s revoke endpoint) to ensure the user’s consent is properly removed.
After calling this, the inbox_token becomes unusable.
POST
/
v4
/
inbox
/
disconnect
Disconnect Email Provider
curl --request POST \
--url https://api.casparser.in/v4/inbox/disconnect \
--header 'x-api-key: <api-key>' \
--header 'x-inbox-token: <x-inbox-token>'import requests
url = "https://api.casparser.in/v4/inbox/disconnect"
headers = {
"x-inbox-token": "<x-inbox-token>",
"x-api-key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-inbox-token': '<x-inbox-token>', 'x-api-key': '<api-key>'}
};
fetch('https://api.casparser.in/v4/inbox/disconnect', 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.casparser.in/v4/inbox/disconnect",
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>",
"x-inbox-token: <x-inbox-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.casparser.in/v4/inbox/disconnect"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-inbox-token", "<x-inbox-token>")
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.casparser.in/v4/inbox/disconnect")
.header("x-inbox-token", "<x-inbox-token>")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.casparser.in/v4/inbox/disconnect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-inbox-token"] = '<x-inbox-token>'
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"msg": "Email disconnected successfully"
}{
"status": "failed",
"msg": "Authentication failed: API key is missing. Please provide a valid API key in the x-api-key header."
}Authorizations
Was this page helpful?

