# Update timesheet

`PUT /api/timesheet/status`

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

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

- `tenant` (optional)
  Type: object

- `tenantId` (optional)
  Type: string

- `organization` (required)
  Type: object

- `organizationId` (required)
  Type: string

- `sentTo` (optional)
  Type: string

- `status` (required)
  Type: string
  
  default: "PENDING"
  
  enum: ["DRAFT","PENDING","IN REVIEW","DENIED","APPROVED"]

- `ids` (required)
  Type: array
  
  Items:
    Type: string

Responses:

- 200: The timesheet has been successfully updated.

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

## Examples

### cURL

```bash
curl -X PUT 'http://localhost:3000/api/timesheet/status' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "status": "PENDING",
  "ids": [
    "string"
  ]
}'
```

### JavaScript

```javascript
const body = `{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "status": "PENDING",
  "ids": [
    "string"
  ]
}`;

const response = await fetch('http://localhost:3000/api/timesheet/status', {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

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

### Python

```python
import requests

body = '''{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "status": "PENDING",
  "ids": [
    "string"
  ]
}'''

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