Send a POST request to /credential. This example creates a webhook credential using OAuth 2.0:
curl -X POST "https://api.sulus.ai/credential" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "webhook",
"name": "my-webhook-oauth2-credential",
"authenticationPlan": {
"type": "oauth2",
"url": "https://your-url.com/oauth/token",
"clientId": "your-client-id",
"clientSecret": "your-client-secret"
}
}'
| Field | Type | Required | Description |
|---|
provider | string | Yes | Must be "webhook" for webhook credentials. |
name | string | Yes | Descriptive name, 1–40 characters. |
authenticationPlan.type | string | Yes | Must be "oauth2". |
authenticationPlan.url | string | Yes | Your OAuth 2.0 token endpoint URL. |
authenticationPlan.clientId | string | Yes | OAuth 2.0 client identifier. |
authenticationPlan.clientSecret | string | Yes | OAuth 2.0 client secret. |
Once created, the core system requests a token from your endpoint using the client credentials flow, includes it in the Authorization header on webhook requests, and automatically refreshes it when it expires.