Logo PopinaPopina API

Upsert a webhook

Update or insert a webhook into the database. A webhook is linked to a specific location and recipient, registering an endpoint URL for an event (e.g., order.paid). If the webhook doesn't exist, it will be created. If it does exist, it will be updated.

POST/v1/webhooks/
authorization<token>

To get an API key, please contact us. We'll be happy to help you.

In: header

eventsarray<string>
endpointUrlstring
Formaturi
locationIdstring
Formatuuid
recipientIdstring
Formatuuid
id?string
Formatuuid

Response Body

application/json

curl -X POST "http://localhost:4007/v1/webhooks/" \  -H "Content-Type: application/json" \  -d '{    "id": "5f99d799-73d4-43e0-b247-65918dcdb85f",    "events": [      "order.paid"    ],    "endpointUrl": "https://example.com",    "locationId": "5f99d799-73d4-43e0-b247-65918dcdb85f",    "recipientId": "5f99d799-73d4-43e0-b247-65918dcdb85f"  }'
{
  "id": "5f99d799-73d4-43e0-b247-65918dcdb85f",
  "createdAt": "2021-08-02T16:52:15.000Z",
  "updatedAt": "2021-08-02T16:52:15.000Z",
  "events": [
    "order.paid"
  ],
  "endpointUrl": "https://example.com",
  "locationId": "5f99d799-73d4-43e0-b247-65918dcdb85f",
  "recipientId": "5f99d799-73d4-43e0-b247-65918dcdb85f"
}