Create Credit notification
Create a new Credit notification for one of your accounts
Request
Endpoint
Messaging Plus expects a POST request
https://mplus.instagiv.com/notification/creditQuery strings
| Key | Required | Description | Example |
|---|---|---|---|
key | true | Organization API key | ?key=aaaabbbbcccc111222333 |
Body
{
"account_uuid": "ecc6808e-d3a6-4668-8f8f-cc8913b5cac7",
"threshold_type": "packaged_fixed_number",
"threshold_value": 5,
"email_addresses": ["me@my-company.co.uk"],
"webhook_url": "https://my-website.com/notify-me"
}Body parameters
| Key | Required | Expected value | Description |
|---|---|---|---|
account_uuid | true | string | The UUID of the account to attach the notification to |
threshold_type | true | ThresholdType (string) | The ThresholdType for this notification |
threshold_value | true | 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
{
"status": "success",
"notification_uuid": "3dd57172-eb3b-4158-865b-1e65688933c8"
}Body parameters
| Key | Expected value | Description |
|---|---|---|
status | string | Whether the request was successful |
notification_uuid | string | A UUID representing the notification that was just created |
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.
{
"account_uuid": "ecc6808e-d3a6-4668-8f8f-cc8913b5cac7",
"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: