> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.voicecheap.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# プロジェクトの削除

> 翻訳プロジェクトを完全に削除します

# プロジェクトの削除

翻訳プロジェクトおよびそれに関連するアセットを完全に削除します。

このクリーンアップにより、プロジェクト用に生成された保存済みの音声クローニングプレビュー例ファイルも削除されます。

削除が完了する前に一部の内部生成ファイルやセグメントレコードが既に削除されていた場合、クリーンアップはベストエフォートモードで継続され、プロジェクトの削除を完了させます。

<Warning>
  この操作は元に戻せません。プロジェクト、作品、生成されたメディアアセット、および保存された音声プレビュー例ファイルが削除されます。
</Warning>

## リクエスト

### ヘッダー

<ParamField header="x-api-key" type="string" required>
  あなたのVoiceCheap APIキー。[app.voicecheap.ai/page-api](https://app.voicecheap.ai/page-api)から取得してください。
</ParamField>

### パスパラメータ

<ParamField path="projectId" type="string" required>
  削除する翻訳プロジェクトの一意の識別子。
</ParamField>

## レスポンス

<ResponseField name="success" type="boolean" required>
  削除操作が正常に完了したことを示します。
</ResponseField>

<ResponseField name="message" type="string" required>
  人間が読める形式の確認メッセージ。
</ResponseField>

<ResponseField name="projectId" type="string" required>
  削除されたプロジェクトのID。
</ResponseField>

## 例

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.voicecheap.ai/v1/translate/abc123-def456-ghi789" \
    -H "x-api-key: vc_your-api-key"
  ```

  ```typescript TypeScript theme={null}
  interface DeleteProjectResponse {
    success: true;
    message: string;
    projectId: string;
  }

  async function deleteProject(projectId: string): Promise<DeleteProjectResponse> {
    const response = await fetch(
      `https://api.voicecheap.ai/v1/translate/${projectId}`,
      {
        method: 'DELETE',
        headers: {
          'x-api-key': 'vc_your-api-key',
        },
      },
    );

    if (!response.ok) {
      const error = await response.json();
      throw new Error(error.message || 'Failed to delete project');
    }

    return response.json();
  }

  // Usage
  deleteProject('abc123-def456-ghi789')
    .then((result) => console.log('Deleted:', result.projectId))
    .catch((error) => console.error('Error:', error));
  ```

  ```python Python theme={null}
  import requests

  project_id = 'abc123-def456-ghi789'
  headers = {'x-api-key': 'vc_your-api-key'}

  response = requests.delete(
      f'https://api.voicecheap.ai/v1/translate/{project_id}',
      headers=headers
  )

  if not response.ok:
      error = response.json()
      raise Exception(error.get('message', 'Failed to delete project'))

  result = response.json()
  print(f"Deleted: {result['projectId']}")
  ```

  ```php PHP theme={null}
  <?php
  $apiKey = 'vc_your-api-key';
  $projectId = 'abc123-def456-ghi789';

  $curl = curl_init();

  curl_setopt_array($curl, [
      CURLOPT_URL => "https://api.voicecheap.ai/v1/translate/{$projectId}",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'DELETE',
      CURLOPT_HTTPHEADER => [
          "x-api-key: {$apiKey}"
      ]
  ]);

  $response = curl_exec($curl);
  $result = json_decode($response, true);

  if (!isset($result['success'])) {
      $message = $result['message'] ?? 'Failed to delete project';
      throw new Exception($message);
  }

  echo "Deleted: " . $result['projectId'];
  ```
</CodeGroup>

## エラー

| ステータス | コード                   | 説明                          |
| ----- | --------------------- | --------------------------- |
| 401   | `INVALID_API_KEY`     | 提供されたAPIキーは無効です             |
| 403   | `FORBIDDEN`           | このプロジェクトを削除する権限がありません       |
| 404   | `PROJECT_NOT_FOUND`   | 指定されたプロジェクトは存在しません          |
| 429   | `RATE_LIMIT_EXCEEDED` | リクエストが多すぎます（制限：1分間に10リクエスト） |
| 500   | `INTERNAL_ERROR`      | 予期しないサーバーエラー                |
