{
    "info": {
        "name": "Northwind Trading attendance API",
        "description": "Read-only API of PunchSync. Put your key in the \"apiKey\" variable of this collection; every call sends it as \"Authorization: Bearer <key>\".",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "token",
                "value": "{{apiKey}}",
                "type": "string"
            }
        ]
    },
    "variable": [
        {
            "key": "baseUrl",
            "value": "http://attendance.example.com/api/v1",
            "type": "string"
        },
        {
            "key": "apiKey",
            "value": "",
            "type": "string"
        }
    ],
    "item": [
        {
            "name": "Start",
            "item": [
                {
                    "name": "Check the key",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": []
                        },
                        "description": "Answers when the key works, with the company name, its timezone and today's date. Call it first."
                    }
                }
            ]
        },
        {
            "name": "People",
            "item": [
                {
                    "name": "List employees",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/employees?status=active&per_page=50",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "employees"
                            ],
                            "query": [
                                {
                                    "key": "status",
                                    "value": "active"
                                },
                                {
                                    "key": "per_page",
                                    "value": "50"
                                }
                            ]
                        },
                        "description": "Everyone on the books, page by page, sorted by name. Active people only unless you ask otherwise."
                    }
                },
                {
                    "name": "One employee",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/employees/:id",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "employees",
                                ":id"
                            ],
                            "variable": [
                                {
                                    "key": "id",
                                    "value": "1"
                                }
                            ]
                        },
                        "description": "The same fields as the list, for one person, active or not."
                    }
                }
            ]
        },
        {
            "name": "Attendance",
            "item": [
                {
                    "name": "Punches",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/punches?since_id=0&per_page=100",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "punches"
                            ],
                            "query": [
                                {
                                    "key": "since_id",
                                    "value": "0"
                                },
                                {
                                    "key": "per_page",
                                    "value": "100"
                                }
                            ]
                        },
                        "description": "Raw punches from the machines. To keep a copy in sync, send the last id you have as since_id and store next_since_id for the next call; nothing is missed or repeated. Or ask for dates with from and to (at most 31 days)."
                    }
                },
                {
                    "name": "Attendance",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/attendance?date=2026-09-30",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "attendance"
                            ],
                            "query": [
                                {
                                    "key": "date",
                                    "value": "2026-09-30"
                                }
                            ]
                        },
                        "description": "Worked-out days with the same rules as the app's own reports: status, first in, last out, late and overtime minutes, and totals. Use date for one day, or from and to (at most 31 days)."
                    }
                }
            ]
        },
        {
            "name": "Lists",
            "item": [
                {
                    "name": "Devices",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/devices",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "devices"
                            ]
                        },
                        "description": "The attendance machines. Punches from a machine that is not active are kept but not counted."
                    }
                },
                {
                    "name": "Departments",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/departments",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "departments"
                            ]
                        },
                        "description": "Department ids and names, for the department filter above."
                    }
                }
            ]
        }
    ]
}