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

> Update an organization's details

Updates an organization's name or description. The authenticated user must be an organization admin.

## Path Parameters

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

## Request Body

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

<ParamField body="description" type="string">
  Organization description (max 1000 characters, can be null to clear)
</ParamField>

### Example Request

```json theme={null}
{
  "name": "Acme Corporation",
  "description": "Updated organization description"
}
```

## Response

Returns the updated Organization object.

```json theme={null}
{
  "id": "org123",
  "name": "Acme Corporation",
  "slug": "acme-corp",
  "description": "Updated organization description",
  "status": "active",
  "settings": {
    "timezone": "America/Los_Angeles",
    "locales": ["en-US", "es-ES", "fr-FR"],
    "features": {
      "assetOptimization": true,
      "advancedPermissions": true
    }
  },
  "roles": {
    "role123": "Editor",
    "role456": "Viewer"
  },
  "metadata": {
    "createdBy": "user123",
    "maxProjects": 10
  },
  "subscription": {
    "tierId": "tier_pro",
    "status": "active",
    "currentPeriodStart": "2024-03-01T00:00:00Z",
    "currentPeriodEnd": "2024-04-01T00:00:00Z"
  },
  "createdAt": "2024-01-15T10:00:00Z",
  "updatedAt": "2024-03-21T10:00:00Z"
}
```

## Error Responses

### Organization Not Found

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

### Forbidden

```json theme={null}
{
  "error": {
    "code": "FORBIDDEN",
    "message": "This request is forbidden for your roles"
  }
}
```

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT "https://api.metabind.ai/app/v1/organizations/org123" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Acme Corporation",
      "description": "Updated organization description"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.metabind.ai/app/v1/organizations/org123',
    {
      method: 'PUT',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        name: 'Acme Corporation',
        description: 'Updated organization description'
      })
    }
  );

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

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

  let body = ["name": "Acme Corporation", "description": "Updated organization description"]
  request.httpBody = try JSONEncoder().encode(body)

  let (data, _) = try await URLSession.shared.data(for: request)
  let organization = try JSONDecoder().decode(Organization.self, from: data)
  print("Updated organization: \(organization.name)")
  ```

  ```kotlin Kotlin theme={null}
  val response = client.put("https://api.metabind.ai/app/v1/organizations/org123") {
      header("Authorization", "Bearer YOUR_API_KEY")
      contentType(ContentType.Application.Json)
      setBody(OrganizationUpdate(
          name = "Acme Corporation",
          description = "Updated organization description"
      ))
  }

  val organization = response.body<Organization>()
  println("Updated organization: ${organization.name}")
  ```
</CodeGroup>
