Skip to main content

Check OAuth 2.0 mailbox connection status

Track the progress of connecting a Google or Microsoft mailbox to Woodpecker, from OAuth 2.0 authorization to the initial connection.

Request​

Endpoint​

POST https://api.woodpecker.co/rest/v2/mailboxes/oauth2/check_status

Headers​

x-api-key: {YOUR_API_KEY}
Content-Type: application/json

For details on how to authenticate your requests, please see the authentication guide.

Body​

{
"provider": "GOOGLE",
"email": "mailbox@example.com"
}

Body schema​

FieldTypeRequiredDescription
providerstringYesMailbox provider. Use GOOGLE or MICROSOFT, with matching capitalization
emailstringYesEmail address of the mailbox that is being connected to Woodpecker

Request samples​

Check the connection status of a Google mailbox​

curl --request POST \
--url "https://api.woodpecker.co/rest/v2/mailboxes/oauth2/check_status" \
--header "x-api-key: {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--data '{
"provider": "GOOGLE",
"email": "mailbox@example.com"
}'

Response​

Response examples​

The response contains the current status of the OAuth 2.0 connection process.

{
"provider": "GOOGLE",
"email": "mailbox@example.com",
"status": "CONNECTED"
}

Body schema​

FieldTypeDescription
providerstringMailbox provider, GOOGLE or MICROSOFT
emailstringNormalized mailbox email address
statusstringCurrent status of the connection process
  • REGISTERED - The authorization link is ready and Woodpecker is waiting for the owner to authorize access
  • AUTHORIZATION_ERROR - Authorization failed, for example because the owner declined access or used a different email address
  • AUTHORIZED - Authorization succeeded and the mailbox is waiting to be connected
  • CONNECTING - Woodpecker is connecting the mailbox
  • CONNECTION_ERROR - Woodpecker could not complete the connection
  • CONNECTED- authorization succeeded and the mailbox was connected to Woodpecker

CONNECTED records that setup succeeded. For connection issues that arise later, inspect details.error and details.reconnect_required on the SMTP mailbox entry. If you have the mailbox ID, get the mailbox. Otherwise, list mailboxes and find the SMTP entry by its details.email.