> For the complete documentation index, see [llms.txt](https://teamleader-sdk.mcore-services.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://teamleader-sdk.mcore-services.dev/api-reference/tickets/ticket-status.md).

# Ticket Status

Manage ticket statuses in Teamleader Focus.

```php
Teamleader::ticketStatus()
```

|                          |                                                              |
| ------------------------ | ------------------------------------------------------------ |
| Class                    | `McoreServices\TeamleaderSDK\Resources\Tickets\TicketStatus` |
| Create / update / delete | — / — / —                                                    |
| Pagination               | No                                                           |

## Endpoints

* `ticketStatus.list`

## Filters

Passed as the first argument to `list()`. Any other key throws.

| Filter | Description                  |
| ------ | ---------------------------- |
| `ids`  | Array of ticket status UUIDs |

## Accepted values

Public constants on the class. Body fields and enum values outside these lists throw before the request is sent.

| Constant       | Values                                                                          |
| -------------- | ------------------------------------------------------------------------------- |
| `STATUS_TYPES` | `new`, `open`, `waiting_for_client`, `escalated_thirdparty`, `closed`, `custom` |

## Methods

### `list()`

```php
list(array $filters = [], array $options = []): array
```

List ticket statuses with optional filtering

* `$filters` — Filter parameters
* `$options` — Not used for ticket statuses

### `byIds()`

```php
byIds(array $ids): array
```

Get ticket statuses by specific IDs

* `$ids` — Array of ticket status UUIDs

### `findByType()`

```php
findByType(string $type): ?array
```

Find ticket statuses by type

* `$type` — Status type (new, open, waiting\_for\_client, escalated\_thirdparty, closed, custom)

### `customStatuses()`

```php
customStatuses(): ?array
```

Get all custom ticket statuses

### `asOptions()`

```php
asOptions(): array
```

Get statuses formatted as key-value pairs for dropdowns

### `allIds()`

```php
allIds(): array
```

Get all status IDs

### `findByLabel()`

```php
findByLabel(string $label): ?array
```

Find a status by its label (for custom statuses)

* `$label` — Status label to search for

### `isValidStatusType()`

```php
isValidStatusType(string $type): bool
```

Check if a status type is valid

### `getValidStatusTypes()`

```php
getValidStatusTypes(): array
```

Get all valid status types

### `getResponseStructure()`

```php
getResponseStructure(): array
```

Get response structure documentation

## Examples

Get all ticket statuses:

```php
$statuses = Teamleader::ticketStatus()->list();
```

Get specific ticket statuses by IDs:

```php
$statuses = Teamleader::ticketStatus()->byIds(['uuid1', 'uuid2']);
```

Find statuses by type:

```php
$openStatuses = Teamleader::ticketStatus()->findByType("open");
```

Get only custom statuses:

```php
$customStatuses = Teamleader::ticketStatus()->customStatuses();
```

Get statuses as key-value pairs for dropdowns:

```php
$options = Teamleader::ticketStatus()->asOptions();
```
