Skip to content

Create Credit notification

Create a new Credit notification for one of your accounts

Request

Endpoint

Messaging Plus expects a POST request

POST https://mplus.instagiv.com/notification/credit

Query strings

KeyRequiredDescriptionExample
keytrueOrganization API key?key=aaaabbbbcccc111222333

Body

json
{
    "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

KeyRequiredExpected valueDescription
account_uuidtruestringThe UUID of the account to attach the notification to
threshold_typetrueThresholdType (string)The ThresholdType for this notification
threshold_valuetruenumericThe 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": "success",
    "notification_uuid": "3dd57172-eb3b-4158-865b-1e65688933c8"
}

Body parameters

KeyExpected valueDescription
statusstringWhether the request was successful
notification_uuidstringA 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.

json
{
    "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:

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

Messaging Plus is a Cymba API