# How to change name of a collection field

Changing the name of a collection field requires us to make use of the `/project/copy_collection` endpoint and in particular the `rename_fields` argument.

This can be seen as:&#x20;

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

```javascript
let request = await fetch("https://vectorai-development-api.azurewebsites.net/project/copy_collection", {
      "method": "POST",
      "headers": {
            "Content-Type": "application/json"
      },
      "body": JSON.stringify({
        "username": "string",
        "api_key": "string",
        "collection_name": "string",
        "original_collection_name": "string",
        "rename_fields": { "old_field_name": "new_field_name" },
      })
})

let json = await request.json()
```

{% endtab %}

{% tab title="Python" %}

```python
import requests 
response = requests.post("https://vectorai-development-api.azurewebsites.net/project/copy_collection",
    json={
        "username": "string",
        "api_key": "string",
        "collection_name": "string",
        "original_collection_name": "string",
        "collection_schema": { },
        "rename_fields": { "old_field_name": "new_field_name" },
        "remove_fields": [ ]
    })
response.json()
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://learn.getvectorai.com/vector-search/managing-vector-ai/how-to-change-name-of-a-collection-field.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
