# Update daily plan

`PUT /api/daily-plan/{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: [UpdateDailyPlanDTO](https://sourcey-gauzy.pages.dev/api-reference/models/updatedailyplandto/index.md)

- `tenant` (optional)
  Type: object

- `tenantId` (optional)
  Type: string

- `organization` (required)
  Type: object

- `organizationId` (required)
  Type: string

- `sentTo` (optional)
  Type: string

- `employeeId` (optional)
  Type: string

- `organizationTeamId` (optional)
  Type: string

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

- `workTimePlanned` (optional)
  Type: number

- `status` (optional)
  Type: string
  
  enum: ["open","in-progress","completed"]

Responses:

- 200: Plan updated

Content type: application/json

Type: object

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

- `date` (required)
  Type: string, date-time

- `workTimePlanned` (required)
  Type: number

- `status` (required)
  Type: string

- `employeeId` (optional)
  Type: string

- `organizationTeamId` (optional)
  Type: string

- 401: Unauthorized

- 403: Forbidden

- 404: No Record found

## Examples

### cURL

```bash
curl -X PUT 'http://localhost:3000/api/daily-plan/string' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "employeeId": "string",
  "organizationTeamId": "string",
  "date": "2024-01-15T09:30:00Z",
  "workTimePlanned": 0,
  "status": "open"
}'
```

### JavaScript

```javascript
const body = `{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "employeeId": "string",
  "organizationTeamId": "string",
  "date": "2024-01-15T09:30:00Z",
  "workTimePlanned": 0,
  "status": "open"
}`;

const response = await fetch('http://localhost:3000/api/daily-plan/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",
  "employeeId": "string",
  "organizationTeamId": "string",
  "date": "2024-01-15T09:30:00Z",
  "workTimePlanned": 0,
  "status": "open"
}'''

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