# Add manual time

`POST /api/timesheet/time-log`

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

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

- `tenant` (optional)
  Type: object

- `tenantId` (optional)
  Type: string

- `organization` (required)
  Type: object

- `organizationId` (required)
  Type: string

- `sentTo` (optional)
  Type: string

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

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

- `employeeId` (required)
  Type: string

- `projectId` (optional)
  Type: string

- `taskId` (optional)
  Type: string

- `organizationContactId` (optional)
  Type: string

- `organizationTeamId` (optional)
  Type: string

- `description` (optional)
  Type: string

- `reason` (optional)
  Type: string

- `isBillable` (optional)
  Type: boolean

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

- `version` (optional)
  Type: string

- `logType` (required)
  Type: string
  
  enum: ["TRACKED","MANUAL","IDLE","RESUMED"]

- `source` (required)
  Type: string
  
  enum: ["MOBILE","BROWSER","DESKTOP","BROWSER_EXTENSION","HUBSTAFF","UPWORK","TEAMS","CLOC"]

Responses:

- 200: The timer has been successfully On/Off.

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

## Examples

### cURL

```bash
curl -X POST 'http://localhost:3000/api/timesheet/time-log' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "startedAt": "2024-01-15T09:30:00Z",
  "stoppedAt": "2024-01-15T09:30:00Z",
  "employeeId": "string",
  "projectId": "string",
  "taskId": "string",
  "organizationContactId": "string",
  "organizationTeamId": "string",
  "description": "string",
  "reason": "string",
  "isBillable": true,
  "tags": [
    []
  ],
  "version": "string",
  "logType": "TRACKED",
  "source": "MOBILE"
}'
```

### JavaScript

```javascript
const body = `{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "startedAt": "2024-01-15T09:30:00Z",
  "stoppedAt": "2024-01-15T09:30:00Z",
  "employeeId": "string",
  "projectId": "string",
  "taskId": "string",
  "organizationContactId": "string",
  "organizationTeamId": "string",
  "description": "string",
  "reason": "string",
  "isBillable": true,
  "tags": [
    []
  ],
  "version": "string",
  "logType": "TRACKED",
  "source": "MOBILE"
}`;

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

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

### Python

```python
import requests

body = '''{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "startedAt": "2024-01-15T09:30:00Z",
  "stoppedAt": "2024-01-15T09:30:00Z",
  "employeeId": "string",
  "projectId": "string",
  "taskId": "string",
  "organizationContactId": "string",
  "organizationTeamId": "string",
  "description": "string",
  "reason": "string",
  "isBillable": true,
  "tags": [
    []
  ],
  "version": "string",
  "logType": "TRACKED",
  "source": "MOBILE"
}'''

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