# Update a company address

**PATCH** `/addresses/{address_id}`

Contact, label, type, comment, default, and user_id changes keep the address id. A change of location (street, zip, city, area, or country) archives the address, so delivered orders and devices keep their history, and returns a new address with a new id; the old id then answers ADDRESS_NOT_FOUND.

---

## Parameters

### `address_id` (_path_, required)

Address id

- **Type:** `string`
- **Example:** `"42"`
- **Constraints:** pattern `^[1-9]\d*$`

## Request body

**application/json**

_Schema ref:_ `#/components/schemas/PatchAddressBody` (PatchAddressBody)

```json
{
  "type": "object",
  "properties": {
    "first_name": {
      "type": "string",
      "minLength": 1
    },
    "last_name": {
      "type": "string",
      "minLength": 1
    },
    "phone": {
      "type": "string",
      "minLength": 1
    },
    "phone_country": {
      "type": "string",
      "description": "ISO 3166-1 alpha-2 country code",
      "example": "FR"
    },
    "address1": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "address2": {
      "type": "string",
      "minLength": 1,
      "maxLength": 70
    },
    "zip": {
      "type": "string",
      "minLength": 1
    },
    "city": {
      "type": "string",
      "minLength": 1
    },
    "administrative_area": {
      "type": "string",
      "minLength": 1,
      "description": "State, province or prefecture, as its local code (MI) or ISO 3166-2 code (IT-MI). Required for US, CA, IT, AU, MX and JP; optional for ES; rejected elsewhere.",
      "example": "IT-MI"
    },
    "state": {
      "type": "string",
      "description": "Deprecated: send administrative_area instead. Read only when administrative_area is absent and it names an area of the country.",
      "deprecated": true
    },
    "country": {
      "type": "string",
      "description": "ISO 3166-1 alpha-2 country code",
      "example": "FR"
    },
    "type": {
      "type": "string",
      "enum": [
        "HOME",
        "OFFICE",
        "PO_BOX",
        "EXTERNAL_STORAGE"
      ]
    },
    "label": {
      "type": "string",
      "minLength": 1
    },
    "comment": {
      "type": "string",
      "minLength": 1
    },
    "is_default": {
      "type": "boolean"
    },
    "user_id": {
      "type": "integer",
      "minimum": 0,
      "exclusiveMinimum": true,
      "description": "Employee who lives at this HOME address. An employee has one personal address: assigning this one replaces their previous link, and the address takes the employee's name, email, and phone (a phone sent here also updates the employee).",
      "example": 42
    }
  }
}
```

## Responses

### 200

Updated address

**application/json**

_Schema ref:_ `#/components/schemas/GetAddressResponse` (GetAddressResponse)

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "first_name": {
          "type": "string",
          "nullable": true
        },
        "last_name": {
          "type": "string",
          "nullable": true
        },
        "phone": {
          "type": "string",
          "nullable": true
        },
        "phone_country": {
          "type": "string",
          "nullable": true
        },
        "email": {
          "type": "string",
          "nullable": true
        },
        "address1": {
          "type": "string",
          "nullable": true
        },
        "address2": {
          "type": "string",
          "nullable": true
        },
        "type": {
          "type": "string",
          "nullable": true,
          "description": "Address kind: OFFICE, HOME, PO_BOX or EXTERNAL_STORAGE"
        },
        "zip": {
          "type": "string",
          "nullable": true
        },
        "city": {
          "type": "string",
          "nullable": true
        },
        "state": {
          "type": "string",
          "nullable": true,
          "description": "Legacy free-text state, no longer written: read administrative_area instead.",
          "deprecated": true
        },
        "administrative_area": {
          "type": "string",
          "nullable": true,
          "description": "Local subdivision code",
          "example": "MI"
        },
        "administrative_area_iso": {
          "type": "string",
          "nullable": true,
          "description": "ISO 3166-2 subdivision code",
          "example": "IT-MI"
        },
        "country": {
          "type": "string",
          "nullable": true,
          "description": "ISO 3166-1 alpha-2 country code",
          "example": "FR"
        },
        "label": {
          "type": "string",
          "nullable": true
        },
        "comment": {
          "type": "string",
          "nullable": true
        },
        "is_default": {
          "type": "boolean"
        },
        "is_hq": {
          "type": "boolean"
        },
        "user_id": {
          "type": "integer",
          "nullable": true,
          "description": "Employee who lives at this HOME address; null for other addresses"
        },
        "created_at": {
          "type": "string",
          "nullable": true
        },
        "updated_at": {
          "type": "string",
          "nullable": true
        }
      },
      "required": [
        "id",
        "first_name",
        "last_name",
        "phone",
        "phone_country",
        "email",
        "address1",
        "address2",
        "type",
        "zip",
        "city",
        "state",
        "administrative_area",
        "administrative_area_iso",
        "country",
        "label",
        "comment",
        "is_default",
        "is_hq",
        "user_id",
        "created_at",
        "updated_at"
      ]
    }
  },
  "required": [
    "data"
  ]
}
```

### 400

Validation error, INVALID_ADDRESS when the administrative area is missing or does not belong to the country, or ADDRESS_NOT_HOME when user_id is sent for an address that is not HOME

**application/json**

_Schema ref:_ `#/components/schemas/AddressBadRequestResponse` (AddressBadRequestResponse)

```json
{
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Every validation failure, comma-separated",
          "example": "Required, must be an ISO 3166-1 alpha-2 country code"
        },
        "type": {
          "type": "string",
          "enum": [
            "validation_error"
          ]
        },
        "error": {
          "type": "string",
          "enum": [
            "validation_error"
          ]
        }
      },
      "required": [
        "message",
        "type",
        "error"
      ]
    },
    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string",
          "enum": [
            "INVALID_ADDRESS",
            "ADDRESS_NOT_HOME"
          ]
        }
      },
      "required": [
        "error"
      ]
    }
  ]
}
```

### 401

Missing, invalid, or revoked API key

**text/plain**

```json
{
  "type": "string",
  "example": "Unauthorized"
}
```

### 403

The API key has READ scope; this operation needs WRITE

**application/json**

_Schema ref:_ `#/components/schemas/InsufficientScopeErrorResponse` (InsufficientScopeErrorResponse)

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "INSUFFICIENT_SCOPE"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 404

Resource not found; USER_NOT_FOUND when user_id is not an active user of the company

**application/json**

_Schema ref:_ `#/components/schemas/PatchAddressNotFoundErrorResponse` (PatchAddressNotFoundErrorResponse)

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "COMPANY_NOT_FOUND",
        "ADDRESS_NOT_FOUND",
        "DELIVERY_COUNTRY_NOT_FOUND",
        "USER_NOT_FOUND"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 409

ADDRESS_HAS_ASSIGNED_USER when changing the type of a HOME address an employee lives at

**application/json**

_Schema ref:_ `#/components/schemas/PatchAddressConflictErrorResponse` (PatchAddressConflictErrorResponse)

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "ADDRESS_HAS_ASSIGNED_USER"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 429

Rate limit exceeded. The RateLimit-* headers give the limit and the reset time.

**text/plain**

```json
{
  "type": "string",
  "example": "Too many requests, please try again later."
}
```

### 500

Unexpected server error

**application/json**

_Schema ref:_ `#/components/schemas/InternalErrorResponse` (InternalErrorResponse)

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "INTERNAL_ERROR"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 503

Rate limiting is temporarily unavailable; retry with backoff

**application/json**

_Schema ref:_ `#/components/schemas/RateLimiterUnavailableResponse` (RateLimiterUnavailableResponse)

```json
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  },
  "required": [
    "message"
  ]
}
```

## Security

```json
[
  {
    "bearerAuth": []
  }
]
```

**bearerAuth:** Bearer token using a Fleet platform API key (flt_sk_…).

---

_Generated from the OpenAPI specification for raw Markdown / tooling use._
