# Create a new dashboard.

`POST /api/dashboard`

Authentication (security requirement alternatives):

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

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

Request body: application/json (required)

Type: object

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

- `tenant` (optional)
  Type: object

- `tenantId` (optional)
  Type: string

- `organization` (required)
  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"
  ```

- `name` (required)
  Type: string

- `identifier` (required)
  Type: string

- `description` (optional)
  Type: string

- `contentHtml` (optional)
  Type: object

- `employee` (optional)
  Reference: [Employee](https://sourcey-gauzy.pages.dev/api-reference/models/employee/index.md); Type: object

- `employeeId` (optional)
  Type: string

Responses:

- 201: The dashboard has been successfully created.

- 400: Invalid input, object invalid.

- 401: Unauthorized

- 403: Forbidden

## Examples

### cURL

```bash
curl -X POST 'http://localhost:3000/api/dashboard' \
  -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",
  "name": "string",
  "identifier": "string",
  "description": "string",
  "contentHtml": {},
  "employee": {
    "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",
    "tenantId": "string",
    "organizationId": "string",
    "short_description": "string",
    "description": "string",
    "startedWorkOn": "2024-01-15T09:30:00Z",
    "endWork": "2024-01-15T09:30:00Z",
    "payPeriod": "WEEKLY",
    "billRateValue": 0,
    "minimumBillingRate": 0,
    "billRateCurrency": "USD",
    "reWeeklyLimit": 0,
    "offerDate": "2024-01-15T09:30:00Z",
    "acceptDate": "2024-01-15T09:30:00Z",
    "rejectDate": "2024-01-15T09:30:00Z",
    "employeeLevel": "string",
    "anonymousBonus": true,
    "averageIncome": 0,
    "averageBonus": 0,
    "totalWorkHours": 0,
    "averageExpenses": 0,
    "show_anonymous_bonus": true,
    "show_average_bonus": true,
    "show_average_expenses": true,
    "show_average_income": true,
    "show_billrate": true,
    "show_payperiod": true,
    "show_start_work_on": true,
    "isJobSearchActive": true,
    "linkedInUrl": "string",
    "facebookUrl": "string",
    "instagramUrl": "string",
    "twitterUrl": "string",
    "githubUrl": "string",
    "gitlabUrl": "string",
    "upworkUrl": "string",
    "stackoverflowUrl": "string",
    "isVerified": true,
    "isVetted": true,
    "totalJobs": 0,
    "jobSuccess": 0,
    "profile_link": "string",
    "isTrackingEnabled": true,
    "isOnline": true,
    "isAway": false,
    "isTrackingTime": true,
    "allowScreenshotCapture": true,
    "allowManualTime": true,
    "allowModifyTime": true,
    "allowDeleteTime": true,
    "allowAgentAppExit": true,
    "allowLogoutFromAgentApp": true,
    "trackKeyboardMouseActivity": true,
    "trackAllDisplays": true,
    "upworkId": "string",
    "linkedInId": "string",
    "userId": "string",
    "contactId": "string",
    "organizationPositionId": "string"
  },
  "employeeId": "string"
}'
```

### 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",
  "name": "string",
  "identifier": "string",
  "description": "string",
  "contentHtml": {},
  "employee": {
    "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",
    "tenantId": "string",
    "organizationId": "string",
    "short_description": "string",
    "description": "string",
    "startedWorkOn": "2024-01-15T09:30:00Z",
    "endWork": "2024-01-15T09:30:00Z",
    "payPeriod": "WEEKLY",
    "billRateValue": 0,
    "minimumBillingRate": 0,
    "billRateCurrency": "USD",
    "reWeeklyLimit": 0,
    "offerDate": "2024-01-15T09:30:00Z",
    "acceptDate": "2024-01-15T09:30:00Z",
    "rejectDate": "2024-01-15T09:30:00Z",
    "employeeLevel": "string",
    "anonymousBonus": true,
    "averageIncome": 0,
    "averageBonus": 0,
    "totalWorkHours": 0,
    "averageExpenses": 0,
    "show_anonymous_bonus": true,
    "show_average_bonus": true,
    "show_average_expenses": true,
    "show_average_income": true,
    "show_billrate": true,
    "show_payperiod": true,
    "show_start_work_on": true,
    "isJobSearchActive": true,
    "linkedInUrl": "string",
    "facebookUrl": "string",
    "instagramUrl": "string",
    "twitterUrl": "string",
    "githubUrl": "string",
    "gitlabUrl": "string",
    "upworkUrl": "string",
    "stackoverflowUrl": "string",
    "isVerified": true,
    "isVetted": true,
    "totalJobs": 0,
    "jobSuccess": 0,
    "profile_link": "string",
    "isTrackingEnabled": true,
    "isOnline": true,
    "isAway": false,
    "isTrackingTime": true,
    "allowScreenshotCapture": true,
    "allowManualTime": true,
    "allowModifyTime": true,
    "allowDeleteTime": true,
    "allowAgentAppExit": true,
    "allowLogoutFromAgentApp": true,
    "trackKeyboardMouseActivity": true,
    "trackAllDisplays": true,
    "upworkId": "string",
    "linkedInId": "string",
    "userId": "string",
    "contactId": "string",
    "organizationPositionId": "string"
  },
  "employeeId": "string"
}`;

const response = await fetch('http://localhost:3000/api/dashboard', {
  method: 'POST',
  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",
  "name": "string",
  "identifier": "string",
  "description": "string",
  "contentHtml": {},
  "employee": {
    "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",
    "tenantId": "string",
    "organizationId": "string",
    "short_description": "string",
    "description": "string",
    "startedWorkOn": "2024-01-15T09:30:00Z",
    "endWork": "2024-01-15T09:30:00Z",
    "payPeriod": "WEEKLY",
    "billRateValue": 0,
    "minimumBillingRate": 0,
    "billRateCurrency": "USD",
    "reWeeklyLimit": 0,
    "offerDate": "2024-01-15T09:30:00Z",
    "acceptDate": "2024-01-15T09:30:00Z",
    "rejectDate": "2024-01-15T09:30:00Z",
    "employeeLevel": "string",
    "anonymousBonus": true,
    "averageIncome": 0,
    "averageBonus": 0,
    "totalWorkHours": 0,
    "averageExpenses": 0,
    "show_anonymous_bonus": true,
    "show_average_bonus": true,
    "show_average_expenses": true,
    "show_average_income": true,
    "show_billrate": true,
    "show_payperiod": true,
    "show_start_work_on": true,
    "isJobSearchActive": true,
    "linkedInUrl": "string",
    "facebookUrl": "string",
    "instagramUrl": "string",
    "twitterUrl": "string",
    "githubUrl": "string",
    "gitlabUrl": "string",
    "upworkUrl": "string",
    "stackoverflowUrl": "string",
    "isVerified": true,
    "isVetted": true,
    "totalJobs": 0,
    "jobSuccess": 0,
    "profile_link": "string",
    "isTrackingEnabled": true,
    "isOnline": true,
    "isAway": false,
    "isTrackingTime": true,
    "allowScreenshotCapture": true,
    "allowManualTime": true,
    "allowModifyTime": true,
    "allowDeleteTime": true,
    "allowAgentAppExit": true,
    "allowLogoutFromAgentApp": true,
    "trackKeyboardMouseActivity": true,
    "trackAllDisplays": true,
    "upworkId": "string",
    "linkedInId": "string",
    "userId": "string",
    "contactId": "string",
    "organizationPositionId": "string"
  },
  "employeeId": "string"
}'''

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