> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/api/api-doc-ja/api-reference/ji-neng.md).

# スキル

### スキルのアップロード <a href="#undefined" id="undefined"></a>

POST `/api/skills/upload/`

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X POST "https://api.maiagent.ai/api/skills/upload/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -F "file=@example_file.pdf" \
  -F "attached_tool_ids=サンプル文字列"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');
const FormData = require('form-data');

// FormData オブジェクトを作成
const formData = new FormData();
// 実際のファイルに置き換えてください
formData.append('file', /* 実際のファイルオブジェクト */, 'example_file.pdf');
formData.append('attached_tool_ids', 'サンプル文字列');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    ...formData.getHeaders()
  }
};

axios.post("https://api.maiagent.ai/api/skills/upload/", formData, config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/skills/upload/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}

# ファイルとフォームデータを作成
files = {
    'file': ('example_file.pdf', open('example_file.pdf', 'rb'), 'application/pdf'),
    'attached_tool_ids': (None, 'サンプル文字列')
}

response = requests.post(url, files=files, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->post("https://api.maiagent.ai/api/skills/upload/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ],
        'multipart' => [
            [
                'name' => 'file',
                'contents' => fopen('example_file.pdf', 'r'),
                'filename' => 'example_file.pdf'
            ],
            [
                'name' => 'attached_tool_ids',
                'contents' => 'サンプル文字列'
            ]
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 201**

**レスポンス構造の例**

```typescript
{
  "id"?: string (uuid) // 任意
  "name"?: string // 任意
  "description"?: string // 任意
  "message"?: string // 任意
}
```

**レスポンスのサンプル値**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "description": "レスポンス文字列",
  "message": "レスポンス文字列"
}
```

**ステータスコード: 400**

**レスポンス構造の例**

```typescript
{
  "detail"?: string // エラーメッセージ (任意)
}
```

**レスポンスのサンプル値**

```json
{
  "detail": "レスポンス文字列"
}
```

***

### スキルのアップロード <a href="#undefined" id="undefined"></a>

POST `/api/v1/skills/upload/`

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/skills/upload/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -F "file=@example_file.pdf" \
  -F "attached_tool_ids=サンプル文字列"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');
const FormData = require('form-data');

// FormData オブジェクトを作成
const formData = new FormData();
// 実際のファイルに置き換えてください
formData.append('file', /* 実際のファイルオブジェクト */, 'example_file.pdf');
formData.append('attached_tool_ids', 'サンプル文字列');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    ...formData.getHeaders()
  }
};

axios.post("https://api.maiagent.ai/api/v1/skills/upload/", formData, config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/skills/upload/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}

# ファイルとフォームデータを作成
files = {
    'file': ('example_file.pdf', open('example_file.pdf', 'rb'), 'application/pdf'),
    'attached_tool_ids': (None, 'サンプル文字列')
}

response = requests.post(url, files=files, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->post("https://api.maiagent.ai/api/v1/skills/upload/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ],
        'multipart' => [
            [
                'name' => 'file',
                'contents' => fopen('example_file.pdf', 'r'),
                'filename' => 'example_file.pdf'
            ],
            [
                'name' => 'attached_tool_ids',
                'contents' => 'サンプル文字列'
            ]
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 201**

**レスポンス構造の例**

```typescript
{
  "id"?: string (uuid) // 任意
  "name"?: string // 任意
  "description"?: string // 任意
  "message"?: string // 任意
}
```

**レスポンスのサンプル値**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "description": "レスポンス文字列",
  "message": "レスポンス文字列"
}
```

**ステータスコード: 400**

**レスポンス構造の例**

```typescript
{
  "detail"?: string // エラーメッセージ (任意)
}
```

**レスポンスのサンプル値**

```json
{
  "detail": "レスポンス文字列"
}
```

***

### スキルの一覧取得 <a href="#undefined" id="undefined"></a>

GET `/api/skills/`

#### パラメータ

| パラメータ名     | 必須 | 型       | 説明                                             |
| ---------- | -- | ------- | ---------------------------------------------- |
| `page`     | ❌  | integer | A page number within the paginated result set. |
| `pageSize` | ❌  | integer | Number of results to return per page.          |
| `search`   | ❌  | string  |                                                |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/skills/?page=1&pageSize=1&search=example" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/skills/?page=1&pageSize=1&search=example", config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/skills/?page=1&pageSize=1&search=example"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/skills/?page=1&pageSize=1&search=example", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "count": integer
  "next"?: string (uri) // 任意
  "previous"?: string (uri) // 任意
  "results": [
    {
      "id": string (uuid)
      "name": string
      "description": string
      "source":  // How the skill was created: upload (.skill/.zip) or manual

* `upload` - Upload
* `manual` - Manual
      {
      }
      "attachedTools": [
        {
          "id": string (uuid)
          "name": string
          "description": string
          "displayName": string
          "toolType": string
        }
      ]
      "resources": [ // Get list of resource filenames
        string
      ]
      "createdAt": string (timestamp)
      "updatedAt": string (timestamp)
      "lastUsedAt": string (timestamp)
    }
  ]
}
```

**レスポンスのサンプル値**

```json
{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス文字列",
      "description": "レスポンス文字列",
      "source": {},
      "attachedTools": [
        {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "name": "レスポンス文字列",
          "description": "レスポンス文字列",
          "displayName": "レスポンス文字列",
          "toolType": "レスポンス文字列"
        }
      ],
      "resources": [
        "レスポンス文字列"
      ],
      "createdAt": "レスポンス文字列",
      "updatedAt": "レスポンス文字列",
      "lastUsedAt": "レスポンス文字列"
    }
  ]
}
```

***

### スキルの一覧取得 <a href="#undefined" id="undefined"></a>

GET `/api/v1/skills/`

#### パラメータ

| パラメータ名     | 必須 | 型       | 説明                                             |
| ---------- | -- | ------- | ---------------------------------------------- |
| `page`     | ❌  | integer | A page number within the paginated result set. |
| `pageSize` | ❌  | integer | Number of results to return per page.          |
| `search`   | ❌  | string  |                                                |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/skills/?page=1&pageSize=1&search=example" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/skills/?page=1&pageSize=1&search=example", config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/skills/?page=1&pageSize=1&search=example"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/skills/?page=1&pageSize=1&search=example", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "count": integer
  "next"?: string (uri) // 任意
  "previous"?: string (uri) // 任意
  "results": [
    {
      "id": string (uuid)
      "name": string
      "description": string
      "source":  // How the skill was created: upload (.skill/.zip) or manual

* `upload` - Upload
* `manual` - Manual
      {
      }
      "attachedTools": [
        {
          "id": string (uuid)
          "name": string
          "description": string
          "displayName": string
          "toolType": string
        }
      ]
      "resources": [ // Get list of resource filenames
        string
      ]
      "createdAt": string (timestamp)
      "updatedAt": string (timestamp)
      "lastUsedAt": string (timestamp)
    }
  ]
}
```

**レスポンスのサンプル値**

```json
{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス文字列",
      "description": "レスポンス文字列",
      "source": {},
      "attachedTools": [
        {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "name": "レスポンス文字列",
          "description": "レスポンス文字列",
          "displayName": "レスポンス文字列",
          "toolType": "レスポンス文字列"
        }
      ],
      "resources": [
        "レスポンス文字列"
      ],
      "createdAt": "レスポンス文字列",
      "updatedAt": "レスポンス文字列",
      "lastUsedAt": "レスポンス文字列"
    }
  ]
}
```

***

### 特定スキルの取得 <a href="#undefined" id="undefined"></a>

GET `/api/skills/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                    |
| ------ | -- | ------ | ------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this Skill. |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/", config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "id": string (uuid)
  "name": string
  "description": string
  "instructions": string // Markdown text with instructions for the skill
  "source":  // How the skill was created: upload (.skill/.zip) or manual

* `upload` - Upload
* `manual` - Manual
  {
  }
  "skillPackagePath": string // S3 path for the uploaded .skill/.zip file
  "skillPackageName": string // Original filename of the uploaded skill package
  "skillPackageSize": integer // Size of the uploaded skill package in bytes
  "skillPackageUploadedAt": string (timestamp)
  "attachedTools": [
    {
      "id": string (uuid)
      "name": string
      "description": string
      "displayName": string
      "toolType": string
    }
  ]
  "resources": [
    {
      "id": string (uuid)
      "filename": string
      "filePath": string // S3 path: skills/{organization_id}/{skill_id}/resources/
      "fileSize": integer // File size in bytes
      "mimeType": string
      "createdAt": string (timestamp)
    }
  ]
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
  "lastUsedAt": string (timestamp)
}
```

**レスポンスのサンプル値**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "description": "レスポンス文字列",
  "instructions": "レスポンス文字列",
  "source": {},
  "skillPackagePath": "レスポンス文字列",
  "skillPackageName": "レスポンス文字列",
  "skillPackageSize": 456,
  "skillPackageUploadedAt": "レスポンス文字列",
  "attachedTools": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス文字列",
      "description": "レスポンス文字列",
      "displayName": "レスポンス文字列",
      "toolType": "レスポンス文字列"
    }
  ],
  "resources": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "filename": "レスポンス文字列",
      "filePath": "レスポンス文字列",
      "fileSize": 456,
      "mimeType": "レスポンス文字列",
      "createdAt": "レスポンス文字列"
    }
  ],
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列",
  "lastUsedAt": "レスポンス文字列"
}
```

***

### 特定スキルの取得 <a href="#undefined" id="undefined"></a>

GET `/api/v1/skills/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                    |
| ------ | -- | ------ | ------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this Skill. |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/", config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "id": string (uuid)
  "name": string
  "description": string
  "instructions": string // Markdown text with instructions for the skill
  "source":  // How the skill was created: upload (.skill/.zip) or manual

* `upload` - Upload
* `manual` - Manual
  {
  }
  "skillPackagePath": string // S3 path for the uploaded .skill/.zip file
  "skillPackageName": string // Original filename of the uploaded skill package
  "skillPackageSize": integer // Size of the uploaded skill package in bytes
  "skillPackageUploadedAt": string (timestamp)
  "attachedTools": [
    {
      "id": string (uuid)
      "name": string
      "description": string
      "displayName": string
      "toolType": string
    }
  ]
  "resources": [
    {
      "id": string (uuid)
      "filename": string
      "filePath": string // S3 path: skills/{organization_id}/{skill_id}/resources/
      "fileSize": integer // File size in bytes
      "mimeType": string
      "createdAt": string (timestamp)
    }
  ]
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
  "lastUsedAt": string (timestamp)
}
```

**レスポンスのサンプル値**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "description": "レスポンス文字列",
  "instructions": "レスポンス文字列",
  "source": {},
  "skillPackagePath": "レスポンス文字列",
  "skillPackageName": "レスポンス文字列",
  "skillPackageSize": 456,
  "skillPackageUploadedAt": "レスポンス文字列",
  "attachedTools": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス文字列",
      "description": "レスポンス文字列",
      "displayName": "レスポンス文字列",
      "toolType": "レスポンス文字列"
    }
  ],
  "resources": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "filename": "レスポンス文字列",
      "filePath": "レスポンス文字列",
      "fileSize": 456,
      "mimeType": "レスポンス文字列",
      "createdAt": "レスポンス文字列"
    }
  ],
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列",
  "lastUsedAt": "レスポンス文字列"
}
```

***

### スキルの更新 <a href="#undefined" id="undefined"></a>

PUT `/api/skills/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                    |
| ------ | -- | ------ | ------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this Skill. |

#### リクエスト内容

**リクエストパラメータ**

| フィールド           | 型              | 必須  | 説明                                            |
| --------------- | -------------- | --- | --------------------------------------------- |
| name            | string         | はい  |                                               |
| description     | string         | はい  |                                               |
| instructions    | string         | いいえ | Markdown text with instructions for the skill |
| attachedToolIds | array\[string] | いいえ |                                               |

**リクエスト構造の例**

```typescript
{
  "name": string
  "description": string
  "instructions"?: string // Markdown text with instructions for the skill (任意)
  "attachedToolIds"?: [ // 任意
    string (uuid)
  ]
}
```

**リクエストのサンプル値**

```json
{
  "name": "サンプル名",
  "description": "サンプル文字列",
  "instructions": "サンプル文字列",
  "attachedToolIds": [
    "550e8400-e29b-41d4-a716-446655440000"
  ]
}
```

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X PUT "https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "サンプル名",
    "description": "サンプル文字列",
    "instructions": "サンプル文字列",
    "attachedToolIds": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  }'

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエスト内容 (payload)
const data = {
    "name": "サンプル名",
    "description": "サンプル文字列",
    "instructions": "サンプル文字列",
    "attachedToolIds": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  };

axios.put("https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/", data, config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエスト内容 (payload)
data = {
      "name": "サンプル名",
      "description": "サンプル文字列",
      "instructions": "サンプル文字列",
      "attachedToolIds": [
        "550e8400-e29b-41d4-a716-446655440000"
      ]
    }

response = requests.put(url, json=data, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->put("https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => {
            "name": "サンプル名",
            "description": "サンプル文字列",
            "instructions": "サンプル文字列",
            "attachedToolIds": [
                "550e8400-e29b-41d4-a716-446655440000"
            ]
        }
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "id": string (uuid)
  "name": string
  "description": string
  "instructions": string // Markdown text with instructions for the skill
  "source":  // How the skill was created: upload (.skill/.zip) or manual

* `upload` - Upload
* `manual` - Manual
  {
  }
  "skillPackagePath": string // S3 path for the uploaded .skill/.zip file
  "skillPackageName": string // Original filename of the uploaded skill package
  "skillPackageSize": integer // Size of the uploaded skill package in bytes
  "skillPackageUploadedAt": string (timestamp)
  "attachedTools": [
    {
      "id": string (uuid)
      "name": string
      "description": string
      "displayName": string
      "toolType": string
    }
  ]
  "resources": [
    {
      "id": string (uuid)
      "filename": string
      "filePath": string // S3 path: skills/{organization_id}/{skill_id}/resources/
      "fileSize": integer // File size in bytes
      "mimeType": string
      "createdAt": string (timestamp)
    }
  ]
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
  "lastUsedAt": string (timestamp)
}
```

**レスポンスのサンプル値**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "description": "レスポンス文字列",
  "instructions": "レスポンス文字列",
  "source": {},
  "skillPackagePath": "レスポンス文字列",
  "skillPackageName": "レスポンス文字列",
  "skillPackageSize": 456,
  "skillPackageUploadedAt": "レスポンス文字列",
  "attachedTools": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス文字列",
      "description": "レスポンス文字列",
      "displayName": "レスポンス文字列",
      "toolType": "レスポンス文字列"
    }
  ],
  "resources": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "filename": "レスポンス文字列",
      "filePath": "レスポンス文字列",
      "fileSize": 456,
      "mimeType": "レスポンス文字列",
      "createdAt": "レスポンス文字列"
    }
  ],
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列",
  "lastUsedAt": "レスポンス文字列"
}
```

***

### スキルの更新 <a href="#undefined" id="undefined"></a>

PUT `/api/v1/skills/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                    |
| ------ | -- | ------ | ------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this Skill. |

#### リクエスト内容

**リクエストパラメータ**

| フィールド           | 型              | 必須  | 説明                                            |
| --------------- | -------------- | --- | --------------------------------------------- |
| name            | string         | はい  |                                               |
| description     | string         | はい  |                                               |
| instructions    | string         | いいえ | Markdown text with instructions for the skill |
| attachedToolIds | array\[string] | いいえ |                                               |

**リクエスト構造の例**

```typescript
{
  "name": string
  "description": string
  "instructions"?: string // Markdown text with instructions for the skill (任意)
  "attachedToolIds"?: [ // 任意
    string (uuid)
  ]
}
```

**リクエストのサンプル値**

```json
{
  "name": "サンプル名",
  "description": "サンプル文字列",
  "instructions": "サンプル文字列",
  "attachedToolIds": [
    "550e8400-e29b-41d4-a716-446655440000"
  ]
}
```

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X PUT "https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "サンプル名",
    "description": "サンプル文字列",
    "instructions": "サンプル文字列",
    "attachedToolIds": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  }'

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエスト内容 (payload)
const data = {
    "name": "サンプル名",
    "description": "サンプル文字列",
    "instructions": "サンプル文字列",
    "attachedToolIds": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  };

axios.put("https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/", data, config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエスト内容 (payload)
data = {
      "name": "サンプル名",
      "description": "サンプル文字列",
      "instructions": "サンプル文字列",
      "attachedToolIds": [
        "550e8400-e29b-41d4-a716-446655440000"
      ]
    }

response = requests.put(url, json=data, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->put("https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => {
            "name": "サンプル名",
            "description": "サンプル文字列",
            "instructions": "サンプル文字列",
            "attachedToolIds": [
                "550e8400-e29b-41d4-a716-446655440000"
            ]
        }
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "id": string (uuid)
  "name": string
  "description": string
  "instructions": string // Markdown text with instructions for the skill
  "source":  // How the skill was created: upload (.skill/.zip) or manual

* `upload` - Upload
* `manual` - Manual
  {
  }
  "skillPackagePath": string // S3 path for the uploaded .skill/.zip file
  "skillPackageName": string // Original filename of the uploaded skill package
  "skillPackageSize": integer // Size of the uploaded skill package in bytes
  "skillPackageUploadedAt": string (timestamp)
  "attachedTools": [
    {
      "id": string (uuid)
      "name": string
      "description": string
      "displayName": string
      "toolType": string
    }
  ]
  "resources": [
    {
      "id": string (uuid)
      "filename": string
      "filePath": string // S3 path: skills/{organization_id}/{skill_id}/resources/
      "fileSize": integer // File size in bytes
      "mimeType": string
      "createdAt": string (timestamp)
    }
  ]
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
  "lastUsedAt": string (timestamp)
}
```

**レスポンスのサンプル値**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "description": "レスポンス文字列",
  "instructions": "レスポンス文字列",
  "source": {},
  "skillPackagePath": "レスポンス文字列",
  "skillPackageName": "レスポンス文字列",
  "skillPackageSize": 456,
  "skillPackageUploadedAt": "レスポンス文字列",
  "attachedTools": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス文字列",
      "description": "レスポンス文字列",
      "displayName": "レスポンス文字列",
      "toolType": "レスポンス文字列"
    }
  ],
  "resources": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "filename": "レスポンス文字列",
      "filePath": "レスポンス文字列",
      "fileSize": 456,
      "mimeType": "レスポンス文字列",
      "createdAt": "レスポンス文字列"
    }
  ],
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列",
  "lastUsedAt": "レスポンス文字列"
}
```

***

### スキルの部分更新 <a href="#undefined" id="undefined"></a>

PATCH `/api/skills/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                    |
| ------ | -- | ------ | ------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this Skill. |

#### リクエスト内容

**リクエストパラメータ**

| フィールド           | 型              | 必須  | 説明                                            |
| --------------- | -------------- | --- | --------------------------------------------- |
| name            | string         | いいえ |                                               |
| description     | string         | いいえ |                                               |
| instructions    | string         | いいえ | Markdown text with instructions for the skill |
| attachedToolIds | array\[string] | いいえ |                                               |

**リクエスト構造の例**

```typescript
{
  "name"?: string // 任意
  "description"?: string // 任意
  "instructions"?: string // Markdown text with instructions for the skill (任意)
  "attachedToolIds"?: [ // 任意
    string (uuid)
  ]
}
```

**リクエストのサンプル値**

```json
{
  "name": "サンプル名",
  "description": "サンプル文字列",
  "instructions": "サンプル文字列",
  "attachedToolIds": [
    "550e8400-e29b-41d4-a716-446655440000"
  ]
}
```

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X PATCH "https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "サンプル名",
    "description": "サンプル文字列",
    "instructions": "サンプル文字列",
    "attachedToolIds": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  }'

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエスト内容 (payload)
const data = {
    "name": "サンプル名",
    "description": "サンプル文字列",
    "instructions": "サンプル文字列",
    "attachedToolIds": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  };

axios.patch("https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/", data, config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエスト内容 (payload)
data = {
      "name": "サンプル名",
      "description": "サンプル文字列",
      "instructions": "サンプル文字列",
      "attachedToolIds": [
        "550e8400-e29b-41d4-a716-446655440000"
      ]
    }

response = requests.patch(url, json=data, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->patch("https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => {
            "name": "サンプル名",
            "description": "サンプル文字列",
            "instructions": "サンプル文字列",
            "attachedToolIds": [
                "550e8400-e29b-41d4-a716-446655440000"
            ]
        }
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "id": string (uuid)
  "name": string
  "description": string
  "instructions": string // Markdown text with instructions for the skill
  "source":  // How the skill was created: upload (.skill/.zip) or manual

* `upload` - Upload
* `manual` - Manual
  {
  }
  "skillPackagePath": string // S3 path for the uploaded .skill/.zip file
  "skillPackageName": string // Original filename of the uploaded skill package
  "skillPackageSize": integer // Size of the uploaded skill package in bytes
  "skillPackageUploadedAt": string (timestamp)
  "attachedTools": [
    {
      "id": string (uuid)
      "name": string
      "description": string
      "displayName": string
      "toolType": string
    }
  ]
  "resources": [
    {
      "id": string (uuid)
      "filename": string
      "filePath": string // S3 path: skills/{organization_id}/{skill_id}/resources/
      "fileSize": integer // File size in bytes
      "mimeType": string
      "createdAt": string (timestamp)
    }
  ]
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
  "lastUsedAt": string (timestamp)
}
```

**レスポンスのサンプル値**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "description": "レスポンス文字列",
  "instructions": "レスポンス文字列",
  "source": {},
  "skillPackagePath": "レスポンス文字列",
  "skillPackageName": "レスポンス文字列",
  "skillPackageSize": 456,
  "skillPackageUploadedAt": "レスポンス文字列",
  "attachedTools": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス文字列",
      "description": "レスポンス文字列",
      "displayName": "レスポンス文字列",
      "toolType": "レスポンス文字列"
    }
  ],
  "resources": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "filename": "レスポンス文字列",
      "filePath": "レスポンス文字列",
      "fileSize": 456,
      "mimeType": "レスポンス文字列",
      "createdAt": "レスポンス文字列"
    }
  ],
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列",
  "lastUsedAt": "レスポンス文字列"
}
```

***

### スキルの部分更新 <a href="#undefined" id="undefined"></a>

PATCH `/api/v1/skills/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                    |
| ------ | -- | ------ | ------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this Skill. |

#### リクエスト内容

**リクエストパラメータ**

| フィールド           | 型              | 必須  | 説明                                            |
| --------------- | -------------- | --- | --------------------------------------------- |
| name            | string         | いいえ |                                               |
| description     | string         | いいえ |                                               |
| instructions    | string         | いいえ | Markdown text with instructions for the skill |
| attachedToolIds | array\[string] | いいえ |                                               |

**リクエスト構造の例**

```typescript
{
  "name"?: string // 任意
  "description"?: string // 任意
  "instructions"?: string // Markdown text with instructions for the skill (任意)
  "attachedToolIds"?: [ // 任意
    string (uuid)
  ]
}
```

**リクエストのサンプル値**

```json
{
  "name": "サンプル名",
  "description": "サンプル文字列",
  "instructions": "サンプル文字列",
  "attachedToolIds": [
    "550e8400-e29b-41d4-a716-446655440000"
  ]
}
```

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X PATCH "https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "サンプル名",
    "description": "サンプル文字列",
    "instructions": "サンプル文字列",
    "attachedToolIds": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  }'

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエスト内容 (payload)
const data = {
    "name": "サンプル名",
    "description": "サンプル文字列",
    "instructions": "サンプル文字列",
    "attachedToolIds": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  };

axios.patch("https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/", data, config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエスト内容 (payload)
data = {
      "name": "サンプル名",
      "description": "サンプル文字列",
      "instructions": "サンプル文字列",
      "attachedToolIds": [
        "550e8400-e29b-41d4-a716-446655440000"
      ]
    }

response = requests.patch(url, json=data, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->patch("https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => {
            "name": "サンプル名",
            "description": "サンプル文字列",
            "instructions": "サンプル文字列",
            "attachedToolIds": [
                "550e8400-e29b-41d4-a716-446655440000"
            ]
        }
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "id": string (uuid)
  "name": string
  "description": string
  "instructions": string // Markdown text with instructions for the skill
  "source":  // How the skill was created: upload (.skill/.zip) or manual

* `upload` - Upload
* `manual` - Manual
  {
  }
  "skillPackagePath": string // S3 path for the uploaded .skill/.zip file
  "skillPackageName": string // Original filename of the uploaded skill package
  "skillPackageSize": integer // Size of the uploaded skill package in bytes
  "skillPackageUploadedAt": string (timestamp)
  "attachedTools": [
    {
      "id": string (uuid)
      "name": string
      "description": string
      "displayName": string
      "toolType": string
    }
  ]
  "resources": [
    {
      "id": string (uuid)
      "filename": string
      "filePath": string // S3 path: skills/{organization_id}/{skill_id}/resources/
      "fileSize": integer // File size in bytes
      "mimeType": string
      "createdAt": string (timestamp)
    }
  ]
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
  "lastUsedAt": string (timestamp)
}
```

**レスポンスのサンプル値**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "description": "レスポンス文字列",
  "instructions": "レスポンス文字列",
  "source": {},
  "skillPackagePath": "レスポンス文字列",
  "skillPackageName": "レスポンス文字列",
  "skillPackageSize": 456,
  "skillPackageUploadedAt": "レスポンス文字列",
  "attachedTools": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス文字列",
      "description": "レスポンス文字列",
      "displayName": "レスポンス文字列",
      "toolType": "レスポンス文字列"
    }
  ],
  "resources": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "filename": "レスポンス文字列",
      "filePath": "レスポンス文字列",
      "fileSize": 456,
      "mimeType": "レスポンス文字列",
      "createdAt": "レスポンス文字列"
    }
  ],
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列",
  "lastUsedAt": "レスポンス文字列"
}
```

***

### スキルの削除 <a href="#undefined" id="undefined"></a>

DELETE `/api/skills/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                    |
| ------ | -- | ------ | ------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this Skill. |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

// リクエスト内容 (payload)
const data = null;

axios.delete("https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/", data, config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.delete(url, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->delete("https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

| ステータスコード | 説明        |
| -------- | --------- |
| 204      | レスポンス本文なし |

***

### スキルの削除 <a href="#undefined" id="undefined"></a>

DELETE `/api/v1/skills/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                    |
| ------ | -- | ------ | ------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this Skill. |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

// リクエスト内容 (payload)
const data = null;

axios.delete("https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/", data, config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.delete(url, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->delete("https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

| ステータスコード | 説明        |
| -------- | --------- |
| 204      | レスポンス本文なし |

***

### スキルのエクスポート <a href="#undefined" id="undefined"></a>

GET `/api/skills/{id}/export/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                    |
| ------ | -- | ------ | ------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this Skill. |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/export/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/export/", config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/export/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/export/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

| ステータスコード | 説明                 |
| -------- | ------------------ |
| 200      | .skill ファイルのダウンロード |

***

### スキルのエクスポート <a href="#undefined" id="undefined"></a>

GET `/api/v1/skills/{id}/export/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                    |
| ------ | -- | ------ | ------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this Skill. |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/export/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/export/", config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/export/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/export/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

| ステータスコード | 説明                 |
| -------- | ------------------ |
| 200      | .skill ファイルのダウンロード |

***

### スキルの再アップロード <a href="#undefined" id="undefined"></a>

POST `/api/skills/{id}/reupload/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                    |
| ------ | -- | ------ | ------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this Skill. |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X POST "https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/reupload/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -F "file=@example_file.pdf"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');
const FormData = require('form-data');

// FormData オブジェクトを作成
const formData = new FormData();
// 実際のファイルに置き換えてください
formData.append('file', /* 実際のファイルオブジェクト */, 'example_file.pdf');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    ...formData.getHeaders()
  }
};

axios.post("https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/reupload/", formData, config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/reupload/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}

# ファイルとフォームデータを作成
files = {
    'file': ('example_file.pdf', open('example_file.pdf', 'rb'), 'application/pdf')
}

response = requests.post(url, files=files, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->post("https://api.maiagent.ai/api/skills/550e8400-e29b-41d4-a716-446655440000/reupload/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ],
        'multipart' => [
            [
                'name' => 'file',
                'contents' => fopen('example_file.pdf', 'r'),
                'filename' => 'example_file.pdf'
            ]
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "id"?: string (uuid) // 任意
  "name"?: string // 任意
  "description"?: string // 任意
  "message"?: string // 任意
}
```

**レスポンスのサンプル値**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "description": "レスポンス文字列",
  "message": "レスポンス文字列"
}
```

**ステータスコード: 400**

**レスポンス構造の例**

```typescript
{
  "detail"?: string // エラーメッセージ (任意)
}
```

**レスポンスのサンプル値**

```json
{
  "detail": "レスポンス文字列"
}
```

***

### スキルの再アップロード <a href="#undefined" id="undefined"></a>

POST `/api/v1/skills/{id}/reupload/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                    |
| ------ | -- | ------ | ------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this Skill. |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/reupload/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -F "file=@example_file.pdf"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');
const FormData = require('form-data');

// FormData オブジェクトを作成
const formData = new FormData();
// 実際のファイルに置き換えてください
formData.append('file', /* 実際のファイルオブジェクト */, 'example_file.pdf');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    ...formData.getHeaders()
  }
};

axios.post("https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/reupload/", formData, config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/reupload/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}

# ファイルとフォームデータを作成
files = {
    'file': ('example_file.pdf', open('example_file.pdf', 'rb'), 'application/pdf')
}

response = requests.post(url, files=files, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->post("https://api.maiagent.ai/api/v1/skills/550e8400-e29b-41d4-a716-446655440000/reupload/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ],
        'multipart' => [
            [
                'name' => 'file',
                'contents' => fopen('example_file.pdf', 'r'),
                'filename' => 'example_file.pdf'
            ]
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "id"?: string (uuid) // 任意
  "name"?: string // 任意
  "description"?: string // 任意
  "message"?: string // 任意
}
```

**レスポンスのサンプル値**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "description": "レスポンス文字列",
  "message": "レスポンス文字列"
}
```

**ステータスコード: 400**

**レスポンス構造の例**

```typescript
{
  "detail"?: string // エラーメッセージ (任意)
}
```

**レスポンスのサンプル値**

```json
{
  "detail": "レスポンス文字列"
}
```

***

### スキルリソースの一覧取得 <a href="#undefined" id="undefined"></a>

GET `/api/skills/{skillPk}/resources/`

#### パラメータ

| パラメータ名    | 必須 | 型      | 説明 |
| --------- | -- | ------ | -- |
| `skillPk` | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/skills/{skillPk}/resources/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/skills/{skillPk}/resources/", config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/skills/{skillPk}/resources/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/skills/{skillPk}/resources/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
[
  {
    "id": string (uuid)
    "filename": string
    "filePath": string // S3 path: skills/{organization_id}/{skill_id}/resources/
    "fileSize": integer // File size in bytes
    "mimeType": string
    "createdAt": string (timestamp)
  }
]
```

**レスポンスのサンプル値**

```json
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "filename": "レスポンス文字列",
    "filePath": "レスポンス文字列",
    "fileSize": 456,
    "mimeType": "レスポンス文字列",
    "createdAt": "レスポンス文字列"
  }
]
```

***

### スキルリソースの一覧取得 <a href="#undefined" id="undefined"></a>

GET `/api/v1/skills/{skillPk}/resources/`

#### パラメータ

| パラメータ名    | 必須 | 型      | 説明 |
| --------- | -- | ------ | -- |
| `skillPk` | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/skills/{skillPk}/resources/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/skills/{skillPk}/resources/", config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/skills/{skillPk}/resources/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/skills/{skillPk}/resources/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
[
  {
    "id": string (uuid)
    "filename": string
    "filePath": string // S3 path: skills/{organization_id}/{skill_id}/resources/
    "fileSize": integer // File size in bytes
    "mimeType": string
    "createdAt": string (timestamp)
  }
]
```

**レスポンスのサンプル値**

```json
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "filename": "レスポンス文字列",
    "filePath": "レスポンス文字列",
    "fileSize": 456,
    "mimeType": "レスポンス文字列",
    "createdAt": "レスポンス文字列"
  }
]
```

***

### スキルリソースの削除 <a href="#undefined" id="undefined"></a>

DELETE `/api/skills/{skillPk}/resources/{id}/`

#### パラメータ

| パラメータ名    | 必須 | 型      | 説明 |
| --------- | -- | ------ | -- |
| `id`      | ✅  | string |    |
| `skillPk` | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/skills/{skillPk}/resources/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

// リクエスト内容 (payload)
const data = null;

axios.delete("https://api.maiagent.ai/api/skills/{skillPk}/resources/550e8400-e29b-41d4-a716-446655440000/", data, config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/skills/{skillPk}/resources/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.delete(url, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->delete("https://api.maiagent.ai/api/skills/{skillPk}/resources/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

| ステータスコード | 説明        |
| -------- | --------- |
| 204      | レスポンス本文なし |

***

### スキルリソースの削除 <a href="#undefined" id="undefined"></a>

DELETE `/api/v1/skills/{skillPk}/resources/{id}/`

#### パラメータ

| パラメータ名    | 必須 | 型      | 説明 |
| --------- | -- | ------ | -- |
| `id`      | ✅  | string |    |
| `skillPk` | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/v1/skills/{skillPk}/resources/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

// リクエスト内容 (payload)
const data = null;

axios.delete("https://api.maiagent.ai/api/v1/skills/{skillPk}/resources/550e8400-e29b-41d4-a716-446655440000/", data, config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/skills/{skillPk}/resources/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.delete(url, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->delete("https://api.maiagent.ai/api/v1/skills/{skillPk}/resources/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

| ステータスコード | 説明        |
| -------- | --------- |
| 204      | レスポンス本文なし |

***

### スキルリソースのダウンロード <a href="#undefined" id="undefined"></a>

GET `/api/skills/{skillPk}/resources/{id}/download/`

#### パラメータ

| パラメータ名    | 必須 | 型      | 説明 |
| --------- | -- | ------ | -- |
| `id`      | ✅  | string |    |
| `skillPk` | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/skills/{skillPk}/resources/550e8400-e29b-41d4-a716-446655440000/download/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/skills/{skillPk}/resources/550e8400-e29b-41d4-a716-446655440000/download/", config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/skills/{skillPk}/resources/550e8400-e29b-41d4-a716-446655440000/download/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/skills/{skillPk}/resources/550e8400-e29b-41d4-a716-446655440000/download/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

| ステータスコード | 説明          |
| -------- | ----------- |
| 200      | ファイルのダウンロード |

***

### スキルリソースのダウンロード <a href="#undefined" id="undefined"></a>

GET `/api/v1/skills/{skillPk}/resources/{id}/download/`

#### パラメータ

| パラメータ名    | 必須 | 型      | 説明 |
| --------- | -- | ------ | -- |
| `id`      | ✅  | string |    |
| `skillPk` | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/skills/{skillPk}/resources/550e8400-e29b-41d4-a716-446655440000/download/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/skills/{skillPk}/resources/550e8400-e29b-41d4-a716-446655440000/download/", config)
  .then(response => {
    console.log('レスポンスの取得に成功しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/skills/{skillPk}/resources/550e8400-e29b-41d4-a716-446655440000/download/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスの取得に成功しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/skills/{skillPk}/resources/550e8400-e29b-41d4-a716-446655440000/download/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

| ステータスコード | 説明          |
| -------- | ----------- |
| 200      | ファイルのダウンロード |

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.maiagent.ai/api/api-doc-ja/api-reference/ji-neng.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
