Update Organization
Update an existing organization's details.
Endpoint
PATCH /api/v1/organizations/{org_id}
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <access_token> |
Content-Type | Yes | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
org_id | integer | Yes | Unique identifier of the organization to update. You can obtain organization IDs from the List Organizations endpoint. |
Request Body
{
"name": "Acme Corp Updated",
"domain": "acme-new.com"
}
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | New organization name. Must be unique across all organizations. |
domain | string | No | New organization domain. Used for domain-based features and SSO configuration. Must be a valid domain format. |
Response
Success (200)
{
"success": true,
"data": {
"organization": {
"id": 1,
"name": "Acme Corp Updated",
"domain": "acme-new.com"
},
"message": "Organization updated successfully"
},
"message": "Organization updated successfully"
}
Features
- Partial Updates: Supports PATCH method, allowing updates to specific fields without requiring all fields
- Permission Validation: Ensures only organization administrators can update organization details
- Name Uniqueness: Validates that organization names are unique across the platform
- Domain Validation: Validates domain format and ensures proper domain configuration
- Audit Logging: Records all organization update events for security monitoring and compliance
Important Notes
- Partial Updates: You only need to include fields you want to update. Omitted fields remain unchanged.
- Name Uniqueness: Organization names must be unique. If the new name conflicts with an existing organization, the update will fail.
- Domain Impact: Changing the organization domain may affect SSO configuration and domain-based features. Review SSO configuration if applicable.
- Immediate Effect: Changes take effect immediately upon successful update.
Error Handling
Common error scenarios include:
- Insufficient permissions (not an organization administrator)
- Organization name already exists
- Invalid domain format
- Organization not found
For more information on error handling, see Error Handling.
Related Endpoints
- Get Organization - Retrieve current organization details (prerequisite)
- List Organizations - List all accessible organizations
- Create Organization - Create a new organization
See Also
- Organizations API Overview - Complete guide to organization management
- Roles & Permissions API - Understanding organization roles and administrative permissions
- Authentication Concepts - Understanding authentication and token management
- SSO API Overview - Single Sign-On configuration (may be affected by domain changes)
- Error Handling - Understanding API error responses