Edit Credit notification
Edit an existing Credit notification
Request
Endpoint
Messaging Plus expects a PATCH request
https://mplus.instagiv.com/notification/credit/{notification-uuid}| Key | Description | Example |
|---|---|---|
notification-uuid | Notification UUID to update | 3dd57172-eb3b-4158-865b-1e65688933c8 |
Query strings
| Key | Required | Description | Example |
|---|---|---|---|
key | true | Organization API key | ?key=aaaabbbbcccc111222333 |
Body
json
{
"threshold_type": "packaged_percentage",
"threshold_value": 0.05
}json
{
"email_addresses": [
"email1@my-company.co.uk", "email2@my-company.co.uk"
]
}json
{
"webhook_url": null
}json
{
"threshold_type": "packaged_percentage",
"threshold_value": 0.05,
"email_addresses": [
"email1@my-company.co.uk", "email2@my-company.co.uk"
],
"webhook_url": null
}Body parameters
| Key | Required | Expected value | Description |
|---|---|---|---|
threshold_type | false | ThresholdType (string) | The ThresholdType for this notification |
threshold_value | false | numeric | The threshold value for this notification |
email_addresses | false | string[] | List of email addresses to send notifications to if triggered |
webhook_url | false | string | URL to send a webhook request to if triggered |
ThresholdType string
We support 5 different threshold_types, each of which can be either a fixed_number or percentage threshold.
| Value | Type | Description |
|---|---|---|
paid_negative_fixed_number | fixed_number | Trigger when remaining negative credits fall below a fixed number |
paid_negative_percentage | percentage | Trigger when remaining negative credits fall below a percentage of the negative limit |
paid_fixed_number | fixed_number | Trigger when paid credits fall below a fixed number |
packaged_fixed_number | fixed_number | Trigger when packaged credits fall below a fixed number |
packaged_percentage | percentage | Trigger when packaged credits fall below a percentage of the packaged credit refill value |
Threshold types with a fixed_number threshold must have the threshold_value supplied as exactly the value you want credits to fall below. Eg. 120 represents a credit threshold of 120 credits.
Threshold types with a percentage threshold must have the threshold_value supplied as a 0..1 floating point number. Eg. 0.25 represents a threshold of 25%.
Response
Body
json
{
"status": "updated",
}Body parameters
| Key | Expected value | Description |
|---|---|---|
status | string | Outcome of the request |
Specify Webhook endpoint
If you specify the webhook parameter as part of your request, we will make a HTTPS request to the endpoint you specify when the notification gets triggered.
json
{
"threshold_type": "packaged_percentage",
"threshold_value": 0.05,
"email_addresses": [],
"webhook_url": "https://my-website.co.uk/notify?id=123"
}API reference for receiving credit notification webhook requests: