> For the complete documentation index, see [llms.txt](https://docs.rememberizer.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rememberizer.ai/ja/rissu/api-docs/vector-store/update-files-content-in-a-vector-store.md).

# ベクターストア内のファイルの内容を更新

{% openapi src="/files/NPsg8DFwcSjopKSuZo9m" path="/vector-stores/{vector-store-id}/documents/{document-id}/" method="patch" %}
[rememberizer\_openapi.yml](https://3282965451-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK09NlRK7lXZsjqCNQsEe%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=dd73efa7-56a8-4350-88ab-85d7586fb7b8)
{% endopenapi %}

## 例リクエスト

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X PATCH \
  https://api.rememberizer.ai/api/v1/vector-stores/vs_abc123/documents/1234/ \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "更新された製品概要"
  }'
```

{% hint style="info" %}
`YOUR_API_KEY` を実際のベクターストアAPIキーに、`vs_abc123` をベクターストアIDに、`1234` をドキュメントIDに置き換えてください。
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const updateDocument = async (vectorStoreId, documentId, newName) => {
  const response = await fetch(`https://api.rememberizer.ai/api/v1/vector-stores/${vectorStoreId}/documents/${documentId}/`, {
    method: 'PATCH',
    headers: {
      'x-api-key': 'YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: newName
    })
  });
  
  const data = await response.json();
  console.log(data);
};

updateDocument('vs_abc123', 1234, '更新された製品概要');
```

{% hint style="info" %}
`YOUR_API_KEY` を実際のベクターストアAPIキーに、`vs_abc123` をベクターストアIDに、`1234` をドキュメントIDに置き換えてください。
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def update_document(vector_store_id, document_id, new_name):
    headers = {
        "x-api-key": "YOUR_API_KEY",
        "Content-Type": "application/json"
    }
    
    payload = {
        "name": new_name
    }
    
    response = requests.patch(
        f"https://api.rememberizer.ai/api/v1/vector-stores/{vector_store_id}/documents/{document_id}/",
        headers=headers,
        data=json.dumps(payload)
    )
    
    data = response.json()
    print(data)

update_document('vs_abc123', 1234, '更新された製品概要')
```

{% hint style="info" %}
`YOUR_API_KEY` を実際のベクターストアAPIキーに、`vs_abc123` をベクターストアIDに、`1234` をドキュメントIDに置き換えてください。
{% endhint %}
{% endtab %}
{% endtabs %}

## パスパラメータ

| パラメータ           | タイプ | 説明                           |
| --------------- | --- | ---------------------------- |
| vector-store-id | 文字列 | **必須。** ドキュメントを含むベクターストアのID。 |
| document-id     | 整数  | **必須。** 更新するドキュメントのID。       |

## リクエストボディ

```json
{
  "name": "更新された製品概要"
}
```

| パラメータ | タイプ | 説明            |
| ----- | --- | ------------- |
| name  | 文字列 | ドキュメントの新しい名前。 |

## レスポンスフォーマット

```json
{
  "id": 1234,
  "name": "更新された製品概要",
  "type": "text/plain",
  "vector_store": "vs_abc123",
  "size": 173,
  "status": "indexed",
  "processing_status": "completed",
  "indexed_on": "2023-06-15T10:30:00Z",
  "status_error_message": null,
  "created": "2023-06-15T10:15:00Z",
  "modified": "2023-06-15T11:45:00Z"
}
```

## 認証

このエンドポイントは、`x-api-key` ヘッダーを使用して API キーによる認証を必要とします。

## エラー応答

| ステータスコード | 説明                             |
| -------- | ------------------------------ |
| 400      | 不正なリクエスト - 無効なリクエスト形式          |
| 401      | 認証エラー - 無効または欠落しているAPIキー       |
| 404      | 未発見 - ベクターストアまたはドキュメントが見つかりません |
| 500      | 内部サーバーエラー                      |

このエンドポイントを使用すると、ベクターストア内のドキュメントのメタデータを更新できます。現在、ドキュメントの名前のみを更新できます。これは、ドキュメントを再アップロードすることなく、ドキュメントの整理と発見性を向上させるのに役立ちます。

{% hint style="info" %}
注意: このエンドポイントはドキュメントのメタデータのみを更新し、その内容は更新しません。内容を更新するには、既存のドキュメントを削除し、新しいものをアップロードする必要があります。
{% endhint %}


---

# 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.rememberizer.ai/ja/rissu/api-docs/vector-store/update-files-content-in-a-vector-store.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.
