Skip to main content
POST
/
v4
/
inbox
/
connect
Connect Email Provider (Initiate OAuth)
curl --request POST \
  --url https://api.casparser.in/v4/inbox/connect \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "redirect_uri": "https://yourapp.com/oauth-callback",
  "state": "abc123"
}
'
{
  "status": "success",
  "oauth_url": "https://accounts.google.com/o/oauth2/v2/auth?client_id=...",
  "expires_in": 600
}

Authorizations

x-api-key
string
header
required

Your API key for authentication. Use sandbox-with-json-responses as Sandbox key.

Body

application/json
redirect_uri
string<uri>
required

Your callback URL to receive the inbox_token (must be http or https)

Example:

"https://yourapp.com/oauth-callback"

state
string

State parameter for CSRF protection (returned in redirect)

Example:

"abc123"

Response

OAuth URL generated successfully

status
string
Example:

"success"

oauth_url
string<uri>

Redirect user to this URL to start OAuth flow

Example:

"https://accounts.google.com/o/oauth2/v2/auth?client_id=..."

expires_in
integer

Seconds until the OAuth URL expires (typically 10 minutes)

Example:

600