# Unsubscribe from an entity

`DELETE /api/entity-subscription/{id}`

Removes a subscription based on its UUID and optional query filters.

Authentication (security requirement alternatives):

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

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

Parameters:

- `tenant` (query, object, optional)
  Type: object
  
  Schema: [Object](https://sourcey-gauzy.pages.dev/api-reference/models/object/index.md)

- `tenantId` (query, string, optional)
  Type: string

- `organization` (query, object, required)
  Type: object
  
  Schema: [Object](https://sourcey-gauzy.pages.dev/api-reference/models/object/index.md)

- `organizationId` (query, string, optional)
  Type: string

- `sentTo` (query, string, optional)
  Type: string

- `deletedAt` (query, string, date-time, optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `createdAt` (query, string, date-time, optional) - The creation timestamp of the entity.
  Type: string, date-time
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `updatedAt` (query, string, date-time, optional) - The last update timestamp of the entity.
  Type: string, date-time
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `id` (path, string, required) - The unique UUID of the subscription to be deleted.
  Type: string

- `isActive` (query, boolean, optional)
  Type: boolean
  
  default: true

- `isArchived` (query, boolean, optional)
  Type: boolean
  
  default: false

- `archivedAt` (query, string, date-time, optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `entity` (query, string, optional)
  Type: string
  
  enum: ["Broadcast","Candidate","Comment","Contact","Currency","DailyPlan","Dashboard","DashboardWidget","Document","Employee","Expense","Invoice","Income","Language","Organization","OrganizationContact","OrganizationDepartment","OrganizationDocument","OrganizationProject","OrganizationTeam","OrganizationProjectModule","OrganizationSprint","OrganizationVendor","ResourceLink","ScreeningTask","OrganizationStrategicInitiative","Task","TaskLinkedIssue","TaskView","User","Tenant"]

- `entityId` (query, string, optional)
  Type: string

- `actorType` (query, string, optional)
  Type: string
  
  enum: ["System","User"]

- `type` (query, string, optional)
  Type: string
  
  enum: ["manual","mention","assignment","comment","created-entity"]

- `employee` (query, object, optional)
  Type: object
  
  Schema: [Employee](https://sourcey-gauzy.pages.dev/api-reference/models/employee/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
  
  - `short_description` (optional)
    Type: string
    
    maxLength: 200
  
  - `description` (optional)
    Type: string
  
  - `startedWorkOn` (optional)
    Type: string, date-time
  
  - `endWork` (optional)
    Type: string, date-time
  
  - `payPeriod` (optional)
    Type: string
    
    enum: ["NONE","BI_WEEKLY","WEEKLY","TWICE_PER_MONTH","MONTHLY"]
    
    Example:
    
    ```json
    "WEEKLY"
    ```
  
  - `billRateValue` (optional)
    Type: number
  
  - `minimumBillingRate` (optional)
    Type: number
  
  - `billRateCurrency` (optional)
    Type: string
    
    enum: ["AFN","AFA","ALL","ALK","DZD","ADP","AOA","AOK","AON","AOR","ARA","ARS","ARM","ARP","ARL","AMD","AWG","AUD","ATS","AZN","AZM","BSD","BHD","BDT","BBD","BYN","BYB","BYR","BEF","BEC","BEL","BZD","BMD","BTN","BOB","BOL","BOV","BOP","BAM","BAD","BAN","BWP","BRC","BRZ","BRE","BRR","BRN","BRB","BRL","GBP","BND","BGL","BGN","BGO","BGM","BUK","BIF","XPF","KHR","CAD","CVE","KYD","XAF","CLE","CLP","CLF","CNX","CNY","COP","COU","KMF","CDF","CRC","HRD","HRK","CUC","CUP","CYP","CZK","CSK","DKK","DJF","DOP","NLG","XCD","DDM","ECS","ECV","EGP","GQE","ERN","EEK","ETB","EUR","XEU","FKP","FJD","FIM","FRF","XFO","XFU","GMD","GEK","GEL","DEM","GHS","GHC","GIP","GRD","GTQ","GWP","GNF","GNS","GYD","HTG","HNL","HKD","HUF","ISK","ISJ","INR","IDR","IRR","IQD","IEP","ILS","ILP","ILR","ITL","JMD","JPY","JOD","KZT","KES","KWD","KGS","LAK","LVL","LVR","LBP","LSL","LRD","LYD","LTL","LTT","LUL","LUC","LUF","MOP","MKD","MKN","MGA","MGF","MWK","MYR","MVR","MVP","MLF","MTL","MTP","MRO","MUR","MXV","MXN","MXP","MDC","MDL","MCF","MNT","MAD","MAF","MZE","MZN","MZM","MMK","NAD","NPR","ANG","TWD","NZD","NIO","NIC","NGN","KPW","NOK","OMR","PKR","PAB","PGK","PYG","PEI","PEN","PES","PHP","PLN","PLZ","PTE","GWE","QAR","XRE","RHD","RON","ROL","RUB","RUR","RWF","SVC","WST","SAR","RSD","CSD","SCR","SLL","SGD","SKK","SIT","SBD","SOS","ZAR","ZAL","KRH","KRW","KRO","SSP","SUR","ESP","ESA","ESB","LKR","SHP","SDD","SDG","SDP","SRD","SRG","SZL","SEK","CHF","SYP","STD","TJR","TJS","TZS","THB","TPE","TOP","TTD","TND","TRY","TRL","TMT","TMM","USD","USN","USS","UGX","UGS","UAH","UAK","AED","UYU","UYP","UYI","UZS","VUV","VEF","VEB","VND","VNN","CHE","CHW","XOF","YDD","YER","YUN","YUD","YUM","YUR","ZRN","ZRZ","ZMW","ZMK","ZWD","ZWR","ZWL"]
    
    Example:
    
    ```json
    "USD"
    ```
  
  - `reWeeklyLimit` (optional)
    Type: number
  
  - `offerDate` (optional)
    Type: string, date-time
  
  - `acceptDate` (optional)
    Type: string, date-time
  
  - `rejectDate` (optional)
    Type: string, date-time
  
  - `employeeLevel` (optional)
    Type: string
    
    maxLength: 500
  
  - `anonymousBonus` (optional)
    Type: boolean
  
  - `averageIncome` (required)
    Type: number
  
  - `averageBonus` (required)
    Type: number
  
  - `totalWorkHours` (required)
    Type: number
  
  - `averageExpenses` (required)
    Type: number
  
  - `show_anonymous_bonus` (optional)
    Type: boolean
  
  - `show_average_bonus` (optional)
    Type: boolean
  
  - `show_average_expenses` (optional)
    Type: boolean
  
  - `show_average_income` (optional)
    Type: boolean
  
  - `show_billrate` (optional)
    Type: boolean
  
  - `show_payperiod` (optional)
    Type: boolean
  
  - `show_start_work_on` (optional)
    Type: boolean
  
  - `isJobSearchActive` (optional)
    Type: boolean
  
  - `linkedInUrl` (optional)
    Type: string
  
  - `facebookUrl` (optional)
    Type: string
  
  - `instagramUrl` (optional)
    Type: string
  
  - `twitterUrl` (optional)
    Type: string
  
  - `githubUrl` (optional)
    Type: string
  
  - `gitlabUrl` (optional)
    Type: string
  
  - `upworkUrl` (optional)
    Type: string
  
  - `stackoverflowUrl` (optional)
    Type: string
  
  - `isVerified` (optional)
    Type: boolean
  
  - `isVetted` (optional)
    Type: boolean
  
  - `totalJobs` (required)
    Type: number
  
  - `jobSuccess` (required)
    Type: number
  
  - `profile_link` (optional)
    Type: string
  
  - `isTrackingEnabled` (optional)
    Type: boolean
  
  - `isOnline` (optional)
    Type: boolean
  
  - `isAway` (optional)
    Type: string
    
    default: false
  
  - `isTrackingTime` (optional)
    Type: boolean
  
  - `allowScreenshotCapture` (optional)
    Type: boolean
  
  - `allowManualTime` (optional)
    Type: boolean
  
  - `allowModifyTime` (optional)
    Type: boolean
  
  - `allowDeleteTime` (optional)
    Type: boolean
  
  - `allowAgentAppExit` (optional)
    Type: boolean
  
  - `allowLogoutFromAgentApp` (optional)
    Type: boolean
  
  - `trackKeyboardMouseActivity` (optional)
    Type: boolean
  
  - `trackAllDisplays` (optional)
    Type: boolean
  
  - `upworkId` (optional)
    Type: string
  
  - `linkedInId` (optional)
    Type: string
  
  - `userId` (required)
    Type: string
  
  - `contactId` (required)
    Type: string
  
  - `organizationPositionId` (required)
    Type: string

- `employeeId` (query, string, optional)
  Type: string

- `options` (query, object, required) - Optional filters to locate the subscription for unsubscribe.
  Type: object
  
  Schema: [EntitySubscriptionFindInputDTO](https://sourcey-gauzy.pages.dev/api-reference/models/entitysubscriptionfindinputdto/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"
    ```
  
  - `entity` (optional)
    Type: string
    
    enum: ["Broadcast","Candidate","Comment","Contact","Currency","DailyPlan","Dashboard","DashboardWidget","Document","Employee","Expense","Invoice","Income","Language","Organization","OrganizationContact","OrganizationDepartment","OrganizationDocument","OrganizationProject","OrganizationTeam","OrganizationProjectModule","OrganizationSprint","OrganizationVendor","ResourceLink","ScreeningTask","OrganizationStrategicInitiative","Task","TaskLinkedIssue","TaskView","User","Tenant"]
  
  - `entityId` (optional)
    Type: string
  
  - `actorType` (optional)
    Type: string
    
    enum: ["System","User"]
  
  - `type` (optional)
    Type: string
    
    enum: ["manual","mention","assignment","comment","created-entity"]
  
  - `employee` (optional)
    Reference: [Employee](https://sourcey-gauzy.pages.dev/api-reference/models/employee/index.md); Type: object
  
  - `employeeId` (optional)
    Type: string

Responses:

- 202: Unsubscribe request accepted.

- 401: Unauthorized

- 403: Forbidden

- 404: Subscription not found.

## Examples

### cURL

```bash
curl -X DELETE 'http://localhost:3000/api/entity-subscription/string?isActive=true&isArchived=false&tenant=%5Bobject%20Object%5D&tenantId=string&organization=%5Bobject%20Object%5D&organizationId=string&sentTo=string&deletedAt=2018-11-21T06%3A20%3A32.232Z&createdAt=2018-11-21T06%3A20%3A32.232Z&updatedAt=2018-11-21T06%3A20%3A32.232Z&id=string&isActive=true&isArchived=false&archivedAt=2018-11-21T06%3A20%3A32.232Z&entity=Broadcast&entityId=string&actorType=System&type=manual&employee=%5Bobject%20Object%5D&employeeId=string' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('http://localhost:3000/api/entity-subscription/string?isActive=true&isArchived=false&tenant=%5Bobject%20Object%5D&tenantId=string&organization=%5Bobject%20Object%5D&organizationId=string&sentTo=string&deletedAt=2018-11-21T06%3A20%3A32.232Z&createdAt=2018-11-21T06%3A20%3A32.232Z&updatedAt=2018-11-21T06%3A20%3A32.232Z&id=string&isActive=true&isArchived=false&archivedAt=2018-11-21T06%3A20%3A32.232Z&entity=Broadcast&entityId=string&actorType=System&type=manual&employee=%5Bobject%20Object%5D&employeeId=string', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

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

### Python

```python
import requests

response = requests.delete(
    'http://localhost:3000/api/entity-subscription/string?isActive=true&isArchived=false&tenant=%5Bobject%20Object%5D&tenantId=string&organization=%5Bobject%20Object%5D&organizationId=string&sentTo=string&deletedAt=2018-11-21T06%3A20%3A32.232Z&createdAt=2018-11-21T06%3A20%3A32.232Z&updatedAt=2018-11-21T06%3A20%3A32.232Z&id=string&isActive=true&isArchived=false&archivedAt=2018-11-21T06%3A20%3A32.232Z&entity=Broadcast&entityId=string&actorType=System&type=manual&employee=%5Bobject%20Object%5D&employeeId=string',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```
