Create a webhook
Creates a new webhook for a specific
type and url. Your application will be notified of updates to the chosen event type.Parameters
type
enumThe event type to be sent to this url. See webhook event types.
Required
url
stringThe HTTPS URL receiving the webhook event.
Required
auth_token
string,nullSecret token for request validation. Will be sent as a
base64 encoded string in the Authorization header of the webhook.Optional
Returns
Returns a webhook object.
- cURL
- Node.js
- Python
POST
/webhookscurl https://production.methodfi.com/webhooks \
-X POST \
-H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
-H "Content-Type: application/json" \
-d '{
"type": "payment.update",
"url": "https://api.example.app/webhook",
"auth_token": "md7UqcTSmvXCBzPORDwOkE"
}'
POST
/webhooksconst webhook = await method.webhooks.create({
type: 'payment.update',
url: 'https://api.example.app/webhook',
auth_token: 'md7UqcTSmvXCBzPORDwOkE',
});
POST
/webhookswebhook = method.webhooks.create({
'type': 'payment.update',
'url': 'https://api.example.app/webhook',
'auth_token': 'md7UqcTSmvXCBzPORDwOkE'
})
RESPONSE
{
"id": "whk_cSGjA6d9N8y8R",
"type": "payment.update",
"url": "https://api.example.app/webhook",
"auth_token": "md7UqcTSmvXCBzPORDwOkE",
"metadata": null,
"created_at": "2020-12-09T00:41:05.647Z",
"updated_at": "2020-12-09T00:41:05.647Z"
}