Webhook

Sets or edits a [webhook](#webhook), i.e. an event notification handler.

post/webhook/set.json

Request

  • Base URL: https://api.unione.io/en/transactional/api/v1
  • URL: https://api.unione.io/en/transactional/api/v1/webhook/set.json
  • Auth: API key in header X-API-KEY

Request body

urlstring uri required

URL that will receive the notification when an event occurs. The URL should be unique for a user or a project. Only ASCII characters are supported for now in URL, please convert to Punycode if you need to use non-ASCII characters.

status'active' | 'disabled' | 'stopped'

Webhook status, "active" by default. "disabled" means that webhook has been disabled by the user, "stopped" means that webhook has been stopped by the system after 24h of failed calls (with minimum of 10 distinct events).

event_format'json_post' | 'json_post_gzip'

Notification format. "json_post"(default) or "json_post_gzip".

delivery_info0 | 1

Shall detailed delivery info be returned(1) or not(0). When it's 1, the information about SMTP response and internal delivery status is returned for "hard_bounced" and "soft_bounced" email statuses; the user agent, recipient IP address, and detected geo fields are returned for "opened" and "clicked" statuses; URL is returned for "clicked" status. For "delivered", "soft_bounced" and "hard_bounced" statuses UniOne may also return sender_ip, the IP address of the SMTP server that sent the message, if available.

single_event0 | 1

0=several event notifications can be reported in single webhook call, 1=only single event can be reported in one call (not recommended).

max_parallelinteger

Maximum quantity of permitted parallel queries to your server. The more your server can handle - the better.

Example request

{
  "url": "https://yourhost.example.com/unione-webhook",
  "events": {
    "spam_block": [
      "*"
    ],
    "email_status": [
      "delivered",
      "opened",
      "clicked",
      "unsubscribed",
      "subscribed",
      "soft_bounced",
      "hard_bounced",
      "spam"
    ]
  }
}

Response

Webhook set successfully.

status'success' required

"success" string

Example response

{
  "object": {
    "events": {
      "spam_block": [
        "*"
      ],
      "email_status": [
        "delivered",
        "opened",
        "clicked",
        "unsubscribed",
        "subscribed",
        "soft_bounced",
        "hard_bounced",
        "spam"
      ]
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.