Webhook endpoints

Rotate a webhook endpoint's secret

POST/api/v1/webhooks/{id}/rotate-secret

Replaces the endpoint's signing secret and returns the new one. For the next 24 hours, or the hours you give in oldSecretValidForHours, each delivery is signed with both secrets, so your server keeps accepting events while you deploy the new one. Give 0 to stop the old secret at once.

Authorization

bearerAuth
AuthorizationBearer <token>

An access token from POST /api/v1/oauth/token, sent as Authorization: Bearer <token>.

In: header

Path Parameters

id*string

The webhook endpoint's ID.

Formatuuid

Header Parameters

FlexMalipo-Version?"2026-11-06"

The API version to use for this request, a date such as 2026-11-06. Without it the request uses your default version for the mode of your key. An unknown version answers 400 api_version_invalid.

Value in

  • "2026-11-06"
Idempotency-Key?string

A unique key you choose for this request: 1 to 255 visible ASCII characters, no spaces. A UUID works well. Never put personal data in it. If a request times out, send it again with the same key and the same body to get the first response back, with the header Idempotent-Replayed: true. A key is kept for 24 hours. Sending the same key with another body answers 400 idempotency_key_reused.

Match^[\x21-\x7E]+$
Length1 <= length <= 255

Request Body

application/json

Options for rotating a webhook endpoint's secret. You can leave out the whole body.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api-malipo.flex.co.tz/api/v1/webhooks/497f6eca-6276-4993-bfeb-53cbbbba6f08/rotate-secret" \  -H "Authorization: Bearer <token>" \  -H "FlexMalipo-Version: 2026-11-06" \  -H "Idempotency-Key: 5f1c1e0a-3b7e-4c8e-9d1a-2f6b8a4c7e11" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "3d2b8e4f-6a1c-4f7e-9b0d-1c2e3f4a5b6c",  "livemode": false,  "url": "https://shop.example.com/flex-malipo/webhooks",  "description": "Order updates",  "subscribedEvents": [    "payment.succeeded",    "payment.failed"  ],  "enabled": true,  "secret": "whsec_9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",  "previousSecretExpiresAt": "2026-09-29T09:15:30Z",  "createdAt": "2026-09-28T09:15:30Z",  "updatedAt": "2026-09-28T09:15:30Z",  "apiVersion": "2026-11-06",  "brandIds": [    "6b9e2f4a-1c3d-4e5f-8a7b-9c0d1e2f3a4b"  ]}