Skip to main content
GET
/
api
/
instance
/
metrics
/
:instance
Read Metrics
curl --request GET \
  --url https://api.example.com/api/instance/metrics/:instance \
  --header 'token: <token>'

Documentation Index

Fetch the complete documentation index at: https://docs.ryzeapi.cloud/llms.txt

Use this file to discover all available pages before exploring further.

Auth: TokenAccount or TokenInstanceRate-limit: Global (100/min) • Idempotent: yes

Description

Returns message counters (total, by type, by status, last 7/30 days, unique contacts, etc.) for an instance or a consolidated set of several at once.

How it works

The :instance parameter accepts two formats:
  • A single instance: /metrics/sales returns its metrics
  • Multiple instances: /metrics/sales,support,marketing returns a single object with the values summed across them
When you pass several, numeric values are summed, timestamps return the smallest/largest (first message / last message), and the instance field of the response brings the original list.

Examples

One instance

Passing a single name in the path returns the metrics of that instance in isolation, ideal for individual dashboards or for reading statistics of a specific number.
curl -X GET "https://ryzeapi.cloud/api/instance/metrics/sales" \
  -H "token: $Token_Instance"

Multiple (consolidated)

Passing several names separated by comma returns a single object with numeric values summed across instances. Useful for aggregated views per department or account.
curl -X GET "https://ryzeapi.cloud/api/instance/metrics/sales,support,marketing" \
  -H "token: $Token_Account"

Path parameters

instance
string
required
Single name (e.g., sales) or comma-separated list (e.g., sales,support). Spaces around commas are accepted.

Headers

token
string
required
TokenAccount or TokenInstance.

Success response

200 OK
{
  "success": true,
  "message": "Metrics retrieved successfully",
  "metrics": {
    "instance": "sales",
    "totalMessages": 1523,
    "messagesReceived": 981,
    "messagesSent": 542,
    "messagesByType": {
      "text": 1205,
      "image": 187,
      "audio": 72,
      "video": 34,
      "document": 15,
      "sticker": 10
    },
    "groupMessages": 384,
    "individualMessages": 1139,
    "messagesWithMedia": 318,
    "mediaByType": {
      "image": 187,
      "audio": 72,
      "video": 34,
      "document": 15,
      "sticker": 10
    },
    "messagesByStatus": {
      "sent": 542,
      "received": 981,
      "delivered": 320,
      "read": 210,
      "pending": 12
    },
    "uniqueChats": 97,
    "uniqueGroups": 14,
    "uniqueContacts": 83,
    "messagesLast7Days": 412,
    "messagesLast30Days": 1287,
    "firstMessageAt": "2026-02-01T15:32:10Z",
    "lastMessageAt": "2026-04-18T23:14:55Z"
  }
}

Response fields

FieldWhat it is
totalMessagesTotal messages sent + received
messagesReceived / messagesSentBreakdown by direction
messagesByTypeCount by type (text, image, audio, video, document, sticker, etc.)
groupMessages / individualMessagesGroup vs 1-to-1 breakdown
messagesWithMediaHow many had attached media
mediaByTypeMedia count by type
messagesByStatusStatus breakdown (pending, sent, delivered, read, played, failed)
uniqueChats / uniqueGroups / uniqueContactsUnique counts
messagesLast7Days / messagesLast30DaysRecency
firstMessageAt / lastMessageAtEdge dates

Errors

HTTPCondition
400Empty path or only commas
401Token missing or invalid
404Any instance in the list does not exist
429More than 100 requests per minute

Notes

If the instance has ignoreGroupMessages active, group messages are not counted, groupMessages may appear as 0.
For high-frequency dashboards, consider storing the values on your side, each call performs full computations and can take time on instances with high volume.

Next

List instances

Current connection state and integrations summary.

Update settings

Adjust behavior flags such as ignoreGroupMessages.