Create a notification channel
POST
/notification-channels
Authentication
API Key (header: X-API-Key) API Key (cookie: better-auth.session_token)
Request Body required
Request body
application/jsonname
string
REQUIRED
channel_type
string
REQUIRED
config
object
REQUIRED
Responses
201
Created notification channel
application/jsonchannel
object | null
REQUIRED
id
string
REQUIRED
org_id
string
REQUIRED
env_id
string
REQUIRED
name
string
REQUIRED
channel_type
string
REQUIRED
config
string
REQUIRED
enabled
integer
REQUIRED
last_sent_at
string | null
REQUIRED
error_count
integer
REQUIRED
last_error
string | null
REQUIRED
created_at
string
REQUIRED
updated_at
string
REQUIRED
400
Bad request
401
Unauthorized
curl -X POST 'https://hookstream.io/v1/notification-channels' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "channel_type": "string", "config": {}}'
const response = await fetch('https://hookstream.io/v1/notification-channels', { method: 'POST', headers: { "Authorization": "Bearer YOUR_API_TOKEN", "Content-Type": "application/json" }, body: JSON.stringify({ "name": "string", "channel_type": "string", "config": {} })});const data = await response.json();console.log(data);
import requestsheaders = { 'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('https://hookstream.io/v1/notification-channels', headers=headers, json={ "name": "string", "channel_type": "string", "config": {}})print(response.json())
package mainimport ( "fmt" "io" "net/http" "strings")func main() { body := strings.NewReader(`{ "name": "string", "channel_type": "string", "config": {}}`) req, _ := http.NewRequest("POST", "https://hookstream.io/v1/notification-channels", body) req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() result, _ := io.ReadAll(resp.Body) fmt.Println(string(result))}
201
Response
{ "channel": { "id": "<string>", "org_id": "<string>", "env_id": "<string>", "name": "<string>", "channel_type": "<string>", "config": "<string>", "enabled": 123, "last_sent_at": "<string>", "error_count": 123, "last_error": "<string>", "created_at": "<string>", "updated_at": "<string>" }}
API Playground
Try this endpoint
POST
/notification-channels