{
  "info": {
    "_postman_id": "0f58a7a3-0c2c-4dcb-9c65-9f13a4bc1d77",
    "name": "ProBG Time Tracking API v1",
    "description": "Read-only API collection for Clients, Projects, and Time Entries. Set the collection variables `base_url` and `token` before sending requests.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{token}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://tracker.probg.com/api/v1",
      "type": "string"
    },
    {
      "key": "token",
      "value": "",
      "type": "string"
    },
    {
      "key": "client_id",
      "value": "1",
      "type": "string"
    },
    {
      "key": "project_id",
      "value": "1",
      "type": "string"
    },
    {
      "key": "time_entry_id",
      "value": "1",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Clients",
      "description": "Requires the `clients:read` scope.",
      "item": [
        {
          "name": "List clients",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/clients?status=active&per_page=25",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "clients"
              ],
              "query": [
                {
                  "key": "q",
                  "value": "",
                  "disabled": true,
                  "description": "Search name, company, contact, email, or company ID."
                },
                {
                  "key": "status",
                  "value": "active",
                  "description": "active | inactive | archived | all"
                },
                {
                  "key": "updated_since",
                  "value": "2026-10-01T00:00:00Z",
                  "disabled": true
                },
                {
                  "key": "page",
                  "value": "1",
                  "disabled": true
                },
                {
                  "key": "per_page",
                  "value": "25"
                }
              ]
            },
            "description": "Returns Account-scoped clients. Default status is `active`."
          },
          "response": []
        },
        {
          "name": "Get client",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/clients/{{client_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "clients",
                "{{client_id}}"
              ]
            },
            "description": "Returns one client from the token's Account. Cross-account IDs return 404."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Projects",
      "description": "Requires the `projects:read` scope.",
      "item": [
        {
          "name": "List projects",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/projects?status=active&per_page=25",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "projects"
              ],
              "query": [
                {
                  "key": "q",
                  "value": "",
                  "disabled": true,
                  "description": "Search project name and description."
                },
                {
                  "key": "client_id",
                  "value": "{{client_id}}",
                  "disabled": true
                },
                {
                  "key": "status",
                  "value": "active",
                  "description": "active | completed | archived | all"
                },
                {
                  "key": "updated_since",
                  "value": "2026-10-01T00:00:00Z",
                  "disabled": true
                },
                {
                  "key": "page",
                  "value": "1",
                  "disabled": true
                },
                {
                  "key": "per_page",
                  "value": "25"
                }
              ]
            },
            "description": "Returns Account-scoped projects."
          },
          "response": []
        },
        {
          "name": "Get project",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/projects/{{project_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "projects",
                "{{project_id}}"
              ]
            },
            "description": "Returns one project from the token's Account."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Time Entries",
      "description": "Requires the `time:read` scope.",
      "item": [
        {
          "name": "List time entries",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/time-entries?per_page=25",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "time-entries"
              ],
              "query": [
                {
                  "key": "client_id",
                  "value": "{{client_id}}",
                  "disabled": true
                },
                {
                  "key": "project_id",
                  "value": "{{project_id}}",
                  "disabled": true
                },
                {
                  "key": "task_id",
                  "value": "1",
                  "disabled": true
                },
                {
                  "key": "user_id",
                  "value": "1",
                  "disabled": true
                },
                {
                  "key": "from",
                  "value": "2026-10-01",
                  "disabled": true
                },
                {
                  "key": "to",
                  "value": "2026-10-31",
                  "disabled": true
                },
                {
                  "key": "billable",
                  "value": "true",
                  "description": "true/false or 1/0; empty means no filter",
                  "disabled": true
                },
                {
                  "key": "billed",
                  "value": "false",
                  "description": "true/false or 1/0; empty means no filter",
                  "disabled": true
                },
                {
                  "key": "q",
                  "value": "",
                  "disabled": true,
                  "description": "Search title and description."
                },
                {
                  "key": "updated_since",
                  "value": "2026-10-01T00:00:00Z",
                  "disabled": true
                },
                {
                  "key": "page",
                  "value": "1",
                  "disabled": true
                },
                {
                  "key": "per_page",
                  "value": "25"
                }
              ]
            },
            "description": "Returns tracked time. Labor-cost snapshots and private notes are intentionally excluded."
          },
          "response": []
        },
        {
          "name": "Get time entry",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/time-entries/{{time_entry_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "time-entries",
                "{{time_entry_id}}"
              ]
            },
            "description": "Returns one time entry from the token's Account."
          },
          "response": []
        }
      ]
    }
  ],
  "event": [
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "exec": [
          "pm.test('Response is JSON', function () {",
          "    pm.expect(pm.response.headers.get('Content-Type') || '').to.include('application/json');",
          "});",
          "pm.test('Request did not hit a server error', function () {",
          "    pm.expect(pm.response.code).to.be.below(500);",
          "});"
        ]
      }
    }
  ]
}
