{
  "info": {
    "_postman_id": "ac49d3f6-3b52-4bb4-8535-dedb52d82fd1",
    "name": "TotemClock Company API v1",
    "description": "Company-scoped TotemClock API. Create a key in API e integrazioni, set apiKey, and the server derives the company from that credential. Never send an organization ID.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "apikey",
    "apikey": [
      { "key": "key", "value": "X-API-Key", "type": "string" },
      { "key": "value", "value": "{{apiKey}}", "type": "string" },
      { "key": "in", "value": "header", "type": "string" }
    ]
  },
  "item": [
    {
      "name": "Company",
      "item": [
        { "name": "Get organization", "request": { "method": "GET", "url": { "raw": "{{baseUrl}}/api/v1/organization" }, "description": "Requires organization:read." } },
        { "name": "List active employees", "request": { "method": "GET", "url": { "raw": "{{baseUrl}}/api/v1/employees" }, "description": "Requires employees:read. Sensitive demographic and authentication fields are excluded." } },
        { "name": "List active sites", "request": { "method": "GET", "url": { "raw": "{{baseUrl}}/api/v1/sites" }, "description": "Requires sites:read." } },
        { "name": "List schedules and assignments", "request": { "method": "GET", "url": { "raw": "{{baseUrl}}/api/v1/schedules" }, "description": "Requires schedules:read." } }
      ]
    },
    {
      "name": "Punches",
      "item": [
        {
          "name": "List punches",
          "request": {
            "method": "GET",
            "url": { "raw": "{{baseUrl}}/api/v1/punches?from={{from}}&to={{to}}&limit=100" },
            "description": "Requires punches:read. The range is mandatory and cannot exceed 366 days. Add employeeId={{employeeId}} when needed."
          }
        },
        {
          "name": "Create external punch",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"externalId\": \"source-system-0001\",\n  \"employeeId\": \"{{employeeId}}\",\n  \"type\": \"IN\",\n  \"occurredAt\": \"2026-09-09T08:30:00+02:00\",\n  \"note\": \"Imported through Company API\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": { "raw": "{{baseUrl}}/api/v1/punches" },
            "description": "Requires punches:write. externalId makes retries idempotent within the company."
          }
        }
      ]
    },
    {
      "name": "Calculated attendance",
      "item": [
        { "name": "Get calculated employee day", "request": { "method": "GET", "url": { "raw": "{{baseUrl}}/api/v1/employees/{{employeeId}}/days/{{date}}" }, "description": "Requires timecards:read. Returns the calculation plus source punches." } },
        { "name": "Get daily timecards", "request": { "method": "GET", "url": { "raw": "{{baseUrl}}/api/v1/timecards?date={{date}}" }, "description": "Requires timecards:read." } },
        { "name": "Get monthly employee timecard", "request": { "method": "GET", "url": { "raw": "{{baseUrl}}/api/v1/monthly-timecards?month={{month}}&employeeId={{employeeId}}" }, "description": "Requires timecards:read." } },
        { "name": "Get monthly employee timesheet", "request": { "method": "GET", "url": { "raw": "{{baseUrl}}/api/v1/timesheets?month={{month}}&employeeId={{employeeId}}" }, "description": "Requires timesheets:read." } }
      ]
    },
    {
      "name": "Exports",
      "item": [
        { "name": "Download timecards CSV", "request": { "method": "GET", "url": { "raw": "{{baseUrl}}/api/v1/exports/timecards.csv?month={{month}}&lang=it" }, "description": "Requires exports:read. employeeId is optional." } },
        { "name": "Download timesheets CSV", "request": { "method": "GET", "url": { "raw": "{{baseUrl}}/api/v1/exports/timesheets.csv?month={{month}}&lang=it" }, "description": "Requires exports:read. employeeId is optional." } }
      ]
    }
  ],
  "variable": [
    { "key": "baseUrl", "value": "https://totemclock.com", "type": "string" },
    { "key": "apiKey", "value": "tc_live_replace_me", "type": "secret" },
    { "key": "employeeId", "value": "00000000-0000-4000-8000-000000000000", "type": "string" },
    { "key": "date", "value": "2026-09-09", "type": "string" },
    { "key": "month", "value": "2026-09", "type": "string" },
    { "key": "from", "value": "2026-09-01T00:00:00Z", "type": "string" },
    { "key": "to", "value": "2026-10-01T00:00:00Z", "type": "string" }
  ]
}
