Skip to main content
POST
/
api
/
v0
/
webhooks
/
create notification webhook
curl --request POST \
  --url https://console.vast.ai/api/v0/webhooks/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Ops notifications",
  "webhook_url": "https://example.com/vast/webhooks",
  "event_types": [
    "client:low_credit",
    "host:machine_offline"
  ]
}
'
{
  "success": true,
  "webhook": {
    "id": 42,
    "user_id": 123,
    "name": "Ops notifications",
    "webhook_url": "https://example.com/vast/webhooks",
    "event_types": [
      "client:low_credit",
      "host:machine_offline"
    ],
    "created_at": 1772490000,
    "updated_at": 1772490000,
    "webhook_secret": "<WEBHOOK_SECRET>"
  },
  "enabled_notification_preferences": [
    "client:low_credit"
  ]
}

Authorizations

Authorization
string
header
required

API key must be provided in the Authorization header

Body

application/json
webhook_url
string<uri>
required
Maximum string length: 2048
event_types
string[]
required
Minimum array length: 1
name
string | null
Maximum string length: 120

Response

Webhook created successfully

success
boolean
Example:

true

webhook
object
enabled_notification_preferences
string[]
Example:
["client:low_credit"]