> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Location

> Update location information

<Note>
  This endpoint updates location details including contact information, operating hours, and capabilities.
</Note>

## Authentication

This endpoint requires a valid API key with `locations:write` permissions.

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the location
</ParamField>

## Request Body

<ParamField body="name" type="string">
  Update location name
</ParamField>

<ParamField body="contact" type="object">
  Update contact information
</ParamField>

<ParamField body="operating_hours" type="object">
  Update operating hours
</ParamField>

<ParamField body="capabilities" type="array">
  Update location capabilities
</ParamField>

<ParamField body="capacity" type="object">
  Update capacity information
</ParamField>

<ParamField body="is_active" type="boolean">
  Update active status
</ParamField>

<ParamField body="metadata" type="object">
  Update custom fields
</ParamField>

### Response

Returns the updated location object.

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request PUT 'https://api.stateset.com/v1/locations/loc_0901f083-aa1c-43c5-af5c-0a9d2fc64e30' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --data-raw '{
      "contact": {
          "name": "Jane Doe",
          "email": "jane.doe@warehouse.com",
          "phone": "+1-555-987-6543"
      },
      "capabilities": ["storage", "fulfillment", "returns", "pickup"]
  }'
  ```

  ```javascript Node.js theme={null}
  const location = await stateset.locations.update(
    'loc_0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
    {
      contact: {
        name: "Jane Doe",
        email: "jane.doe@warehouse.com",
        phone: "+1-555-987-6543"
      },
      capabilities: ["storage", "fulfillment", "returns", "pickup"]
    }
  );
  ```

  ```python Python theme={null}
  location = stateset.locations.update(
    'loc_0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
    contact={
      "name": "Jane Doe",
      "email": "jane.doe@warehouse.com",
      "phone": "+1-555-987-6543"
    },
    capabilities=["storage", "fulfillment", "returns", "pickup"]
  )
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "loc_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
    "object": "location",
    "updated_at": "2024-01-20T13:00:00Z",
    "name": "West Coast Distribution Center",
    "code": "WH-WEST-01",
    "contact": {
      "name": "Jane Doe",
      "email": "jane.doe@warehouse.com",
      "phone": "+1-555-987-6543"
    },
    "capabilities": ["storage", "fulfillment", "returns", "pickup"],
    "status": "active"
  }
  ```
</ResponseExample>
