Update Organization
Updates an existing organization. All fields are optional - only provided fields will be updated.
Endpoint
PUT /api/organizations/:id
Authentication
Requires API Key authentication.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Organization ID |
Request Body
All fields are optional. Only include fields you want to update.
| Field | Type | Description |
|---|---|---|
name | string | Organization name |
phone_number | string | Primary contact phone number |
street_address | string | Physical street address |
city | string | City |
state | string | State or province |
zip_code | string | ZIP or postal code |
country | string | Country |
Response
Returns the updated organization object.
{
"success": true,
"data": {
"id": "org_abc123def456",
"account_id": "acc_xyz789",
"name": "Smith & Associates Law Firm",
"phone_number": "555-999-8888",
"street_address": "789 New Street, Suite 500",
"city": "San Francisco",
"state": "CA",
"zip_code": "94103",
"country": "United States",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z"
}
}
Example
curl -X PUT "https://api.silentwitness.ai/api/organizations/org_abc123def456" \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "555-999-8888",
"street_address": "789 New Street, Suite 500",
"zip_code": "94103"
}'
Errors
error_code | HTTP | error_type | Meaning |
|---|---|---|---|
org_field_required | 400 | invalid_request_error | Organization ID is missing from the path. |
org_invalid_body | 400 | invalid_request_error | Request body is not valid JSON. |
org_not_found | 404 | invalid_request_error | No organization matches the provided ID. |
org_access_denied | 403 | permission_error | The organization belongs to a different account. |
org_update_failed | 500 | api_error | Unexpected server error during update. Include request_id when contacting support. |
Example Error
{
"success": false,
"error": "Organization not found",
"error_code": "org_not_found",
"error_type": "invalid_request_error",
"error_param": "id",
"request_id": "req_9c1b3a7e4d2f4a80a9b3e7c1f8d2a4b6"
}