Skip to main content

Update a Microsoft Graph credential

Update a Microsoft Graph app-only credential. You can rename the credential, or rotate its client secret by sending both client_secret and secret_expires_at in the same request.

Request

Endpoint

PATCH https://api.woodpecker.co/rest/v2/mailboxes/microsoft/credentials/{credential_id}

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

{
"client_secret": "new-your-client-secret",
"secret_expires_at": "2027-11-28T23:59:59Z",
"name": "MS Graph app - production"
}

Body schema

FieldTypeRequiredDescription
client_secretstringNo*New client secret for the Microsoft app registration
secret_expires_atstringNo*Client secret expiration date in ISO 8601 format
namestringNoCredential name

*If you send either client_secret or secret_expires_at, both fields are required.

Request samples

Rotate a credential secret

curl --request PATCH \
--url "https://api.woodpecker.co/rest/v2/mailboxes/microsoft/credentials/{credential_id}" \
--header "x-api-key: {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--data '{
"client_secret": "new-your-client-secret",
"secret_expires_at": "2027-11-28T23:59:59Z",
"name": "MS Graph app - production"
}'

Response

Response examples

The credential was updated.

{
"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 - production"
}

Body schema

FieldTypeDescription
credential_idintegerUpdated 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