# Referință API: Asistență

Asistență: toate operațiunile API v1 cu scope, parametri, exemple în curl, JavaScript și Python și răspunsuri. Autentificarea, erorile, paginarea, limitele și idempotența sunt în [prezentarea referinței API](/docs/api-reference); vezi și [SDK-urile](/docs/sdks) și [linia de comandă](/docs/cli).

> Încearcă cu cheia ta: creează o cheie API în consolă, rulează `export APIDLY_API_KEY=...` în terminal, apoi lipește un exemplu curl de mai jos. Valorile din exemple sunt orientative. Pe această pagină nu există un câmp pentru introducerea unei chei.

Descrierile operațiilor și ale câmpurilor provin din definiția API-ului și sunt în engleză.

| Operațiune | Scope necesar | Rezumat |
| --- | --- | --- |
| `GET /support/tickets` | `read` | Tichetele de asistență ale organizației, cea mai recentă activitate prima |
| `POST /support/tickets` | `servers` | Deschide un tichet de asistență |
| `GET /support/tickets/{id}` | `read` | Un tichet cu mesajele lui, cele mai vechi primele |
| `POST /support/tickets/{id}/messages` | `servers` | Răspunde la un tichet |
| `POST /support/tickets/{id}/close` | `servers` | Închide un tichet |

### GET /support/tickets

Tichetele de asistență ale organizației, cea mai recentă activitate prima

**Scope necesar:** `read`

**Parametri**

| Nume | În | Tip | Obligatoriu | Descriere |
| --- | --- | --- | --- | --- |
| `limit` | query | integer | nu |  |
| `cursor` | query | string | nu |  |
| `status` | query | `open` \| `pending` \| `closed` | nu |  |

**Exemplu de cerere (curl)**

```bash
curl "https://apidly.com/api/v1/support/tickets?limit=20" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.support.listTickets({ limit: 20 });
```

**Python (SDK)**

```python
client.support.list_tickets()
```

**Instrument de linie de comandă:** `apidly support` ([Referință CLI](/docs/cli))

**Exemplu de răspuns** (200)

```json
{
  "tickets": [
    {
      "id": "example",
      "subject": "example",
      "category": "example",
      "status": "open",
      "priority": "example",
      "openedBy": "example",
      "createdAt": "2026-11-21T10:00:00.000Z",
      "updatedAt": "2026-11-21T10:00:00.000Z"
    }
  ],
  "nextCursor": "example"
}
```

Stări de eroare: `400`, `401`, `403`, `429`.

### POST /support/tickets

Deschide un tichet de asistență

Staff answer by e-mail and in the console. `priority` is `low`, `normal` or `high`. `serverId` is added to the text as the related server.

**Scope necesar:** `servers`

**Corpul cererii**

| Nume | Tip | Obligatoriu | Descriere |
| --- | --- | --- | --- |
| `subject` | string | da |  |
| `category` | string | nu |  |
| `priority` | `low` \| `normal` \| `high` | nu |  |
| `message` | string | da |  |
| `serverId` | string | nu |  |

**Exemplu de cerere (curl)**

```bash
curl -X POST "https://apidly.com/api/v1/support/tickets" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"subject":"example","message":"example"}'
```

**JavaScript (SDK)**

```js
await apidly.support.createTicket({
  subject: "example",
  message: "example"
});
```

**Python (SDK)**

```python
client.support.create_ticket(subject="example", message="example")
```

**Instrument de linie de comandă:** `apidly support` ([Referință CLI](/docs/cli))

**Exemplu de răspuns** (201)

```json
{
  "ticket": {
    "id": "example",
    "subject": "example",
    "category": "example",
    "status": "open",
    "priority": "example",
    "openedBy": "example",
    "createdAt": "2026-11-21T10:00:00.000Z",
    "updatedAt": "2026-11-21T10:00:00.000Z"
  }
}
```

Stări de eroare: `400`, `401`, `403`, `429`.

### GET /support/tickets/{id}

Un tichet cu mesajele lui, cele mai vechi primele

**Scope necesar:** `read`

**Parametri**

| Nume | În | Tip | Obligatoriu | Descriere |
| --- | --- | --- | --- | --- |
| `id` | path | string | da |  |

**Exemplu de cerere (curl)**

```bash
curl "https://apidly.com/api/v1/support/tickets/support_example" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.support.getTicket("support_example");
```

**Python (SDK)**

```python
client.support.get_ticket("support_example")
```

**Instrument de linie de comandă:** `apidly support` ([Referință CLI](/docs/cli))

**Exemplu de răspuns** (200)

```json
{
  "ticket": {
    "key": null
  }
}
```

Stări de eroare: `401`, `403`, `404`, `429`.

### POST /support/tickets/{id}/messages

Răspunde la un tichet

Reopens the ticket. 409 `ticket_closed` on a closed ticket.

**Scope necesar:** `servers`

**Parametri**

| Nume | În | Tip | Obligatoriu | Descriere |
| --- | --- | --- | --- | --- |
| `id` | path | string | da |  |

**Corpul cererii**

| Nume | Tip | Obligatoriu | Descriere |
| --- | --- | --- | --- |
| `message` | string | da |  |

**Exemplu de cerere (curl)**

```bash
curl -X POST "https://apidly.com/api/v1/support/tickets/support_example/messages" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message":"example"}'
```

**JavaScript (SDK)**

```js
await apidly.support.reply("support_example", "example");
```

**Python (SDK)**

```python
client.support.reply("support_example", message="example")
```

**Instrument de linie de comandă:** `apidly support` ([Referință CLI](/docs/cli))

**Exemplu de răspuns** (201)

```json
{
  "message": {
    "key": null
  }
}
```

Stări de eroare: `400`, `401`, `403`, `404`, `409`, `429`.

### POST /support/tickets/{id}/close

Închide un tichet

**Scope necesar:** `servers`

**Parametri**

| Nume | În | Tip | Obligatoriu | Descriere |
| --- | --- | --- | --- | --- |
| `id` | path | string | da |  |

**Exemplu de cerere (curl)**

```bash
curl -X POST "https://apidly.com/api/v1/support/tickets/support_example/close" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.support.close("support_example");
```

**Python (SDK)**

```python
client.support.close("support_example")
```

**Instrument de linie de comandă:** `apidly support` ([Referință CLI](/docs/cli))

**Exemplu de răspuns** (200)

```json
{
  "ok": false
}
```

Stări de eroare: `401`, `403`, `404`, `429`.
