Skip to main content
POST
/
channels
Create Channel
curl --request POST \
  --url https://api.example.com/channels

Request

curl -X POST https://api.certwatch.app/v1/channels \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "email",
    "name": "Ops Team",
    "config": {
      "email": "[email protected]"
    }
  }'

Request Body

FieldTypeRequiredDescription
typestringYesChannel type: email, discord, webhook
namestringYesDisplay name
configobjectYesType-specific configuration

Channel Types

Email

{
  "type": "email",
  "name": "Team Alerts",
  "config": {
    "email": "[email protected]"
  }
}

Discord

{
  "type": "discord",
  "name": "Discord Alerts",
  "config": {
    "webhookUrl": "https://discord.com/api/webhooks/..."
  }
}

Webhook

{
  "type": "webhook",
  "name": "Custom Integration",
  "config": {
    "url": "https://your-endpoint.com/webhook",
    "headers": {
      "Authorization": "Bearer secret"
    }
  }
}
Slack channels must be created through the OAuth flow in the CertWatch dashboard.

Response

{
  "data": {
    "id": "ch_abc123",
    "type": "email",
    "name": "Ops Team",
    "enabled": true,
    "config": {
      "email": "[email protected]"
    },
    "createdAt": "2025-01-08T12:00:00Z",
    "updatedAt": "2025-01-08T12:00:00Z"
  },
  "meta": {
    "requestId": "req_xyz789"
  }
}

Errors

400 Bad Request - Invalid Type

{
  "error": {
    "code": "invalid_channel_type",
    "message": "Invalid channel type. Must be one of: email, discord, webhook"
  }
}

400 Bad Request - Invalid Config

{
  "error": {
    "code": "invalid_config",
    "message": "Email address is required for email channels"
  }
}

400 Bad Request - Invalid Webhook URL

{
  "error": {
    "code": "invalid_webhook_url",
    "message": "The webhook URL is not valid"
  }
}

402 Payment Required - Limit Reached

{
  "error": {
    "code": "channel_limit_reached",
    "message": "You have reached your channel limit. Upgrade your plan to add more."
  }
}

401 Unauthorized

{
  "error": {
    "code": "invalid_api_key",
    "message": "The provided API key is invalid"
  }
}