# Start timer

`POST /api/timesheet/timer/start`

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

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

- `tenant` (optional)
  Type: object

- `tenantId` (optional)
  Type: string

- `organization` (required)
  Type: object

- `organizationId` (required)
  Type: string

- `sentTo` (optional)
  Type: string

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

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

- `description` (optional)
  Type: string

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

- `version` (optional)
  Type: string
  
  Example:
  
  ```json
  "1.0.1"
  ```

- `projectId` (optional)
  Type: string

- `taskId` (optional)
  Type: string

- `organizationContactId` (optional)
  Type: string

- `organizationTeamId` (optional)
  Type: string

Responses:

- 200: The timer has been successfully On.

- 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/timer/start' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "logType": "TRACKED",
  "source": "BROWSER",
  "description": "string",
  "isBillable": false,
  "version": "1.0.1",
  "projectId": "string",
  "taskId": "string",
  "organizationContactId": "string",
  "organizationTeamId": "string"
}'
```

### JavaScript

```javascript
const body = `{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "logType": "TRACKED",
  "source": "BROWSER",
  "description": "string",
  "isBillable": false,
  "version": "1.0.1",
  "projectId": "string",
  "taskId": "string",
  "organizationContactId": "string",
  "organizationTeamId": "string"
}`;

const response = await fetch('http://localhost:3000/api/timesheet/timer/start', {
  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",
  "logType": "TRACKED",
  "source": "BROWSER",
  "description": "string",
  "isBillable": false,
  "version": "1.0.1",
  "projectId": "string",
  "taskId": "string",
  "organizationContactId": "string",
  "organizationTeamId": "string"
}'''

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