Reading Facebook’s documentation, there are various levels of limits for the messages a business can send in 24 hours.
1K business-initiated conversations
10K business-initiated conversations
100K business-initiated conversations
An unlimited number of business-initiated conversations
What I need via an API call is the current limit and the number of messages sent in 24 hours, so I can halt any further sends from my application if the limit is nearly reached. Do you know what API call should I execute in order to get the limit?
At the moment, the only API call that comes close to this result is the following:
GET https://graph.facebook.com/v17.0/{phone-number-id}/phone_numbers?access_token={access_token}
the API call returns this JSON:
{
"data": [
{
"verified_name": "{company-name}",
"code_verification_status": "EXPIRED",
"display_phone_number": "{company-number}",
"quality_rating": "GREEN",
"platform_type": "CLOUD_API",
"throughput": {
"level": "STANDARD"
},
"webhook_configuration": {
"application": "{webhook-url}"
},
"id": "{phone-number-id}"
}
]
}
but what I except is something like this
{
"id": "your-phone-number-id",
"quality_rating": "GREEN",
"message_limit": 1000,
"next_limit_reset_timestamp": "2024-06-06T00:00:00Z",
"tier": "TIER_1"
}
2
Answers
While you can’t directly retrieve the message limit or sent count via the API, here’s what you can do:
Monitor Quality Ratings:
Use the quality_rating field to ensure your messages maintain a GREEN rating. Degraded quality can impact limits.
Proactively adjust messaging frequency if flagged (e.g., flagged or degraded ratings).
Scale Based on Metrics:
Use internal counters within your system to track how many business-initiated conversations you’re sending.
Stop sending once you hit a known threshold (e.g., 1K, 10K, etc.).
Feature Requests:
Consider submitting feedback to Meta’s developer support to request such an API featur
The number you’re allowed to send should be in your contract. Simply set that number as a configuration parameter for your application.
The number remaining you can keep track of yourself by simply counting what you’ve sent already (slightly trickier if you use the same account for multiple applications that all send messages, but still possible by using say an in-house service that gets called by each of these (having separate accounts for each of your services that send messages is probably a good idea to prevent one from hogging them all as well as for traceability and internal accounting (especially if they are to be billed to separate departments within your own organisation).
Indeed it’d be convenient if facebook had an API for that, but as they apparently don’t, that’s the way to go.