> ## Documentation Index
> Fetch the complete documentation index at: https://docs.allomia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Organization

> Updates an existing organization

## Update Organization

Updates an existing organization. This endpoint requires a valid tenant API key for authentication. While this is an update operation, the `name` and `email` fields are required and must be provided in the request body.

### Headers

<ParamField header="Authorization" type="string" required>
  API key is required. Enter your tenant-specific API key in the format 'Bearer
  YOUR-API-KEY'
</ParamField>

### Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the organization to update
</ParamField>

### Body Parameters

<ParamField body="name" type="string" required>
  The updated name of the organization
</ParamField>

<ParamField body="email" type="string" format="email" required>
  The updated email address for the organization
</ParamField>

<ParamField body="address" type="string">
  The updated street address of the organization
</ParamField>

<ParamField body="city" type="string">
  The updated city where the organization is located
</ParamField>

<ParamField body="stateProvince" type="string">
  The updated state or province where the organization is located
</ParamField>

<ParamField body="postalCode" type="string">
  The updated postal code or ZIP code for the organization
</ParamField>

<ParamField body="country" type="string">
  The updated country where the organization is located
</ParamField>

<ParamField body="phoneNumber" type="string">
  The updated contact phone number for the organization
</ParamField>

<ParamField body="timezone" type="string">
  The updated timezone for the organization. Must be one of the supported
  timezone values: - America/New\_York (Eastern Time) - America/Chicago (Central
  Time) - America/Denver (Mountain Time) - America/Los\_Angeles (Pacific Time) -
  America/Anchorage (Alaska Time) - Pacific/Honolulu (Hawaii Time) -
  America/Phoenix (Mountain Time - Arizona) - America/Toronto (Eastern Time) -
  America/Vancouver (Pacific Time) - America/Edmonton (Mountain Time) -
  America/Winnipeg (Central Time) - America/Halifax (Atlantic Time) -
  America/St\_Johns (Newfoundland Time) - Europe/London (British Time) -
  Europe/Paris (Central European Time) - Europe/Helsinki (Eastern European Time)

  * Asia/Dubai (Gulf Time) - Asia/Shanghai (China Time) - Asia/Tokyo (Japan
    Time) - Australia/Sydney (Australian Eastern Time) - Pacific/Auckland (New
    Zealand Time)
</ParamField>

### Response

<ResponseField name="id" type="string">
  The unique identifier for the organization
</ResponseField>

<ResponseField name="name" type="string">
  The updated name of the organization
</ResponseField>

<ResponseField name="email" type="string">
  The updated email address for the organization
</ResponseField>

<ResponseField name="address" type="string">
  The updated street address of the organization
</ResponseField>

<ResponseField name="city" type="string">
  The updated city where the organization is located
</ResponseField>

<ResponseField name="stateProvince" type="string">
  The updated state or province where the organization is located
</ResponseField>

<ResponseField name="postalCode" type="string">
  The updated postal code or ZIP code for the organization
</ResponseField>

<ResponseField name="country" type="string">
  The updated country where the organization is located
</ResponseField>

<ResponseField name="phoneNumber" type="string">
  The updated contact phone number for the organization
</ResponseField>

<ResponseField name="tenantId" type="string">
  The tenant ID that the organization belongs to
</ResponseField>

<ResponseField name="timezone" type="string">
  The updated timezone for the organization
</ResponseField>

<ResponseField name="createdAt" type="string" format="date-time">
  The timestamp when the organization was created (ISO 8601 format:
  "2025-06-01T12:34:56Z")
</ResponseField>

<ResponseField name="createdBy" type="string">
  The ID of the user who created the organization
</ResponseField>

### Example Request

```bash theme={null}
curl -X PUT https://allomia.com/api/organization/a1b2c3d4-e5f6-7890-abcd-123456789012 \
  -H "Authorization: Bearer YOUR-API-KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Valley Health Clinic - Downtown",
    "email": "downtown@valleyhealthclinic.com",
    "address": "456 Downtown Boulevard",
    "city": "San Francisco",
    "stateProvince": "CA",
    "postalCode": "94102",
    "country": "USA",
    "phoneNumber": "+14155557890",
    "timezone": "America/Los_Angeles"
  }'
```

### Example Response

```json theme={null}
{
  "id": "a1b2c3d4-e5f6-7890-abcd-123456789012",
  "name": "Valley Health Clinic - Downtown",
  "email": "downtown@valleyhealthclinic.com",
  "address": "456 Downtown Boulevard",
  "city": "San Francisco",
  "stateProvince": "CA",
  "postalCode": "94102",
  "country": "USA",
  "phoneNumber": "+14155557890",
  "tenantId": "tenant_123",
  "timezone": "America/Los_Angeles",
  "createdAt": "2025-06-01T12:34:56Z",
  "createdBy": "b2c3d4e5-f6a7-8901-bcde-234567890123"
}
```

### Error Responses

<AccordionGroup>
  <Accordion title="400: Invalid request data">
    ```json theme={null}
    {
      "error": "Missing required fields: name and email are required"
    }
    ```
  </Accordion>

  <Accordion title="401: Unauthorized">
    ```json theme={null}
    {
      "error": "Invalid or missing API key"
    }
    ```
  </Accordion>

  <Accordion title="404: Organization not found">
    ```json theme={null}
    {
      "error": "Organization not found for the provided ID"
    }
    ```
  </Accordion>

  <Accordion title="500: Error">
    ```json theme={null}
    {
      "error": "Internal server error occurred"
    }
    ```
  </Accordion>
</AccordionGroup>
