<!-- Generated by scripts/build-docs.js. Edit docs/swagger.yaml or docs/guides/, then run `npm run docs:build`. -->

# List work locations

`GET https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/locations`

Module: Locations · operationId: `listLocations` · Auth: `Authorization: Bearer <token>`
Web page: https://apidocs.sequipay.com/#/api/list-locations

Returns the authenticated company's work locations, paginated, ordered by name. Soft-deleted locations are never returned.

Requires the `locations:read` scope.

## Query parameters

- `name` (string): Partial, case-insensitive match on the location name. Example: `warehouse`.
- `state` (string): Exact match on the 2-letter US state code (case-insensitive). Any other value is ignored. Max length: 2. Example: `TX`.
- `page` (integer): 1-based page number. Default: `1`. Minimum: 1.
- `per_page` (integer): Page size (max 200). Default: `20`. Minimum: 1. Maximum: 200.

## Example request

```bash
curl -X GET "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/locations" \
  -H "Authorization: Bearer $SEQUIFI_TOKEN"
```

## Responses

### 200: A page of work locations.

- `status` (integer) Example: `200`.
- `message` (string) Example: `success`.
- `data` (object)
  - `locations` (array of object)
    - `id` (integer (int64)) Example: `3`.
    - `name` (string) Example: `Austin Warehouse`.
    - `address_line_1` (string, nullable) Example: `1 Main St`.
    - `address_line_2` (string, nullable) Example: `Suite 200`.
    - `address_city` (string, nullable) Example: `Austin`.
    - `address_state` (string, nullable) Example: `TX`.
    - `address_zip` (string, nullable) Example: `78701`.
    - `created_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`.
    - `updated_at` (string (date-time), nullable) Example: `2024-06-01T09:30:00.000Z`.
  - `current_page` (integer) Example: `1`.
  - `per_page` (integer) Example: `20`.
  - `total` (integer) Example: `4`.
  - `last_page` (integer) Example: `1`.
  - `filters` (object): Echoes the filters actually applied.

### 401: Missing, invalid, expired, or revoked token (from the authorizer).

### 403: The token lacks the required scope.

```json
{
  "error": "insufficient_scope",
  "required": "users:read"
}
```

### 500: An infrastructure or data error. The endpoint fails closed — a 500, never a partial or empty-looking result.

```json
{
  "status": 500,
  "message": "internal error",
  "data": null
}
```
