> ## 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 Article

> Update an existing article

# Update Article

Updates an existing article. Only provided fields will be updated.

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT "https://api.launchmystore.io/api/v1/articles/art_xyz789.json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "title": "Summer Collection Launch - Extended!",
      "content": "<p>Due to popular demand, our summer sale has been extended...</p>",
      "tags": ["summer", "announcements", "sale-extended"]
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.launchmystore.io/api/v1/articles/art_xyz789.json', {
    method: 'PUT',
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      title: 'Summer Collection Launch - Extended!',
      content: '<p>Due to popular demand, our summer sale has been extended...</p>',
      tags: ['summer', 'announcements', 'sale-extended']
    })
  });
  ```
</CodeGroup>

## Path Parameters

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

## Body Parameters

All parameters are optional. Only provided fields will be updated. Fields
may be sent at the top level, or nested under an `article` object.

<ParamField body="name" type="string">
  Internal article name
</ParamField>

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

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

<ParamField body="content" type="string">
  Article body content (HTML)
</ParamField>

<ParamField body="tags" type="array">
  Array of tag strings (replaces existing tags)
</ParamField>

<ParamField body="image" type="string">
  Featured image URL
</ParamField>

<ParamField body="template_suffix" type="string">
  Custom template suffix
</ParamField>

<ParamField body="seo_title" type="string">
  Custom page title for search engines
</ParamField>

<ParamField body="seo_desc" type="string">
  Meta description for search engines
</ParamField>

<ParamField body="seo_image" type="string">
  Social/share image URL for search engines
</ParamField>

## Response

The response uses the standard `{ status, state, message, data }` envelope.
On success `state` is `"success"` and the updated article is returned under
`data.article`.

<ResponseField name="status" type="integer">
  HTTP status code (`200` on success)
</ResponseField>

<ResponseField name="state" type="string">
  `"success"` or `"error"`
</ResponseField>

<ResponseField name="data.article" type="object">
  The updated article object
</ResponseField>

## Example Response

```json theme={null}
{
  "status": 200,
  "state": "success",
  "message": null,
  "data": {
    "article": {
      "blogId": "a1b2c3d4-5e6f-7890-abcd-ef1234567890",
      "id": "418273",
      "name": "Summer Product Launch",
      "title": "Summer Collection Launch - Extended!",
      "handle": "summer-collection-launch-extended",
      "content": "<p>Due to popular demand, our summer sale has been extended...</p>",
      "image": "https://example.com/summer-launch.jpg",
      "tags": ["summer", "announcements", "sale-extended"],
      "templateSuffix": null,
      "seoTitle": null,
      "seoDesc": null,
      "seoImage": null,
      "blogsPageId": "blog_abc123",
      "storeId": "f73049dc-b4d4-4f85-99c2-681a5e351a8a",
      "createdAt": "2024-03-14T09:00:00.000Z",
      "updatedAt": "2024-03-25T14:30:00.000Z"
    }
  },
  "count": null,
  "pagination": null
}
```

## Notes

* Changing the handle will break existing links to the article.

## Error Codes

Errors return the same envelope with `state: "error"` and a `message`.

| Status | `message`           | When                                       |
| ------ | ------------------- | ------------------------------------------ |
| `401`  | —                   | Invalid or missing access token            |
| `403`  | —                   | App doesn't have the `write_content` scope |
| `404`  | `Article not found` | No article with the specified ID exists    |
| `500`  | error detail        | Unexpected server error                    |
