> ## Documentation Index
> Fetch the complete documentation index at: https://docs.snippet.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Push Metrics

> Batch submit up to 100 metrics for a protocol.

<ParamField header="Authorization" type="string" required>
  Bearer token from the Snippet mobile app. Format: `Bearer YOUR_API_KEY`.
</ParamField>

<ParamField body="metrics" type="array[object]" required>
  List of metric objects to submit in a single request (max 100).
</ParamField>

<Expandable title="Metric object fields">
  <ResponseField name="id" type="string" required>
    Must be `{protocolId}___{Label}`. Keep `{Label}` short for widget display.
  </ResponseField>

  <ResponseField name="value" type="number" required>
    Numeric value of the metric.
  </ResponseField>

  <ResponseField name="protocolId" type="string" required>
    Protocol slug previously registered.
  </ResponseField>

  <ResponseField name="unit" type="string">
    Free-form unit label (e.g., `USD`, `%`, `BTC`).
  </ResponseField>

  <ResponseField name="timestamp" type="ISO 8601 string">
    Optional. If omitted, the server snaps to the top of the hour; if provided,
    must not be more than 5 minutes in the future.
  </ResponseField>
</Expandable>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://<your-api-host>/api/metrics" \
    -H "Authorization: Bearer <YOUR_API_KEY>" \
    -H "Content-Type: application/json" \
    -d '{
      "metrics": [
        {
          "id": "awesome-dex___TVL",
          "value": 12345678.9,
          "protocolId": "awesome-dex",
          "unit": "USD",
          "timestamp": "2025-08-05T17:00:00Z"
        },
        {
          "id": "awesome-dex___USERS_MOM",
          "value": 5.2,
          "protocolId": "awesome-dex",
          "unit": "%"
        }
      ]
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "success": true,
    "processed": 2,
    "errors": [],
    "warnings": []
  }
  ```
</ResponseExample>

<Warning>
  Max 100 metrics per request. Timestamps must be valid ISO 8601 and not more
  than 5 minutes in the future.
</Warning>
