Skip to content

Edit Credit notification

Edit an existing Credit notification

Request

Endpoint

Messaging Plus expects a PATCH request

PATCH https://mplus.instagiv.com/notification/credit/{notification-uuid}
KeyDescriptionExample
notification-uuidNotification UUID to update3dd57172-eb3b-4158-865b-1e65688933c8

Query strings

KeyRequiredDescriptionExample
keytrueOrganization 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

KeyRequiredExpected valueDescription
threshold_typefalseThresholdType (string)The ThresholdType for this notification
threshold_valuefalsenumericThe threshold value for this notification
email_addressesfalsestring[]List of email addresses to send notifications to if triggered
webhook_urlfalsestringURL 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.

ValueTypeDescription
paid_negative_fixed_numberfixed_numberTrigger when remaining negative credits fall below a fixed number
paid_negative_percentagepercentageTrigger when remaining negative credits fall below a percentage of the negative limit
paid_fixed_numberfixed_numberTrigger when paid credits fall below a fixed number
packaged_fixed_numberfixed_numberTrigger when packaged credits fall below a fixed number
packaged_percentagepercentageTrigger 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

KeyExpected valueDescription
statusstringOutcome 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:

Credit notification webhook
Receive webhook requests for triggered credit notifications
POST <your-endpoint>

Messaging Plus is a Cymba API