Create endpoint
Create a new webhook endpoint for an application. The signing secret is returned only once.
POST
/applications/{appId}/endpoints
Create a new webhook endpoint for an application. The signing secret is returned only once.
Authentication
API Key (header: X-API-Key) API Key (cookie: better-auth.session_token)
Path Parameters
appId
string
required
path
Application ID
Example:
"a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6"Request Body required
Request body
application/jsonurl
string (uri)
REQUIRED
Webhook endpoint URL
description
string
Description
filter_types
string[]
Event types to filter for
Array of:
rate_limit_per_second
number
Per-second rate limit
expires_at
string
ISO expiry timestamp
Responses
201
Endpoint created (signing secret shown once)
application/jsonendpoint
unknown
REQUIRED
400
Bad request
401
Unauthorized
403
Endpoint limit reached
404
Application not found
curl -X POST 'https://hookstream.io/v1/applications/a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6/endpoints' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "url": "https://example.com/webhook", "description": "string", "filter_types": [ "string" ], "rate_limit_per_second": 0, "expires_at": "string"}'
const response = await fetch('https://hookstream.io/v1/applications/a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6/endpoints', { method: 'POST', headers: { "Authorization": "Bearer YOUR_API_TOKEN", "Content-Type": "application/json" }, body: JSON.stringify({ "url": "https://example.com/webhook", "description": "string", "filter_types": [ "string" ], "rate_limit_per_second": 0, "expires_at": "string" })});const data = await response.json();console.log(data);
import requestsheaders = { 'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('https://hookstream.io/v1/applications/a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6/endpoints', headers=headers, json={ "url": "https://example.com/webhook", "description": "string", "filter_types": [ "string" ], "rate_limit_per_second": 0, "expires_at": "string"})print(response.json())
package mainimport ( "fmt" "io" "net/http" "strings")func main() { body := strings.NewReader(`{ "url": "https://example.com/webhook", "description": "string", "filter_types": [ "string" ], "rate_limit_per_second": 0, "expires_at": "string"}`) req, _ := http.NewRequest("POST", "https://hookstream.io/v1/applications/a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6/endpoints", 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
{ "endpoint": { "id": "<string>", "org_id": "<string>", "env_id": "<string>", "application_id": "<string>", "url": "<string>", "description": "<string>", "signing_algorithm": "<string>", "status": "<string>", "filter_types": "<string>", "rate_limit_per_second": 123, "expires_at": "<string>", "created_at": "<string>", "updated_at": "<string>", "signing_secret": "<string>" }}
API Playground
Try this endpoint
POST
/applications/{appId}/endpoints