# Create a new Equipment Sharing Policy record

`POST /api/equipment-sharing-policy`

Authentication (security requirement alternatives):

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

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

Request body: application/json (required)

Type: object

Schema: [UpdateOrCreateEquipmentSharingPolicyDTO](https://sourcey-gauzy.pages.dev/api-reference/models/updateorcreateequipmentsharingpolicydto/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"
  ```

- `name` (required)
  Type: string

- `description` (optional)
  Type: string

- `tenant` (optional)
  Type: object

- `tenantId` (optional)
  Type: string

- `organization` (required)
  Type: object

- `organizationId` (required)
  Type: string

- `sentTo` (optional)
  Type: string

Responses:

- 201: The Equipment Sharing Policy has been successfully created.

Content type: application/json

Type: object

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

- `name` (required)
  Type: string

- `description` (optional)
  Type: string

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

- 401: Unauthorized

- 403: Forbidden

## Examples

### cURL

```bash
curl -X POST 'http://localhost:3000/api/equipment-sharing-policy' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "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",
  "description": "string",
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string"
}'
```

### JavaScript

```javascript
const body = `{
  "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",
  "description": "string",
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string"
}`;

const response = await fetch('http://localhost:3000/api/equipment-sharing-policy', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

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

### Python

```python
import requests

body = '''{
  "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",
  "description": "string",
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string"
}'''

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