Webhooks

You can create, view and delete webhooks via this endpoint. Alternatively, you can manage your webhooks in the webapp in the Developer area.


GET/api/hooks

Show active webhooks

Query the active webhooks of your account.

Request

GET
/api/hooks
curl -G "https://gateway.seven.io/api/hooks" \
    -H "X-Api-Key: YOUR_API_KEY"

Answer

{
  "success": true,
  "code": null,
  "hooks": [
    {
      "id": "410",
      "target_url": "https://acme.inc/v1/webhooks",
      "event_type": "sms_mo",
      "event_filter": "49157123456789",
      "request_method": "GET",
      "enabled": true,
      "created": "2021-03-01 11:19:08"
    },
    {
      "id": "1277",
      "target_url": "https://hooks.seven.io/hook",
      "event_type": "all",
      "event_filter": null,
      "request_method": "JSON",
      "enabled": false,
      "created": "2021-12-30 13:33:02"
    },
    {
      "id": "1808",
      // ...
    }
  ]
}

POST/api/hooks

Register webhook

Parameters

  • Name
    target_url
    Type
    string
    Description

    Destination address of your webhook

  • Name
    event_type
    Type
    enum
    Description

    Type of event for which you would like to receive a webhook.

    Show events

    all - Sends all events
    rcs - RCS events and inbound RCS messages
    sms_mo - New inbound SMS
    dlr - Status reports of your SMS
    voice_call - Info about voice calls
    voice_status - Status updates of voice calls
    voice_dtmf - Incoming DTMF signals in voice calls
    tracking - Clicks or views of the Performance Tracking

  • Name
    event_filter
    Type
    string
    Optional
    Optional
    Description

    Optional. Sends the webhook only if the filter applies. For example, for different webhooks with different inbound numbers.

  • Name
    request_method
    Type
    enum
    Description

    Request method in which you would like to receive the webhook.

    POST - Data is sent as an HTTP POST request as application/x-www-form-urlencoded (default)
    GET - Data is sent as HTTP GET parameter
    JSON - Data is sent via HTTP POST as JSON payload

request

POST
/api/hooks
curl -X POST "https://gateway.seven.io/api/hooks" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -d "target_url=https://acme.inc/webhook/"

Answer

{
  "success": true,
  "code": null,
  "id": 12345,
  "error_message": null
}

DELETE/api/hooks

Delete webhook

Call the API with the same parameters with which the webhook was created (target_url,event_type,request_method) to delete it again. Alternatively, you can delete a webhook directly via the respective ID. To do this, enter the parameter id.

You will receive the same return as when creating the webhook.

Parameter (delete per ID)

  • Name
    id
    Type
    integer
    Description

    The ID of the webhook you want to delete.

request

DELETE
/api/hooks
curl -X DELETE "https://gateway.seven.io/api/hooks" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -d "id=123456"

Answer

{
  "success": true,
  "code": null,
  "id": 12345,
  "error_message": null
}
Last updated: 4 months ago