---
title: "Edits a customer location; only the fields sent change."
method: PATCH
path: "/api/v1/customers/{id}/locations/{locationId}"
tags: ["Customers"]
---

# Edits a customer location; only the fields sent change.

`PATCH /api/v1/customers/{id}/locations/{locationId}`

## Request

- Base URL: `https://app.flexonthejob.com`
- URL: `https://app.flexonthejob.com/api/v1/customers/{id}/locations/{locationId}`
- Auth: HTTP bearer

Requires `ManageCustomers` and an `Idempotency-Key` header. `""` clears an optional
field; `name`, `address`, `city`, `state` and `postalCode` cannot be cleared.
`isMailingAddress: true` unmarks the customer's other locations; `isActive` retires or
restores the location. Optional optimistic concurrency: send the `ETag` from
`GET …/locations/{locationId}` as `If-Match` to get `412` instead of overwriting a
change made in the meantime. Example: `PATCH /api/v1/customers/5/locations/9 { "notes": "Gate code 4411" }`.

## Path parameters

- `id` integer, required
- `locationId` integer, required

## Request body

- CustomerLocationWriteRequest: Body of `POST /api/v1/customers/{id}/locations` and `PATCH /api/v1/customers/{id}/locations/{locationId}`. On create, `name`, `address`, `city`, `state` and `postalCode` are required (as on the Customers → Addresses form). On PATCH only the fields sent change, `""` clears an optional field, and the required ones cannot be cleared. Example: `{ "name": "Rental Property 1", "address": "12 Oak St", "city": "Springfield", "state": "IL", "postalCode": "62701" }`.
  - `name` string, nullable: Label for the location, 1–100 characters. Example: `"Main Office"`.
  - `address` string, nullable: Street address line 1, up to 200 characters. Example: `"12 Oak St"`.
  - `address2` string, nullable: Street address line 2 (suite, unit), up to 200 characters.
  - `city` string, nullable: City, up to 100 characters. Example: `"Springfield"`.
  - `state` string, nullable: State / province, up to 50 characters. Example: `"IL"`.
  - `postalCode` string, nullable: ZIP / postal code, up to 20 characters. Example: `"62701"`.
  - `country` string, nullable: Country, up to 100 characters. Example: `"USA"`.
  - `isMailingAddress` boolean, nullable: True makes this the customer's mailing address and unmarks every other location of the customer. Default `false` on create — except that a customer's first location is always the mailing address.
  - `isActive` boolean, nullable: False retires the location (kept for history, no longer offered for new jobs). Default `true` on create.
  - `notes` string, nullable: Free-text notes about the site (gate codes, parking), up to 500 characters.

## Response `200`

The location after the edit.

- CustomerLocationDto: An additional address / job site belonging to a customer, as returned by `GET /api/v1/customers/{id}/locations`. Jobs can reference one of these as the site to work at; the customer's primary address is on the customer itself.
  - `id` integer: Numeric id of the location. Stable within this organization.
  - `syncId` string, uuid: Globally unique sync id (GUID). Use it as the `after` pagination cursor.
  - `customerId` integer: Id of the owning customer (matches the `{id}` in the URL).
  - `name` string: Label given to the location, e.g. `"Main Office"` or `"Rental Property 1"`.
  - `address` string, nullable: Street address line 1.
  - `address2` string, nullable: Street address line 2 (suite, unit).
  - `city` string, nullable: City.
  - `state` string, nullable: State / province.
  - `postalCode` string, nullable: ZIP / postal code.
  - `country` string, nullable: Country.
  - `isMailingAddress` boolean: True when this is the customer's mailing address.
  - `isActive` boolean: False when the location has been retired and should not be offered for new jobs.
  - `notes` string, nullable: Free-text notes about the site (gate codes, parking), max 500 characters.
  - `createdAt` string, date-time: UTC creation timestamp.
  - `updatedAt` string, date-time, nullable: UTC timestamp of the last edit; null when never edited.

## Other responses

- `400`: Malformed body, a field over its length limit, or missing `Idempotency-Key`.
- `401`: Unauthorized
- `403`: Forbidden
- `404`: No such customer in this organization, or the location belongs to another customer.
- `409`: Concurrent edit detected, or the key's creator is unknown on this server.
- `412`: `If-Match` does not match the location's current `ETag`.
- `422`: A required field was cleared; the fields are listed in `errors`.
- `429`: Too Many Requests

---

[API](https://skmtc.dev/flexonthejob/apis/flex-api.md) · [All operations](https://skmtc.dev/flexonthejob/apis/flex-api/llms.txt) · [OpenAPI document](https://skmtc.dev/flexonthejob/apis/flex-api/revisions/19c8f4d27acf?raw)
