# Workers · Reference

> Workers and watches.

Page: https://safeonuba.com/en/developers/reference/workers · SafeOnuba API v1 (`api_version: "2026-09-24"`), in preview: the contract may change.

## List workers

`GET /v1/workers` · scope `workers:read` · [see it on the web](https://safeonuba.com/en/developers/reference/workers#listWorkers)

### Query parameters

- `site_id` (string (uuid))
- `limit` (integer): Items per page (maximum 500). (from 1 to 500, default 100)
- `cursor` (string): The `next_cursor` from the previous page.

### Responses

- `200`: Workers. → `WorkerPage` (`application/json`)
- `401`: The token is missing, has expired or has been revoked. → `Problem` (`application/problem+json`)
- `403`: The token lacks the scope the route requires, or the site doesn’t belong to the client. → `Problem` (`application/problem+json`)
- `429`: Too many requests, or too much query time: each client has a number of requests per minute (600 by default) and a query time per minute (30 s by default), and each request spends however long it takes, so a long list counts for more than a single alert. `Retry-After` says when to retry. → `Problem` (`application/problem+json`)

### Example request (sandbox)

```bash
curl "https://sandbox.api.safeonuba.com/v1/workers" \
  -H "Authorization: Bearer $SAFEONUBA_TOKEN"
```

### Example response (`200`)

```json
{
  "data": [
    {
      "id": "0f6c2b7e-3a1d-4c55-9b0e-7d2f4a8c1e90",
      "external_id": "EMP-004512",
      "name": "Ana Ejemplo",
      "contractor": "Contrata Ejemplo A",
      "role": "Andamiero",
      "is_active": false,
      "device": {
        "id": "0f6c2b7e-3a1d-4c55-9b0e-7d2f4a8c1e90",
        "serial": "OS-W-0005",
        "battery": 64,
        "date_last_seen": "2026-09-24T11:04:12Z"
      },
      "date_last_seen": "2026-09-24T11:04:12Z"
    }
  ],
  "next_cursor": "eyJ0IjoiMjAyNi0wOS0yNFQxMTowNDoxMloifQ"
}
```

## Worker detail

`GET /v1/workers/{id}` · scope `workers:read` · [see it on the web](https://safeonuba.com/en/developers/reference/workers#getWorker)

### Path parameters

- `id` (string (uuid), required): Worker id.

### Responses

- `200`: The worker. → `Worker` (`application/json`)
- `401`: The token is missing, has expired or has been revoked. → `Problem` (`application/problem+json`)
- `403`: The token lacks the scope the route requires, or the site doesn’t belong to the client. → `Problem` (`application/problem+json`)
- `404`: It doesn’t exist or this identity can’t see it. → `Problem` (`application/problem+json`)
- `429`: Too many requests, or too much query time: each client has a number of requests per minute (600 by default) and a query time per minute (30 s by default), and each request spends however long it takes, so a long list counts for more than a single alert. `Retry-After` says when to retry. → `Problem` (`application/problem+json`)

### Example request (sandbox)

```bash
curl "https://sandbox.api.safeonuba.com/v1/workers/0f6c2b7e-3a1d-4c55-9b0e-7d2f4a8c1e90" \
  -H "Authorization: Bearer $SAFEONUBA_TOKEN"
```

### Example response (`200`)

```json
{
  "id": "0f6c2b7e-3a1d-4c55-9b0e-7d2f4a8c1e90",
  "external_id": "EMP-004512",
  "name": "Ana Ejemplo",
  "contractor": "Contrata Ejemplo A",
  "role": "Andamiero",
  "is_active": false,
  "device": {
    "id": "0f6c2b7e-3a1d-4c55-9b0e-7d2f4a8c1e90",
    "serial": "OS-W-0005",
    "battery": 64,
    "date_last_seen": "2026-09-24T11:04:12Z"
  },
  "date_last_seen": "2026-09-24T11:04:12Z"
}
```

## List watches

`GET /v1/devices` · scope `workers:read` · [see it on the web](https://safeonuba.com/en/developers/reference/workers#listDevices)

### Query parameters

- `site_id` (string (uuid))
- `limit` (integer): Items per page (maximum 500). (from 1 to 500, default 100)
- `cursor` (string): The `next_cursor` from the previous page.

### Responses

- `200`: Watches: battery, whether it is being worn, last connection. → `DevicePage` (`application/json`)
- `401`: The token is missing, has expired or has been revoked. → `Problem` (`application/problem+json`)
- `403`: The token lacks the scope the route requires, or the site doesn’t belong to the client. → `Problem` (`application/problem+json`)
- `429`: Too many requests, or too much query time: each client has a number of requests per minute (600 by default) and a query time per minute (30 s by default), and each request spends however long it takes, so a long list counts for more than a single alert. `Retry-After` says when to retry. → `Problem` (`application/problem+json`)

### Example request (sandbox)

```bash
curl "https://sandbox.api.safeonuba.com/v1/devices" \
  -H "Authorization: Bearer $SAFEONUBA_TOKEN"
```

### Example response (`200`)

```json
{
  "data": [
    {
      "id": "0f6c2b7e-3a1d-4c55-9b0e-7d2f4a8c1e90",
      "serial": "OS-W-0005",
      "battery": 64,
      "date_last_seen": "2026-09-24T11:04:12Z",
      "model": "Galaxy Watch6",
      "status": "active",
      "worn": true,
      "worker": {
        "id": "0f6c2b7e-3a1d-4c55-9b0e-7d2f4a8c1e90",
        "external_id": "EMP-004512",
        "name": "Ana Ejemplo",
        "contractor": "Contrata Ejemplo A"
      }
    }
  ],
  "next_cursor": "eyJ0IjoiMjAyNi0wOS0yNFQxMTowNDoxMloifQ"
}
```
