# Employees and invitations during a period

`GET https://api.kapiworks.com/v1/people`

Employees and invitation records that existed between `from` and `to`. Requires `people:read`. Names, work emails and certificate check codes also need `people:read`; without it they are left out.

Scope: `people:read`.

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `from` | string (date-time) or string (date) | No | Required on the first page. Period start, inclusive; a date starts the company's day. Omit it with a cursor, which keeps it. At most 400 days before `to`. |
| `to` | string (date-time) or string (date) | No | Required on the first page. Period end, inclusive, as an instant or a company date. Omit it with a cursor, which keeps it. |
| `cursor` | string | No | Opaque next_cursor from the previous page. Send it unchanged to the same endpoint. It pins the snapshot and filters, and grants no access. |
| `limit` | integer | No | Rows per page, 1 to 200. Larger values are treated as 200. A page can hold fewer rows to stay within 3 MiB, so follow next_cursor until it is null. |

## Responses

| Status | Description |
| --- | --- |
| 200 | One page from a pinned company snapshot. |
| 400 | RFC 9457 problem details. Codes: invalid_request, invalid_cursor, key_in_url. Act on `code` or `type`; never parse `detail`. |
| 401 | RFC 9457 problem details. Codes: invalid_token. Act on `code` or `type`; never parse `detail`. |
| 403 | RFC 9457 problem details. Codes: insufficient_scope, ip_not_allowed. Act on `code` or `type`; never parse `detail`. |
| 404 | RFC 9457 problem details. Codes: not_found. Act on `code` or `type`; never parse `detail`. |
| 405 | RFC 9457 problem details. Codes: method_not_allowed. Act on `code` or `type`; never parse `detail`. |
| 422 | RFC 9457 problem details. Codes: before_history, record_too_large. Act on `code` or `type`; never parse `detail`. |
| 429 | RFC 9457 problem details. Codes: rate_limited, concurrent_limit. Act on `code` or `type`; never parse `detail`. |
| 502 | RFC 9457 problem details. Codes: read_failed. Act on `code` or `type`; never parse `detail`. |
| 503 | RFC 9457 problem details. Codes: unavailable, upstream_unavailable, writer_unavailable. Act on `code` or `type`; never parse `detail`. |
| 504 | RFC 9457 problem details. Codes: read_timeout. Act on `code` or `type`; never parse `detail`. |

## Fields of each row

| Field | Type | Meaning |
| --- | --- | --- |
| `deployment_id` | string (uuid) | Kapi deployment UUID. |
| `organization_id` | string (uuid) | Company UUID; the tenant boundary. |
| `learning_space_id` | string (uuid) | Learning-space UUID. |
| `sequence` | integer | Sequence of this stored row version in the company history; snapshot.sequence is the upper boundary for the pull. |
| `valid_from` | string (date-time) | When these facts took effect. |
| `recorded_at` | string (date-time) | When the history writer captured them. |
| `cause` | string | first, change or sweep. |
| `logic_version` | integer | Version of the shared owed-learning decider. |
| `person_id` | string (uuid) | Stable employee or invitation row UUID. |
| `learner_profile_id` | string or null (uuid) | Employee profile UUID; retained after erasure. |
| `invitation_id` | string or null (uuid) | Invitation UUID for invitation rows. |
| `entry_type` | string | employee or invitation; accepted invitations and employees are distinct source rows. |
| `person_name` | string or null | Name from its current source row. Erased person once Kapi erased the person at the company’s instruction. Certificate names are the issued subject name until then. |
| `work_email` | string or null | Address on the current source employee invitation; not the Auth account email. Null for an erased person. |
| `invited_at` | string or null (date-time) | Invitation creation time. |
| `joined_at` | string or null (date-time) | When the person joined Kapi; not an employment start date. |
| `left_at` | string or null (date-time) | When access ended in Kapi. |
| `invitation_expires_at` | string or null (date-time) | Invitation expiry time. |
| `invitation_state` | string or null | Stored invitation state. |
| `invitation_status` | string or null | Invitation state at the requested moment, including expiry. |
| `access_state` | string | active, suspended, ended, erased, invited or staff_practice. erased means Kapi removed the person at the company’s instruction. |
| `team_ids` | array of string (uuid) | JSON array of company team UUIDs. |
| `doors` | array of string | JSON array of audience doors; includes employee. |
| `records_owed` | integer | Open required employee records at the requested moment. |
| `records_completed` | integer | Completed employee records at the requested moment. |
| `no_required_records` | boolean | True when no required records are open. |

## Example response

```json
{
  "data": [
    {
      "deployment_id": "00000000-0000-4000-8000-000000000001",
      "organization_id": "4f6b2a52-1c1e-4f7a-9d3e-2b7c8a9e0d11",
      "learning_space_id": "8b2d6c3e-5f41-4a8e-9c27-1d0e3f4a5b62",
      "person_id": "c3a1e7f2-8d64-4b1f-a9e2-6f5d4c3b2a10",
      "learner_profile_id": "c3a1e7f2-8d64-4b1f-a9e2-6f5d4c3b2a10",
      "invitation_id": null,
      "entry_type": "employee",
      "sequence": 1190,
      "valid_from": "2026-08-28T10:02:00Z",
      "recorded_at": "2026-08-28T10:02:03Z",
      "cause": "change",
      "logic_version": 4,
      "person_name": "Amira Okafor",
      "work_email": "amira.okafor@example.com",
      "invited_at": "2026-08-27T09:15:00Z",
      "joined_at": "2026-08-28T10:02:00Z",
      "left_at": null,
      "invitation_expires_at": null,
      "invitation_state": null,
      "invitation_status": null,
      "access_state": "active",
      "team_ids": [
        "b6d4f2a8-9e1c-4a35-8f72-0e9d8c7b6a54"
      ],
      "doors": [
        "employee"
      ],
      "records_owed": 4,
      "records_completed": 3,
      "no_required_records": false
    }
  ],
  "total": 1,
  "snapshot": {
    "organization_id": "4f6b2a52-1c1e-4f7a-9d3e-2b7c8a9e0d11",
    "deployment_id": "00000000-0000-4000-8000-000000000001",
    "as_at": "2026-10-09T09:00:00Z",
    "from": null,
    "known_at": "2026-10-09T08:59:41Z",
    "sequence": 1284,
    "capture_sequence": 352,
    "chain_hash": "3f9a1c7e5b2d8f4a6c0e9b1d3f5a7c9e2b4d6f8a0c1e3b5d7f9a2c4e6b8d0f1a",
    "logic": {
      "version": 4,
      "date": "2026-10-06"
    },
    "history_complete_from": "2026-10-06T05:00:00Z",
    "available": true
  },
  "next_cursor": null
}
```

The full contract, with every schema, is at https://api.kapiworks.com/v1/openapi.json.