Skip to main content
POST
/
v1
/
notifications
/
webhooks
Create webhook
curl --request POST \
  --url https://api-m.sandbox.paypal.com/v1/notifications/webhooks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "https://example.com/example_webhook",
  "event_types": [
    {
      "name": "PAYMENT.AUTHORIZATION.CREATED"
    },
    {
      "name": "PAYMENT.AUTHORIZATION.VOIDED"
    }
  ]
}'
{
  "id": "<string>",
  "url": "<string>",
  "event_types": [
    {
      "name": "<string>",
      "description": "<string>",
      "status": "<string>",
      "resource_versions": [
        "<string>"
      ]
    }
  ],
  "links": [
    {
      "href": "<string>",
      "rel": "<string>",
      "method": "GET"
    }
  ]
}

Authorizations

Authorization
string
header
required

Oauth 2.0 authentication

Body

application/json

One or more webhook objects.

url
string<uri>
required

The URL that is configured to listen on localhost for incoming POST notification messages that contain event information.

Maximum length: 2048
event_types
Event Type · object[]
required

An array of events to which to subscribe your webhook. To subscribe to all events, including events as they are added, specify the asterisk wild card. To replace the event_types array, specify the asterisk wild card. To list all supported events, <a href="#event-type_list">list available events</a>.

Maximum length: 500

Response

A successful request returns the HTTP 201 Created status code and a JSON response body with a webhook object that includes the webhook ID for later use.

One or more webhook objects.

url
string<uri>
required

The URL that is configured to listen on localhost for incoming POST notification messages that contain event information.

Maximum length: 2048
event_types
Event Type · object[]
required

An array of events to which to subscribe your webhook. To subscribe to all events, including events as they are added, specify the asterisk wild card. To replace the event_types array, specify the asterisk wild card. To list all supported events, <a href="#event-type_list">list available events</a>.

Maximum length: 500
id
string

The ID of the webhook.

An array of request-related HATEOAS links.

I