Skip to Content
Notification APIDocs
Statistics

Statistics overview

GET
/api/v1/companies/{companyId}/projects/{projectId}/stats/overview

Message and dispatch counts by status for a range (default: last 7 days).

Required permission: messages.read. See the guide for details.

Error codes:

  • 400 validation.failed

Every endpoint can also answer 401 (missing or invalid key), 403 (route outside the key's project or permission) and 429 rate_limit.exceeded.

Authorization

ApiKey
headerX-Api-Key<token>

Project API key: nb_<prefix>_<secret>.

Path Parameters

companyId*string

Id of the company that owns the project (shown with the API key in the dashboard).

Formatuuid
projectId*string

Id of the project the API key belongs to.

Formatuuid

Query Parameters

from?string

Inclusive start (ISO 8601). Default: 7 days before to. Range up to 366 days.

Formatdate-time
to?string

Exclusive end (ISO 8601). Default: now.

Formatdate-time

Response Body

OK

application/json
  1. response
from*string
Formatdate-time
to*string
Formatdate-time
messages*integer
Formatint32
dispatches*integer
Formatint32
messagesByStatus*
dispatchesByStatus*
successRate*||

(sent + delivered) / (sent + delivered + failed), rounded to 4 decimals; null while nothing has finished.

Match^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$
Formatdouble
stalePendingMessages*integer

Pending messages older than 15 minutes that are due (ignores the range).

Formatint32
Example Request
curl -X GET 'https://api.gbnotification.dokploy.geobilgi.net/api/v1/companies/497f6eca-6276-4993-bfeb-53cbbbba6f08/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/stats/overview'
Example Response
{  "from": "2019-08-24T14:15:22Z",  "to": "2019-08-24T14:15:22Z",  "messages": 0,  "dispatches": 0,  "messagesByStatus": {    "property1": 0,    "property2": 0  },  "dispatchesByStatus": {    "property1": 0,    "property2": 0  },  "successRate": null,  "stalePendingMessages": 0}