# Update an existing Organization

`PUT /api/organization/{id}`

Authentication (security requirement alternatives):

```json
[
  {
    "bearer": []
  }
]
```

- bearer: http (bearer), header JWT. Enter JWT token

Parameters:

- `id` (path, string, required) - The unique identifier (UUID) of the organization.
  Type: string

Request body: application/json (required)

Type: object

Schema: [UpdateOrganizationDTO](https://sourcey-gauzy.pages.dev/api-reference/models/updateorganizationdto/index.md)

- `bonusType` (optional)
  Type: string
  
  The type of bonus, can be one of the defined BonusTypeEnum values.
  
  enum: ["PROFIT_BASED_BONUS","REVENUE_BASED_BONUS"]
  
  Example:
  
  ```json
  "PROFIT_BASED_BONUS"
  ```

- `bonusPercentage` (optional)
  Type: number
  
  The percentage of profit-based bonus, must be between 0 and 100.
  
  Example:
  
  ```json
  75
  ```

- `defaultValueDateType` (optional)
  Type: string
  
  The default value date type, can be one of the values from DefaultValueDateTypeEnum.
  
  enum: ["TODAY","END_OF_MONTH","START_OF_MONTH"]
  
  Example:
  
  ```json
  "TODAY"
  ```

- `regionCode` (optional)
  Type: string
  
  The code representing a specific region (e.g., country or geographical area).

- `startWeekOn` (optional)
  Type: string
  
  Specifies which day the week starts on. Must be one of the WeekDaysEnum values.
  
  enum: ["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"]
  
  Example:
  
  ```json
  "MONDAY"
  ```

- `inviteExpiryPeriod` (optional)
  Type: number
  
  The default invite expiry period in days.
  
  Example:
  
  ```json
  7
  ```

- `allowEmployeeToSeeTrackedData` (optional)
  Type: boolean
  
  Allow employees to see their own tracked data (screenshots, activity, app/url history, time logs).
  
  Example:
  
  ```json
  true
  ```

- `name` (required)
  Type: string

- `standardWorkHoursPerDay` (optional)
  Type: number
  
  Standard work hours per day for the organization
  
  minimum: 1
  
  maximum: 24

- `imageId` (optional)
  Type: string

- `upworkOrganizationId` (optional)
  Type: string

- `upworkOrganizationName` (optional)
  Type: string

- `tags` (optional)
  Type: array
  
  Items:
    Type: array

- `currency` (required)
  Type: string
  
  enum: ["AFN","AFA","ALL","ALK","DZD","ADP","AOA","AOK","AON","AOR","ARA","ARS","ARM","ARP","ARL","AMD","AWG","AUD","ATS","AZN","AZM","BSD","BHD","BDT","BBD","BYN","BYB","BYR","BEF","BEC","BEL","BZD","BMD","BTN","BOB","BOL","BOV","BOP","BAM","BAD","BAN","BWP","BRC","BRZ","BRE","BRR","BRN","BRB","BRL","GBP","BND","BGL","BGN","BGO","BGM","BUK","BIF","XPF","KHR","CAD","CVE","KYD","XAF","CLE","CLP","CLF","CNX","CNY","COP","COU","KMF","CDF","CRC","HRD","HRK","CUC","CUP","CYP","CZK","CSK","DKK","DJF","DOP","NLG","XCD","DDM","ECS","ECV","EGP","GQE","ERN","EEK","ETB","EUR","XEU","FKP","FJD","FIM","FRF","XFO","XFU","GMD","GEK","GEL","DEM","GHS","GHC","GIP","GRD","GTQ","GWP","GNF","GNS","GYD","HTG","HNL","HKD","HUF","ISK","ISJ","INR","IDR","IRR","IQD","IEP","ILS","ILP","ILR","ITL","JMD","JPY","JOD","KZT","KES","KWD","KGS","LAK","LVL","LVR","LBP","LSL","LRD","LYD","LTL","LTT","LUL","LUC","LUF","MOP","MKD","MKN","MGA","MGF","MWK","MYR","MVR","MVP","MLF","MTL","MTP","MRO","MUR","MXV","MXN","MXP","MDC","MDL","MCF","MNT","MAD","MAF","MZE","MZN","MZM","MMK","NAD","NPR","ANG","TWD","NZD","NIO","NIC","NGN","KPW","NOK","OMR","PKR","PAB","PGK","PYG","PEI","PEN","PES","PHP","PLN","PLZ","PTE","GWE","QAR","XRE","RHD","RON","ROL","RUB","RUR","RWF","SVC","WST","SAR","RSD","CSD","SCR","SLL","SGD","SKK","SIT","SBD","SOS","ZAR","ZAL","KRH","KRW","KRO","SSP","SUR","ESP","ESA","ESB","LKR","SHP","SDD","SDG","SDP","SRD","SRG","SZL","SEK","CHF","SYP","STD","TJR","TJS","TZS","THB","TPE","TOP","TTD","TND","TRY","TRL","TMT","TMM","USD","USN","USS","UGX","UGS","UAH","UAK","AED","UYU","UYP","UYI","UZS","VUV","VEF","VEB","VND","VNN","CHE","CHW","XOF","YDD","YER","YUN","YUD","YUM","YUR","ZRN","ZRZ","ZMW","ZMK","ZWD","ZWR","ZWL"]
  
  Example:
  
  ```json
  "USD"
  ```

- `show_income` (optional)
  Type: boolean

- `show_profits` (optional)
  Type: boolean

- `show_bonuses_paid` (optional)
  Type: boolean

- `show_total_hours` (optional)
  Type: boolean

- `show_minimum_project_size` (optional)
  Type: boolean

- `show_projects_count` (optional)
  Type: boolean

- `show_clients_count` (optional)
  Type: boolean

- `show_clients` (optional)
  Type: boolean

- `show_employees_count` (optional)
  Type: boolean

- `acknowledgeAgentExitLogoutRestriction` (optional)
  Type: boolean

Responses:

- 200: The Organization has been successfully updated.

Content type: application/json

Type: object

Schema: [Organization](https://sourcey-gauzy.pages.dev/api-reference/models/organization/index.md)

- `deletedAt` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `createdAt` (optional)
  Type: string, date-time
  
  The creation timestamp of the entity.
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `updatedAt` (optional)
  Type: string, date-time
  
  The last update timestamp of the entity.
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `id` (optional)
  Type: string

- `isActive` (optional)
  Type: boolean
  
  default: true

- `isArchived` (optional)
  Type: boolean
  
  default: false

- `archivedAt` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `tenantId` (optional)
  Type: string

- `name` (required)
  Type: string

- `currency` (required)
  Type: string
  
  The currency used by the organization, must be one of the CurrenciesEnum values.
  
  enum: ["AFN","AFA","ALL","ALK","DZD","ADP","AOA","AOK","AON","AOR","ARA","ARS","ARM","ARP","ARL","AMD","AWG","AUD","ATS","AZN","AZM","BSD","BHD","BDT","BBD","BYN","BYB","BYR","BEF","BEC","BEL","BZD","BMD","BTN","BOB","BOL","BOV","BOP","BAM","BAD","BAN","BWP","BRC","BRZ","BRE","BRR","BRN","BRB","BRL","GBP","BND","BGL","BGN","BGO","BGM","BUK","BIF","XPF","KHR","CAD","CVE","KYD","XAF","CLE","CLP","CLF","CNX","CNY","COP","COU","KMF","CDF","CRC","HRD","HRK","CUC","CUP","CYP","CZK","CSK","DKK","DJF","DOP","NLG","XCD","DDM","ECS","ECV","EGP","GQE","ERN","EEK","ETB","EUR","XEU","FKP","FJD","FIM","FRF","XFO","XFU","GMD","GEK","GEL","DEM","GHS","GHC","GIP","GRD","GTQ","GWP","GNF","GNS","GYD","HTG","HNL","HKD","HUF","ISK","ISJ","INR","IDR","IRR","IQD","IEP","ILS","ILP","ILR","ITL","JMD","JPY","JOD","KZT","KES","KWD","KGS","LAK","LVL","LVR","LBP","LSL","LRD","LYD","LTL","LTT","LUL","LUC","LUF","MOP","MKD","MKN","MGA","MGF","MWK","MYR","MVR","MVP","MLF","MTL","MTP","MRO","MUR","MXV","MXN","MXP","MDC","MDL","MCF","MNT","MAD","MAF","MZE","MZN","MZM","MMK","NAD","NPR","ANG","TWD","NZD","NIO","NIC","NGN","KPW","NOK","OMR","PKR","PAB","PGK","PYG","PEI","PEN","PES","PHP","PLN","PLZ","PTE","GWE","QAR","XRE","RHD","RON","ROL","RUB","RUR","RWF","SVC","WST","SAR","RSD","CSD","SCR","SLL","SGD","SKK","SIT","SBD","SOS","ZAR","ZAL","KRH","KRW","KRO","SSP","SUR","ESP","ESA","ESB","LKR","SHP","SDD","SDG","SDP","SRD","SRG","SZL","SEK","CHF","SYP","STD","TJR","TJS","TZS","THB","TPE","TOP","TTD","TND","TRY","TRL","TMT","TMM","USD","USN","USS","UGX","UGS","UAH","UAK","AED","UYU","UYP","UYI","UZS","VUV","VEF","VEB","VND","VNN","CHE","CHW","XOF","YDD","YER","YUN","YUD","YUM","YUR","ZRN","ZRZ","ZMW","ZMK","ZWD","ZWR","ZWL"]
  
  Example:
  
  ```json
  "USD"
  ```

- `defaultValueDateType` (optional)
  Type: string
  
  The default value date type, can be one of the values from DefaultValueDateTypeEnum.
  
  enum: ["TODAY","END_OF_MONTH","START_OF_MONTH"]
  
  Example:
  
  ```json
  "TODAY"
  ```

- `regionCode` (optional)
  Type: string
  
  The code representing a specific region (e.g., country or geographical area).

- `startWeekOn` (optional)
  Type: string
  
  Specifies which day the week starts on. Must be one of the WeekDaysEnum values.
  
  enum: ["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"]
  
  Example:
  
  ```json
  "MONDAY"
  ```

- `bonusType` (optional)
  Type: string
  
  The type of bonus, can be one of the defined BonusTypeEnum values.
  
  enum: ["PROFIT_BASED_BONUS","REVENUE_BASED_BONUS"]
  
  Example:
  
  ```json
  "PROFIT_BASED_BONUS"
  ```

- `bonusPercentage` (optional)
  Type: number
  
  The percentage of profit-based bonus, must be between 0 and 100.
  
  Example:
  
  ```json
  75
  ```

- `show_income` (optional)
  Type: boolean

- `show_profits` (optional)
  Type: boolean

- `show_bonuses_paid` (optional)
  Type: boolean

- `show_total_hours` (optional)
  Type: boolean

- `show_minimum_project_size` (optional)
  Type: boolean

- `show_projects_count` (optional)
  Type: boolean

- `show_clients_count` (optional)
  Type: boolean

- `show_clients` (optional)
  Type: boolean

- `show_employees_count` (optional)
  Type: boolean

- `inviteExpiryPeriod` (optional)
  Type: number
  
  The default invite expiry period in days.
  
  Example:
  
  ```json
  7
  ```

- `upworkOrganizationId` (optional)
  Type: string

- `upworkOrganizationName` (optional)
  Type: string

- `randomScreenshot` (optional)
  Type: boolean

- `trackOnSleep` (optional)
  Type: boolean

- `screenshotFrequency` (optional)
  Type: number

- `enforced` (optional)
  Type: boolean

- `standardWorkHoursPerDay` (optional)
  Type: number
  
  Standard work hours per day for the organization
  
  minimum: 1
  
  maximum: 24

- `allowAgentAppExit` (optional)
  Type: boolean
  
  Allow employees to exit the Agent app. When disabled, the exit option will be blocked in the Agent app.
  
  Example:
  
  ```json
  true
  ```

- `allowLogoutFromAgentApp` (optional)
  Type: boolean
  
  Allow employees to logout from the Agent app. When disabled, the logout option will be blocked in the Agent app.
  
  Example:
  
  ```json
  true
  ```

- `trackKeyboardMouseActivity` (optional)
  Type: boolean
  
  Enable comprehensive keyboard and mouse activity tracking for detailed productivity insights.
  
  Example:
  
  ```json
  false
  ```

- `trackAllDisplays` (optional)
  Type: boolean
  
  Track all displays instead of just the primary display. Useful for multi-monitor setups.
  
  Example:
  
  ```json
  false
  ```

- `allowEmployeeToSeeTrackedData` (optional)
  Type: boolean
  
  Allow employees to see their own tracked data (screenshots, activity, app/url history, time logs).
  
  Example:
  
  ```json
  true
  ```

- `imageId` (optional)
  Type: string

- 400: Invalid input, the response body may contain clues as to what went wrong.

- 401: Unauthorized

- 403: Forbidden

- 404: No organization found with the provided ID.

## Examples

### cURL

```bash
curl -X PUT 'http://localhost:3000/api/organization/string' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "bonusType": "PROFIT_BASED_BONUS",
  "bonusPercentage": 75,
  "defaultValueDateType": "TODAY",
  "regionCode": "string",
  "startWeekOn": "MONDAY",
  "inviteExpiryPeriod": 7,
  "allowEmployeeToSeeTrackedData": true,
  "name": "string",
  "standardWorkHoursPerDay": 1,
  "imageId": "string",
  "upworkOrganizationId": "string",
  "upworkOrganizationName": "string",
  "tags": [
    []
  ],
  "currency": "USD",
  "show_income": true,
  "show_profits": true,
  "show_bonuses_paid": true,
  "show_total_hours": true,
  "show_minimum_project_size": true,
  "show_projects_count": true,
  "show_clients_count": true,
  "show_clients": true,
  "show_employees_count": true,
  "acknowledgeAgentExitLogoutRestriction": true
}'
```

### JavaScript

```javascript
const body = `{
  "bonusType": "PROFIT_BASED_BONUS",
  "bonusPercentage": 75,
  "defaultValueDateType": "TODAY",
  "regionCode": "string",
  "startWeekOn": "MONDAY",
  "inviteExpiryPeriod": 7,
  "allowEmployeeToSeeTrackedData": true,
  "name": "string",
  "standardWorkHoursPerDay": 1,
  "imageId": "string",
  "upworkOrganizationId": "string",
  "upworkOrganizationName": "string",
  "tags": [
    []
  ],
  "currency": "USD",
  "show_income": true,
  "show_profits": true,
  "show_bonuses_paid": true,
  "show_total_hours": true,
  "show_minimum_project_size": true,
  "show_projects_count": true,
  "show_clients_count": true,
  "show_clients": true,
  "show_employees_count": true,
  "acknowledgeAgentExitLogoutRestriction": true
}`;

const response = await fetch('http://localhost:3000/api/organization/string', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "bonusType": "PROFIT_BASED_BONUS",
  "bonusPercentage": 75,
  "defaultValueDateType": "TODAY",
  "regionCode": "string",
  "startWeekOn": "MONDAY",
  "inviteExpiryPeriod": 7,
  "allowEmployeeToSeeTrackedData": true,
  "name": "string",
  "standardWorkHoursPerDay": 1,
  "imageId": "string",
  "upworkOrganizationId": "string",
  "upworkOrganizationName": "string",
  "tags": [
    []
  ],
  "currency": "USD",
  "show_income": true,
  "show_profits": true,
  "show_bonuses_paid": true,
  "show_total_hours": true,
  "show_minimum_project_size": true,
  "show_projects_count": true,
  "show_clients_count": true,
  "show_clients": true,
  "show_employees_count": true,
  "acknowledgeAgentExitLogoutRestriction": true
}'''

response = requests.put(
    'http://localhost:3000/api/organization/string',
    data=body.encode('utf-8'),
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
