{
  "info": {
    "_postman_id": "aifitnessapi-terra",
    "name": "Terra (aifitnessapi.com)",
    "description": "Terra: Webhook samples requests built from the vendor documentation aifitnessapi.com quotes. Generated by scripts/build-collections.mjs; no secrets included. https://aifitnessapi.com/collections",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "Webhook samples",
      "description": "Terra's documented example notifications, sent to {{local_url}} (your local handler) unchanged. Signature: terra-signature: t=<timestamp>,v1=<signature>; HMAC-SHA256 keyed by the webhook's signing secret over the timestamp, a \".\" and the raw body. Ignore schemes other than v1. Source: Terra docs, “Webhooks”, https://docs.tryterra.co/unified-api/integration-setup/setting-up-data-destinations/webhooks\n\nHeaders that carry a signature hold the placeholder Terra prints, so a handler that verifies signatures will reject these: to send correctly signed requests, use https://aifitnessapi.com/webhooks/send-sample.mjs. Respond: Respond within 8 seconds; accept immediately (return 200) and process asynchronously. Sustained timeouts, 5xx and repeated 4xx can trip a per-destination circuit breaker.\n\nPayload library with JSON Schemas: https://aifitnessapi.com/webhooks#terra.",
      "item": [
        {
          "name": "S3 payload (ping mode)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{local_url}}",
              "host": [
                "{{local_url}}"
              ]
            },
            "description": "New data records are available and the destination uses ping mode: download url before it expires and process it as a normal data event.\n\nTerra's S3 upload event format. Source: Terra API reference, “Event Types”, https://docs.tryterra.co/reference/health-and-fitness-api/event-types.md",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": \"success\",\n  \"type\": \"s3_payload\",\n  \"url\": \"https://example.com\",\n  \"expires_in\": 300,\n  \"user_id\": \"0d09d3a4-f6e8-4f1c-9a3e-2b6c1d5e7f80\",\n  \"reference_id\": \"your-user-ref-123\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "local_url",
      "value": "http://localhost:3000/webhooks/terra",
      "type": "string",
      "description": "Where your webhook handler listens."
    }
  ]
}
