Referencia de la API

Client Activity

Report what your own client did (errors, timings, transactions) and read it back. Unlike the API logs, which only ever see requests that reached this service, these are the events that happen entirely on a device: a crash, a cancelled signature, a screen that failed before any request left it.

GET
/v1/activity/events

level is a floor, not an exact match: level=warn returns warnings and errors.

Requires the activity:read scope.

apiKey
headerAuthorizationBearer <API key>

Your Cosmos Pay secret API key, sent as Authorization: Bearer <apiKey>.

take?number

Page size: how many items to return (1 to 100).

Range1 <= value <= 100
Default100
skip?number

How many items to skip before this page (offset).

Range0 <= value
Default0
source?string

Only events reported by this client.

Value in"wallet""dashboard""server""sdk"
level?string

Minimum severity, not an exact match: warn returns warnings and errors.

Value in"debug""info""warn""error"
category?string

Only events of this category (exact match).

type?string

Prefix match on the event name.

network?string

Only events reported on this network (exact match).

since?string

Only events that occurred at or after this instant.

until?string

Only events that occurred at or before this instant.

OK

The body, query or path failed validation. message is an array of the individual failures.

Routes that reject a valid request for a reason of their own (an amount, a memo, a state) document the code for it on their own 400.

no_authenticated_consumer: The gateway forwarded no API key identity

insufficient_scope: the API key does not hold the scope this route requires. The shared public API key also gets this on every route that is not marked x-cosmos-public-key, with a message saying so; more scopes will not help, the key is the wrong one.

gateway_required: the request did not arrive through APISIX.

Unexpected server error. The detail is logged server-side and never returned: there is nothing in the body to branch on beyond the code.

Example Request
curl -X GET 'https://api.cosmospay.lat/cosmos-api/v1/activity/events'
Example Response
{  "data": [    {      "id": "clz9xact00001",      "source": "wallet",      "level": "error",      "category": "transaction",      "type": "payment.sent",      "message": "op_no_trust",      "sessionId": "s_9f2a1c",      "distinctId": "d_41b0c8",      "appVersion": "1.5.0",      "platform": "ext",      "network": "testnet",      "durationMs": 812,      "props": {        "asset": "XLM",        "amount": "12.5"      },      "ip": "203.0.113.7",      "userAgent": "CosmosWallet/1.5.0",      "at": "2026-09-06T12:34:56.000Z",      "receivedAt": "2026-09-06T12:35:10.000Z"    }  ],  "total": 4120,  "take": 100,  "skip": 0}
POST
/v1/activity/events

Accepted, not created: the batch is written under the consumer the gateway authenticated, and nothing in the body can change that attribution. Over-long messages are truncated and an over-sized props is replaced with a marker rather than failing the call: losing a whole batch to one malformed field is worst exactly when the client is in a state it did not anticipate.

Requires the activity:write scope. The shared public key may call it.

apiKey
headerAuthorizationBearer <API key>

Your Cosmos Pay secret API key, sent as Authorization: Bearer <apiKey>.

application/json
  1. body

A batch of client events to record under the calling consumer.

events*array<>

Up to 100 events. Clients batch: a wallet queues while offline and flushes on the next launch.

Accepted

The body, query or path failed validation. message is an array of the individual failures.

Routes that reject a valid request for a reason of their own (an amount, a memo, a state) document the code for it on their own 400.

no_authenticated_consumer: The gateway forwarded no API key identity

insufficient_scope: the API key does not hold the scope this route requires. The shared public API key also gets this on every route that is not marked x-cosmos-public-key, with a message saying so; more scopes will not help, the key is the wrong one.

gateway_required: the request did not arrive through APISIX.

The budget in x-cosmos-rate-limit is spent for this caller. Honour Retry-After.

The ratelimit-* triple rides along on successful responses too, so a client can pace itself instead of being refused. If the counter store itself is unreachable the guard fails closed and answers 503 provider_unavailable.

Unexpected server error. The detail is logged server-side and never returned: there is nothing in the body to branch on beyond the code.

Example Request
curl -X POST 'https://api.cosmospay.lat/cosmos-api/v1/activity/events' \  -H 'Content-Type: application/json' \  -d '{  "events": [    {      "type": "payment.sent"    }  ]}'
Example Response
{  "accepted": 24,  "duplicates": 0}
GET
/v1/activity/summary

Rolls up the client events this consumer reported over the last days days (default 7, at most 90), optionally for one source: the total, distinct sessions and devices, counts per level, source and category, and the 10 most frequent event types and error messages. series has one entry per UTC day, zero on a quiet one.

Requires the activity:read scope.

apiKey
headerAuthorizationBearer <API key>

Your Cosmos Pay secret API key, sent as Authorization: Bearer <apiKey>.

days?number

Days the rollup covers, today included.

Range1 <= value <= 90
Default7
source?string

Only events reported by this client.

Value in"wallet""dashboard""server""sdk"

OK

The body, query or path failed validation. message is an array of the individual failures.

Routes that reject a valid request for a reason of their own (an amount, a memo, a state) document the code for it on their own 400.

no_authenticated_consumer: The gateway forwarded no API key identity

insufficient_scope: the API key does not hold the scope this route requires. The shared public API key also gets this on every route that is not marked x-cosmos-public-key, with a message saying so; more scopes will not help, the key is the wrong one.

gateway_required: the request did not arrive through APISIX.

Unexpected server error. The detail is logged server-side and never returned: there is nothing in the body to branch on beyond the code.

Example Request
curl -X GET 'https://api.cosmospay.lat/cosmos-api/v1/activity/summary'
Example Response
{  "total": 4120,  "sessions": 318,  "devices": 96,  "levels": [    {      "key": "error",      "count": 12    }  ],  "sources": [    {      "key": "error",      "count": 12    }  ],  "categories": [    {      "key": "error",      "count": 12    }  ],  "topTypes": [    {      "key": "error",      "count": 12    }  ],  "topErrors": [    {      "key": "error",      "count": 12    }  ],  "series": [    {      "date": "2026-09-06",      "count": 128,      "errors": 4    }  ]}