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

# List locations

`GET https://marketplace-api.sequifi.com/v1/locations`

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

Returns your company's offices, newest first, so you can map office names to the `office_id` that users, onboarding records and transfers use. Inactive offices are included unless you pass `status=active`. Archived offices and records without an office name are never returned.

**Filtering and paging:**

- `status=active` returns offices whose `office_status` is `1`; `status=inactive` returns the rest. Leave it out for both. Any other value returns `400`, and so does any other query parameter.
- `per_page` defaults to 50 and has no upper limit. A value that is not a positive number is quietly replaced by 50.
- `page` starts at 1. `0` or a non-number is read as 1. A negative `page` returns `500`, so always send a positive whole number.
- Results are ordered by `id`, newest first, with offset paging. A page past the end returns an empty `locations` array, and `last_page` is `0` when nothing matches.
- The metadata key is `requested_by` (snake_case) on this route but `requestedBy` on `GET /v1/locations/{id}`.

**Formats:**

- `office_status` is `1` for an active office. Any other value is inactive.
- `created_at` and `updated_at` are ISO 8601 UTC strings, for example `2024-03-01T17:20:00.000Z`.
- `lat` and `long` are numbers or `null`.
- Each location also carries internal configuration fields that are not listed here (payroll setup, rate settings and similar). Do not depend on them: they can change or disappear without notice.

**Errors:**

- `400` `Invalid query parameter(s)`, with `invalid_params` and `allowed_params` in `data`.
- `400` `Bad Request: status must be 'active' or 'inactive'`.
- `401` when the token is missing, malformed, expired or revoked. It is rejected before the request is processed, so the body is only `{"message":"Unauthorized"}`, with no `status` or `data`.

**Related:**

- `GET /v1/locations/{id}` returns one office.
- `POST /v1/users/{id}/transfer` and `POST /v1/onboarding` take an `office_id` from this list. `GET /v1/users` reports each user's `office_id`.

## Query parameters

- `per_page` (integer): Offices per page. No upper limit. Values that are not a positive number become 50. Default: `50`. Minimum: 1. Example: `50`.
- `page` (integer): Page number, starting at 1. Send a positive whole number; a negative value returns 500. Default: `1`. Minimum: 1. Example: `1`.
- `status` (string): `active` (`office_status` is 1) or `inactive` (any other value). Not case-sensitive. Leave it out for both. One of: `active`, `inactive`. Example: `active`.

## Example request

```bash
curl -X GET "https://marketplace-api.sequifi.com/v1/locations" \
  -H "Authorization: Bearer $SEQUIFI_TOKEN"
```

## Responses

### 200: A page of offices

- `status` (integer): The HTTP status code, repeated. Example: `200`.
- `message` (string): Short text. Wording varies by endpoint; branch on the HTTP status, not on this text. Example: `success`.
- `data` (object)
  - `requested_by` (string): Name of the API credential your token belongs to.
  - `current_page` (integer): The page returned.
  - `per_page` (integer): Page size used.
  - `total` (integer): Offices matching the filter, across all pages.
  - `last_page` (integer): Number of the last page. 0 when nothing matches.
  - `filters` (object, nullable): `{"status": "active"}` or `{"status": "inactive"}` when a status filter was applied, otherwise null.
  - `locations` (array of object): Offices on this page, newest first.
    - `id` (integer): Office id. Use it as `office_id` elsewhere.
    - `office_name` (string): Office name.
    - `office_status` (integer): 1 for active; any other value is inactive.
    - `general_code` (string, nullable): Your company's code for the office, if set.
    - `work_site_id` (string, nullable): Work site identifier, if set.
    - `state_id` (integer): State the office is in.
    - `city_id` (integer, nullable): City the office is in.
    - `business_address` (string, nullable): Street address.
    - `business_city` (string, nullable): City.
    - `business_state` (string, nullable): State.
    - `business_zip` (string, nullable): ZIP code.
    - `mailing_address` (string, nullable): Mailing street address.
    - `mailing_city` (string, nullable): Mailing city.
    - `mailing_state` (string, nullable): Mailing state.
    - `mailing_zip` (string, nullable): Mailing ZIP code.
    - `lat` (number, nullable): Latitude.
    - `long` (number, nullable): Longitude.
    - `time_zone` (string, nullable): Office time zone, as entered in Sequifi.
    - `created_at` (string (date-time), nullable): When the office was created, ISO 8601 UTC.
    - `updated_at` (string (date-time), nullable): When the office was last changed, ISO 8601 UTC.

Example (all_offices): Every non-archived office (no status filter)

```json
{
  "status": 200,
  "message": "success",
  "data": {
    "requested_by": "acme",
    "current_page": 1,
    "per_page": 50,
    "total": 2,
    "last_page": 1,
    "filters": null,
    "locations": [
      {
        "id": 31,
        "office_name": "Austin",
        "office_status": 1,
        "general_code": "ATX",
        "work_site_id": null,
        "state_id": 44,
        "city_id": 1207,
        "business_address": "500 E 4th St",
        "business_city": "Austin",
        "business_state": "TX",
        "business_zip": "78701",
        "mailing_address": null,
        "mailing_city": null,
        "mailing_state": null,
        "mailing_zip": null,
        "lat": 30.2655,
        "long": -97.7382,
        "time_zone": null,
        "created_at": "2024-03-01T17:20:00.000Z",
        "updated_at": "2026-02-11T09:05:00.000Z"
      },
      {
        "id": 19,
        "office_name": "Dallas",
        "office_status": 0,
        "general_code": null,
        "work_site_id": null,
        "state_id": 44,
        "city_id": 1188,
        "business_address": null,
        "business_city": null,
        "business_state": null,
        "business_zip": null,
        "mailing_address": null,
        "mailing_city": null,
        "mailing_state": null,
        "mailing_zip": null,
        "lat": null,
        "long": null,
        "time_zone": null,
        "created_at": "2023-08-14T15:00:00.000Z",
        "updated_at": "2025-11-30T12:00:00.000Z"
      }
    ]
  }
}
```

Example (no_offices): Nothing matches

```json
{
  "status": 200,
  "message": "success",
  "data": {
    "requested_by": "acme",
    "current_page": 1,
    "per_page": 50,
    "total": 0,
    "last_page": 0,
    "filters": {
      "status": "inactive"
    },
    "locations": []
  }
}
```

### 400: Unknown query parameter or invalid `status`

Example (unknown_param): Unknown query parameter

```json
{
  "status": 400,
  "message": "Invalid query parameter(s)",
  "data": {
    "invalid_params": [
      "office"
    ],
    "allowed_params": [
      "page",
      "per_page",
      "status"
    ]
  }
}
```

### 401: Missing, malformed, expired or revoked token. Rejected before processing, so the body has only `message`.

```json
{
  "message": "Unauthorized"
}
```

### 500: Internal server error, including a negative `page`

```json
{
  "status": 500,
  "message": "Internal Server Error",
  "data": {}
}
```
