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

# Get a location

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

Module: Locations · operationId: `getLocation` · Auth: `Authorization: Bearer <token>`
Web page: https://apidocs.sequifi.com/#/api/get-location

Returns one office by id, active or inactive, as a single object at `data.location`. Archived offices return `404`, so an `office_id` stored on an older user or record can return `404` here.

**Before you call:**

- Take the id from `GET /v1/locations` or from an `office_id` on a user or onboarding record.
- Do not add query parameters. Any query parameter returns `400`.

**Formats:**

- Same fields as each item of `GET /v1/locations`, without a list wrapper.
- By id, this route can also return internal rate records that have no office name (the list hides them). Treat a location whose `office_name` is empty or `null` as not an office.
- The metadata key is `requestedBy` (camelCase) here but `requested_by` on the list.
- Internal configuration fields that are not listed here can appear in the object. Do not depend on them.

**Errors:**

- `400` `Invalid location id` when `id` does not start with a positive number. Trailing characters are ignored, so `31abc` reads as `31`.
- `400` `Cannot use query parameters when fetching a single location by id`.
- `404` `Location not found` for an unknown or archived office.
- `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` lists offices.

## Path parameters

- `id` (integer, **required**): Office id. Minimum: 1. Example: `31`.

## Example request

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

## Responses

### 200: The office

- `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)
  - `requestedBy` (string): Name of the API credential your token belongs to.
  - `location` (object): The office. Same fields as each item of `GET /v1/locations`.
    - `id` (integer): Office id.
    - `office_name` (string, nullable): Office name. Empty or null for internal rate records.
    - `office_status` (integer): 1 for active; any other value is inactive.
    - `general_code` (string, nullable): Your company's code for the office, 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`, `business_state`, `business_zip` and the `mailing_*` fields are returned too.
    - `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): ISO 8601 UTC.
    - `updated_at` (string (date-time), nullable): ISO 8601 UTC.

```json
{
  "status": 200,
  "message": "success",
  "data": {
    "requestedBy": "acme",
    "location": {
      "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"
    }
  }
}
```

### 400: Invalid id, or query parameters sent with an id

Example (invalid_id): id is not a positive number

```json
{
  "status": 400,
  "message": "Invalid location id",
  "data": {}
}
```

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

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

### 404: Unknown or archived office

```json
{
  "status": 404,
  "message": "Location not found",
  "data": {}
}
```

### 500: Internal server error

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