Skip to Content
Docs
ReferenceOrganise

Rename a file or a folder

POST
/rename_file

Renames a file or a folder in a project the user can edit; a file's name applies to its Drive entry and its content. Pass the entry_id from list_folder, never a media_id. Two folders side by side can't share a name, and a memory's folder can't take the name of another of the user's memories. A memory reads its instructions from its Memory.md: that file keeps its name, and no other file in a memory can be named Memory.md; the user edits a memory's instructions in awen.

Needs a key with awen:write. Costs 2 units of the key's rate limit.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key from Settings → Connected apps → API keys, sent as Authorization: Bearer awen_sk_…. Keep it on a server: a request from a web page is refused.

Request Body

application/json
  1. body
project_id*string

The project's project_id.

Match^[A-Za-z0-9_-]+$
Length1 <= length <= 128
entry_id*string

The entry_id of the file or folder.

Match^[A-Za-z0-9_-]+$
Length1 <= length <= 128
name*string

The new name.

Match^[^\x00]*$
Length1 <= length <= 2083

Response Body

The operation's answer.

application/json
  1. response
entry_id*string
name*string
Example Request
curl -X POST 'https://app.awen.ai/api/v1/rename_file' \  -H 'Content-Type: application/json' \  -d '{  "project_id": "string",  "entry_id": "string",  "name": "string"}'
Example Response
{  "entry_id": "string",  "name": "string"}