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

# Update Collection

> Update an existing collection

# Update Collection

Updates an existing collection. Only provided fields are updated. Requires the `write_products` scope.

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT "https://api.launchmystore.io/api/v1/collections/col_abc123.json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "title": "Summer Collection 2024",
      "description": "<p>Updated summer styles for 2024.</p>",
      "handle": "summer-collection-2024"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.launchmystore.io/api/v1/collections/col_abc123.json', {
    method: 'PUT',
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      title: 'Summer Collection 2024',
      description: '<p>Updated summer styles for 2024.</p>',
      handle: 'summer-collection-2024'
    })
  });
  ```
</CodeGroup>

## Path Parameters

<ParamField path="id" type="string" required>
  The unique collection ID to update
</ParamField>

## Body Parameters

All parameters are optional. Only the four fields below are applied; any other field in the request body is accepted but ignored.

<ParamField body="title" type="string">
  The collection title
</ParamField>

<ParamField body="description" type="string">
  Collection description (supports HTML). This is the field that updates the
  collection body — it is returned as `body_html` (and `description`) on read.
</ParamField>

<ParamField body="handle" type="string">
  URL-safe handle
</ParamField>

<ParamField body="image" type="string">
  URL of the collection featured image. Pass `null` to remove.
</ParamField>

## Response

The response is a bare object keyed by `collection` containing the updated,
Shopify-shaped collection object (the same shape returned by the read
endpoints). There is no `{ status, data }` envelope.

<ResponseField name="collection" type="object">
  The updated collection object
</ResponseField>

## Example Response

```json theme={null}
{
  "collection": {
    "id": "col_abc123",
    "handle": "summer-collection-2024",
    "title": "Summer Collection 2024",
    "body_html": "<p>Updated summer styles for 2024.</p>",
    "description": "<p>Updated summer styles for 2024.</p>",
    "published_at": "2024-03-01T10:00:00Z",
    "updated_at": "2024-03-20T09:15:00Z",
    "sort_order": "manual",
    "template_suffix": null,
    "products_count": 12,
    "collection_type": "custom",
    "published_scope": "web",
    "image": {
      "src": "https://cdn.launchmystore.io/images/summer-banner.jpg",
      "alt": "Summer Collection 2024",
      "width": 1200,
      "height": 1200,
      "created_at": "2024-03-01T10:00:00Z"
    },
    "url": "/collections/summer-collection-2024"
  }
}
```

## Errors

Errors are returned as a Shopify-style `{ "errors": { "base": ["..."] } }` body
with the corresponding HTTP status code.

| Status | Description                                     |
| ------ | ----------------------------------------------- |
| `401`  | Invalid or missing access token                 |
| `403`  | App doesn't have the `write_products` scope     |
| `404`  | Collection with the specified ID does not exist |
