> ## 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 Component Asset

> Update component asset metadata

## Path Parameters

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

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

<ParamField path="componentId" type="string" required>
  Component ID
</ParamField>

<ParamField path="assetId" type="string" required>
  Asset ID
</ParamField>

## Request Body

<ParamField body="name" type="string">
  Asset name (1-255 characters)
</ParamField>

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

<ParamField body="tags" type="string[]">
  Array of tags (max 20 tags, each 1-100 characters)
</ParamField>

### Example Request

```json theme={null}
{
  "name": "logo-primary-2x.png",
  "metadata": {
    "width": 200,
    "height": 100,
    "author": "Design Team"
  },
  "tags": ["logo", "brand", "primary"]
}
```

## Response

Returns the updated Component Asset object.

```json theme={null}
{
  "id": "asset123",
  "componentId": "c123",
  "name": "logo-primary-2x.png",
  "type": "image/png",
  "url": "https://cdn.metabind.ai/.../logo-primary-2x.png",
  "size": 24576,
  "status": "active",
  "metadata": {
    "width": 200,
    "height": 100,
    "author": "Design Team"
  },
  "tags": ["logo", "brand", "primary"],
  "createdAt": "2024-03-20T10:00:00Z",
  "updatedAt": "2024-03-22T10:00:00Z"
}
```

## Error Responses

### Asset Not Found

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

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/components/c123/assets/asset123" \
    -H "Authorization: Bearer YOUR_JWT" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "logo-primary-2x.png",
      "tags": ["logo", "brand", "primary"]
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/components/c123/assets/asset123',
    {
      method: 'PUT',
      headers: {
        'Authorization': 'Bearer YOUR_JWT',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        name: 'logo-primary-2x.png',
        tags: ['logo', 'brand', 'primary']
      })
    }
  );

  const asset = await response.json();
  ```
</CodeGroup>
