Skip to main content
POST
/
webhook_endpoints
Create webhook subscriptions
curl --request POST \
  --url https://api.chargeapi.co/v1/webhook_endpoints \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "<string>",
  "enabled_events": [
    "<string>"
  ],
  "description": "<string>",
  "api_version": "<string>"
}'
{
  "id": null,
  "object": null,
  "api_version": null,
  "application": null,
  "created": null,
  "description": null,
  "enabled_events": [
    null
  ],
  "livemode": null,
  "metadata": null,
  "secret": null,
  "status": null,
  "url": null
}

Body

application/json
url
string<uri>
required

Public HTTPS URL that will receive webhook POSTs.

enabled_events
string[]
required

List of event types to subscribe to (for example, "charge.succeeded").

Minimum length: 1
description
string

Optional description for your own reference.

api_version
string

Override the default API version for this endpoint.

Response

Returns the newly created Webhook Endpoint object, including a secret property used to sign events.

id
string

Unique identifier for the webhook endpoint object.

Example:

null

object
string

String representing the object’s type. Always webhook_endpoint.

Example:

null

api_version
string | null

API version this webhook endpoint is configured to receive. Defaults to the account's version if null.

Example:

null

application
string | null

ID of the application associated with this webhook, if applicable.

Example:

null

created
integer

Time at which the webhook endpoint was created.

Example:

null

description
string | null

An optional description for the webhook endpoint.

Example:

null

enabled_events
string[]

List of event types that will trigger this webhook endpoint.

livemode
boolean

Indicates whether this webhook endpoint is operating in live or test mode.

Example:

null

metadata
object

Set of key-value pairs for attaching custom structured data to the webhook endpoint.

Example:

null

secret
string

Secret used to sign webhook payloads sent to this endpoint.

Example:

null

status
enum<string>

Current status of the webhook endpoint.

Available options:
enabled,
disabled
Example:

null

url
string<uri>

The URL that will receive the webhook POST requests.

Example:

null