Skip to main content

Create a Microsoft Graph credential

Create a Microsoft Graph app-only credential for connecting Microsoft mailboxes. Before saving the credential, Woodpecker verifies that the provided tenant ID, client ID, and client secret can be used to retrieve a Microsoft Graph access token.

The client_secret is encrypted before it is stored and is not returned in the response.

Request

Endpoint

POST https://api.woodpecker.co/rest/v2/mailboxes/microsoft/credentials

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

{
"tenant_id": "bbfb2db7-aaf4-4f7c-9dc2-2c9160d1cb32",
"client_id": "e1c6ac69-480e-4a17-9b85-3467967bd179",
"client_secret": "your-client-secret",
"secret_expires_at": "2027-11-28T23:59:59Z",
"name": "MS Graph app"
}

Body schema

FieldTypeRequiredDescription
tenant_idstringYesMicrosoft Entra tenant ID
client_idstringYesMicrosoft Entra application client ID
client_secretstringYesClient secret for the Microsoft app registration
secret_expires_atstringYesClient secret expiration date in ISO 8601 format
namestringNoCredential name. If omitted, Woodpecker assigns a default name

Request samples

Create a credential

curl --request POST \
--url "https://api.woodpecker.co/rest/v2/mailboxes/microsoft/credentials" \
--header "x-api-key: {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--data '{
"tenant_id": "bbfb2db7-aaf4-4f7c-9dc2-2c9160d1cb32",
"client_id": "e1c6ac69-480e-4a17-9b85-3467967bd179",
"client_secret": "your-client-secret",
"secret_expires_at": "2027-11-28T23:59:59Z",
"name": "MS Graph app"
}'

Response

Response examples

The credential was created.

{
"credential_id": 22334455,
"tenant_id": "bbfb2db7-aaf4-4f7c-9dc2-2c9160d1cb32",
"client_id": "e1c6ac69-480e-4a17-9b85-3467967bd179",
"secret_expires_at": "2027-11-28T23:59:59Z",
"name": "MS Graph app"
}

Body schema

FieldTypeDescription
credential_idintegerCreated credential ID
tenant_idstringMicrosoft Entra tenant ID
client_idstringMicrosoft Entra application client ID
secret_expires_atstringClient secret expiration date in ISO 8601 format
namestringCredential name.