# API リファレンス: サポート

サポート: API v1 のすべての操作について、必要なスコープ、パラメーター、curl・JavaScript・Python の例、レスポンスを掲載します。認証、エラー、ページ分割、レート制限、冪等性は [API リファレンスの概要](/docs/api-reference)を参照してください。[SDK](/docs/sdks) と[コマンドラインツール](/docs/cli)もご覧ください。

> 自分のキーで試す: コンソールで API キーを作成し、ターミナルで `export APIDLY_API_KEY=...` を実行してから、下の curl の例を貼り付けてください。例の値は説明用です。このページにキーを入力する欄はありません。

操作とフィールドの説明は API 定義から取っており、英語のままです。

| 操作 | 必要なスコープ | 概要 |
| --- | --- | --- |
| `GET /support/tickets` | `read` | 組織のサポートチケット (最新の更新順) |
| `POST /support/tickets` | `servers` | サポートチケットを作成 |
| `GET /support/tickets/{id}` | `read` | メッセージを含む 1 件のチケット (古い順) |
| `POST /support/tickets/{id}/messages` | `servers` | チケットに返信 |
| `POST /support/tickets/{id}/close` | `servers` | チケットをクローズ |

### GET /support/tickets

組織のサポートチケット (最新の更新順)

**必要なスコープ:** `read`

**パラメーター**

| 名前 | 場所 | 型 | 必須 | 説明 |
| --- | --- | --- | --- | --- |
| `limit` | query | integer | いいえ |  |
| `cursor` | query | string | いいえ |  |
| `status` | query | `open` \| `pending` \| `closed` | いいえ |  |

**リクエスト例 (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()
```

**コマンドラインツール:** `apidly support` ([CLI リファレンス](/docs/cli))

**レスポンス例** (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"
}
```

エラーステータス: `400`, `401`, `403`, `429`.

### POST /support/tickets

サポートチケットを作成

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.

**必要なスコープ:** `servers`

**リクエストボディ**

| 名前 | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `subject` | string | はい |  |
| `category` | string | いいえ |  |
| `priority` | `low` \| `normal` \| `high` | いいえ |  |
| `message` | string | はい |  |
| `serverId` | string | いいえ |  |

**リクエスト例 (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")
```

**コマンドラインツール:** `apidly support` ([CLI リファレンス](/docs/cli))

**レスポンス例** (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"
  }
}
```

エラーステータス: `400`, `401`, `403`, `429`.

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

メッセージを含む 1 件のチケット (古い順)

**必要なスコープ:** `read`

**パラメーター**

| 名前 | 場所 | 型 | 必須 | 説明 |
| --- | --- | --- | --- | --- |
| `id` | path | string | はい |  |

**リクエスト例 (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")
```

**コマンドラインツール:** `apidly support` ([CLI リファレンス](/docs/cli))

**レスポンス例** (200)

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

エラーステータス: `401`, `403`, `404`, `429`.

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

チケットに返信

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

**必要なスコープ:** `servers`

**パラメーター**

| 名前 | 場所 | 型 | 必須 | 説明 |
| --- | --- | --- | --- | --- |
| `id` | path | string | はい |  |

**リクエストボディ**

| 名前 | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `message` | string | はい |  |

**リクエスト例 (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")
```

**コマンドラインツール:** `apidly support` ([CLI リファレンス](/docs/cli))

**レスポンス例** (201)

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

エラーステータス: `400`, `401`, `403`, `404`, `409`, `429`.

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

チケットをクローズ

**必要なスコープ:** `servers`

**パラメーター**

| 名前 | 場所 | 型 | 必須 | 説明 |
| --- | --- | --- | --- | --- |
| `id` | path | string | はい |  |

**リクエスト例 (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")
```

**コマンドラインツール:** `apidly support` ([CLI リファレンス](/docs/cli))

**レスポンス例** (200)

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

エラーステータス: `401`, `403`, `404`, `429`.
