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

> Update an existing project

## Path Parameters

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

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

## Request Body

<ParamField body="name" type="string">
  Updated project name
</ParamField>

<ParamField body="description" type="string">
  Updated description
</ParamField>

<ParamField body="status" type="string">
  Updated status: `active`, `archived`, or `deleted`
</ParamField>

<ParamField body="settings" type="object">
  Updated project settings (partial updates supported)
</ParamField>

<Note>
  The project `slug` cannot be changed after creation to preserve URL stability.
</Note>

### Example Request

```json theme={null}
{
  "description": "Updated description",
  "settings": {
    "cdnDomain": "new-cdn.acme.com",
    "thumbnailUrl": "https://cdn.acme.com/thumbnails/new-icon.png",
    "defaultPlatform": "mobile",
    "supportedPlatforms": ["mobile", "desktop"]
  }
}
```

## Response

Returns the updated Project object.

```json theme={null}
{
  "id": "proj123",
  "organizationId": "org123",
  "name": "Marketing Website",
  "slug": "marketing-website",
  "description": "Updated description",
  "status": "active",
  "environment": "production",
  "settings": {
    "defaultLocale": "en-US",
    "supportedLocales": ["en-US", "es-ES"],
    "defaultPlatform": "mobile",
    "supportedPlatforms": ["mobile", "desktop"],
    "thumbnailUrl": "https://cdn.acme.com/thumbnails/new-icon.png",
    "cdnDomain": "new-cdn.acme.com"
  },
  "createdAt": "2024-03-20T10:00:00Z",
  "updatedAt": "2024-03-22T14:00:00Z"
}
```

## Error Responses

### Project Not Found

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

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT "https://api.metabind.ai/app/v1/organizations/org123/projects/proj123" \
    -H "Authorization: Bearer YOUR_JWT" \
    -H "Content-Type: application/json" \
    -d '{
      "description": "Updated description",
      "settings": {
        "cdnDomain": "new-cdn.acme.com"
      }
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.metabind.ai/app/v1/organizations/org123/projects/proj123',
    {
      method: 'PUT',
      headers: {
        'Authorization': 'Bearer YOUR_JWT',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        description: 'Updated description',
        settings: {
          cdnDomain: 'new-cdn.acme.com'
        }
      })
    }
  );

  const project = await response.json();
  console.log(`Updated project: ${project.name}`);
  ```

  ```swift Swift theme={null}
  var request = URLRequest(url: URL(string: "https://api.metabind.ai/app/v1/organizations/org123/projects/proj123")!)
  request.httpMethod = "PUT"
  request.setValue("Bearer YOUR_JWT", forHTTPHeaderField: "Authorization")
  request.setValue("application/json", forHTTPHeaderField: "Content-Type")

  let body = ["description": "Updated description"]
  request.httpBody = try JSONEncoder().encode(body)

  let (data, _) = try await URLSession.shared.data(for: request)
  ```

  ```kotlin Kotlin theme={null}
  val response = client.put("https://api.metabind.ai/app/v1/organizations/org123/projects/proj123") {
      header("Authorization", "Bearer YOUR_JWT")
      contentType(ContentType.Application.Json)
      setBody(mapOf("description" to "Updated description"))
  }
  ```
</CodeGroup>
