# Retrieve subscriptions with filtering and pagination

`GET /api/entity-subscription`

Fetches all subscriptions with optional filtering by type, supporting pagination parameters.

Authentication (security requirement alternatives):

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

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

Parameters:

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

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

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

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

- `withDeleted` (query, boolean, optional)
  Type: boolean

- `take` (query, number, optional)
  Type: number
  
  minimum: 0
  
  maximum: 100

- `skip` (query, number, optional)
  Type: number
  
  minimum: 0

- `params` (query, object, required) - Pagination and filter parameters for subscriptions
  Type: object
  
  - `select` (optional)
    Type: object
  
  - `relations` (optional)
    Type: object
  
  - `where` (required)
    Type: object
  
  - `order` (optional)
    Type: object
  
  - `withDeleted` (optional)
    Type: boolean
  
  - `take` (optional)
    Type: number
    
    minimum: 0
    
    maximum: 100
  
  - `skip` (optional)
    Type: number
    
    minimum: 0

Responses:

- 200: Found subscriptions

Content type: application/json

Type: object

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

- `entity` (required)
  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` (required)
  Type: string

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

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

- 401: Unauthorized

- 403: Forbidden

- 404: No subscriptions found

## Examples

### cURL

```bash
curl -X GET 'http://localhost:3000/api/entity-subscription?select=%5Bobject%20Object%5D&relations=%5Bobject%20Object%5D&where=%5Bobject%20Object%5D&order=%5Bobject%20Object%5D&withDeleted=true&take=0&skip=0' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('http://localhost:3000/api/entity-subscription?select=%5Bobject%20Object%5D&relations=%5Bobject%20Object%5D&where=%5Bobject%20Object%5D&order=%5Bobject%20Object%5D&withDeleted=true&take=0&skip=0', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

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

### Python

```python
import requests

response = requests.get(
    'http://localhost:3000/api/entity-subscription?select=%5Bobject%20Object%5D&relations=%5Bobject%20Object%5D&where=%5Bobject%20Object%5D&order=%5Bobject%20Object%5D&withDeleted=true&take=0&skip=0',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```
