# Update a broadcast

`PUT /api/broadcasts/{id}`

Authentication (security requirement alternatives):

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

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

Parameters:

- `id` (path, string, required)
  Type: string

Request body: application/json (required)

Type: object

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

- `tenant` (optional)
  Type: object

- `tenantId` (optional)
  Type: string

- `organization` (optional)
  Type: object

- `organizationId` (optional)
  Type: string

- `sentTo` (optional)
  Type: string

- `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"
  ```

- `title` (optional)
  Type: string

- `content` (optional)
  Type: object

- `category` (optional)
  Type: string
  
  enum: ["STATUS_REPORT","MILESTONE","ANNOUNCEMENT","ALERT","DECISION","CHANGELOG"]

- `visibilityMode` (optional)
  Type: string
  
  enum: ["ENTITY_MEMBERS","ORGANIZATION","RESTRICTED","EXTERNAL_VIEW"]

- `audienceRules` (optional)
  Type: object

- `publishedAt` (optional)
  Type: string, date-time

Responses:

- 200: Broadcast updated successfully

Content type: application/json

Type: object

Schema: [Broadcast](https://sourcey-gauzy.pages.dev/api-reference/models/broadcast/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

- `organizationId` (optional)
  Type: string

- `entity` (required)
  Type: string
  
  enum: ["Broadcast","Candidate","Comment","Contact","Currency","DailyPlan","Dashboard","DashboardWidget","Document","Employee","Expense","Invoice","Income","Language","Organization","OrganizationContact","OrganizationDepartment","OrganizationDocument","OrganizationProject","OrganizationTeam","OrganizationProjectModule","OrganizationSprint","OrganizationVendor","ResourceLink","ScreeningTask","OrganizationStrategicInitiative","Task","TaskLinkedIssue","TaskView","User","Tenant"]

- `entityId` (required)
  Type: string

- `title` (required)
  Type: string

- `content` (required)
  Type: object

- `category` (required)
  Type: string
  
  enum: ["STATUS_REPORT","MILESTONE","ANNOUNCEMENT","ALERT","DECISION","CHANGELOG"]

- `visibilityMode` (required)
  Type: string
  
  enum: ["ENTITY_MEMBERS","ORGANIZATION","RESTRICTED","EXTERNAL_VIEW"]

- `audienceRules` (optional)
  Type: object

- `publishedAt` (optional)
  Type: string, date-time

- `employeeId` (optional)
  Type: string

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

- 401: Unauthorized

- 403: Forbidden

- 404: Record not found

## Examples

### cURL

```bash
curl -X PUT 'http://localhost:3000/api/broadcasts/string' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "deletedAt": "2018-11-21T06:20:32.232Z",
  "createdAt": "2018-11-21T06:20:32.232Z",
  "updatedAt": "2018-11-21T06:20:32.232Z",
  "id": "string",
  "isActive": true,
  "isArchived": false,
  "archivedAt": "2018-11-21T06:20:32.232Z",
  "title": "string",
  "content": {},
  "category": "STATUS_REPORT",
  "visibilityMode": "ENTITY_MEMBERS",
  "audienceRules": {},
  "publishedAt": "2024-01-15T09:30:00Z"
}'
```

### JavaScript

```javascript
const body = `{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "deletedAt": "2018-11-21T06:20:32.232Z",
  "createdAt": "2018-11-21T06:20:32.232Z",
  "updatedAt": "2018-11-21T06:20:32.232Z",
  "id": "string",
  "isActive": true,
  "isArchived": false,
  "archivedAt": "2018-11-21T06:20:32.232Z",
  "title": "string",
  "content": {},
  "category": "STATUS_REPORT",
  "visibilityMode": "ENTITY_MEMBERS",
  "audienceRules": {},
  "publishedAt": "2024-01-15T09:30:00Z"
}`;

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

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

### Python

```python
import requests

body = '''{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "deletedAt": "2018-11-21T06:20:32.232Z",
  "createdAt": "2018-11-21T06:20:32.232Z",
  "updatedAt": "2018-11-21T06:20:32.232Z",
  "id": "string",
  "isActive": true,
  "isArchived": false,
  "archivedAt": "2018-11-21T06:20:32.232Z",
  "title": "string",
  "content": {},
  "category": "STATUS_REPORT",
  "visibilityMode": "ENTITY_MEMBERS",
  "audienceRules": {},
  "publishedAt": "2024-01-15T09:30:00Z"
}'''

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