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

# Update Content

> Update an existing content item

## Path Parameters

<ParamField path="organizationId" type="string" required>
  Organization ID
</ParamField>

<ParamField path="projectId" type="string" required>
  Project ID
</ParamField>

<ParamField path="id" type="string" required>
  Content ID
</ParamField>

## Request Body

All fields are optional. Only provided fields will be updated.

<ParamField body="name" type="string">
  Display name for the content
</ParamField>

<ParamField body="description" type="string">
  Structured markdown description
</ParamField>

<ParamField body="content" type="object">
  The content data following the ContentType's schema
</ParamField>

<ParamField body="tags" type="string[]">
  Tags for categorization
</ParamField>

<ParamField body="folderId" type="string">
  Folder ID for organization
</ParamField>

<ParamField body="metadata" type="object">
  Additional metadata
</ParamField>

### Example Request

```json theme={null}
{
  "name": "Updated Getting Started Guide",
  "content": {
    "title": "Getting Started with Metabind (Updated)",
    "subtitle": "Your complete guide, now with more examples",
    "components": [
      {
        "type": "ArticleParagraph",
        "text": "Updated introduction text..."
      },
      {
        "type": "ArticleHeading",
        "text": "New Section",
        "level": 2
      }
    ]
  },
  "tags": ["Tutorial", "Updated"]
}
```

<Note>
  Updating a published content item changes its status to `modified`. The changes will not be visible to end users until the content is published again.
</Note>

## Response

Returns the updated Content object.

```json theme={null}
{
  "id": "cont124",
  "typeId": "ct123",
  "typeVersion": 2,
  "version": 1,
  "lastPublishedVersion": 1,
  "packageVersion": "1.0.0",
  "name": "Updated Getting Started Guide",
  "status": "modified",
  "isTemplate": false,
  "content": {
    "title": "Getting Started with Metabind (Updated)",
    "subtitle": "Your complete guide, now with more examples",
    "components": [...]
  },
  "compiled": "const body = () => { ... }",
  "tags": ["Tutorial", "Updated"],
  "metadata": { ... },
  "createdAt": "2024-03-21T10:00:00Z",
  "updatedAt": "2024-03-22T15:30:00Z"
}
```

## Error Responses

### Content Not Found

```json theme={null}
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Content not found"
  }
}
```

### Validation Failed

```json theme={null}
{
  "error": {
    "code": "VALIDATION_FAILED",
    "message": "Content does not match schema",
    "details": {
      "errors": [
        {
          "path": "/content/components/0/type",
          "message": "Component type 'InvalidComponent' not allowed"
        }
      ]
    }
  }
}
```

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content/cont124" \
    -H "Authorization: Bearer YOUR_JWT" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Updated Getting Started Guide",
      "content": {
        "title": "Getting Started with Metabind (Updated)",
        "components": [
          {
            "type": "ArticleParagraph",
            "text": "Updated introduction text..."
          }
        ]
      }
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content/cont124',
    {
      method: 'PUT',
      headers: {
        'Authorization': 'Bearer YOUR_JWT',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        name: 'Updated Getting Started Guide',
        content: {
          title: 'Getting Started with Metabind (Updated)',
          components: [
            {
              type: 'ArticleParagraph',
              text: 'Updated introduction text...'
            }
          ]
        }
      })
    }
  );

  const content = await response.json();
  console.log(`Updated content, new status: ${content.status}`);
  ```
</CodeGroup>
