Skip to Content
Docs
ReferenceOrganise

Create a project

POST
/create_project

Creates an awen project at the top of the user's Projects, with its first conversation, as New project does in awen. Use it only when the user asks for a project or has none that fits, never one per request. Without a name it is Untitled and takes its name from the first message. Pass the returned project_id to create_folder, import_file or start_conversation, and the returned conversation_id to create_with_awen for the first turn, so the project keeps no empty conversation.

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
name?string

The project's name; omit it to let the first message name the project.

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

Response Body

The operation's answer.

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

Create a folder POST

Creates a folder in a project the user can edit. Pass parent_id "root" for the project root, or a folder's entry_id from list_folder or create_folder to create it inside that folder. Needs a key with awen:write. Costs 2 units of the key's rate limit.

Prepare a file upload POST

Prepares the upload of a file you hold that has no public URL: a file the user attached that your code sandbox can read, or a file on this machine. 1) Measure it: its exact size in bytes and its SHA-256 in hex (wc -c < FILE; shasum -a 256 FILE or sha256sum FILE; on Windows, Get-FileHash -Algorithm SHA256). 2) Call this tool with the name it gets in the Drive, its size and its SHA-256. 3) Within 10 minutes, run the returned command with /path/to/file replaced by the file's path, inside its single quotes, with any ' in the path written as '\'', and change nothing else (your host may ask the user to approve it once). If your host cannot run it, ask the user to run it: never send the request another way. It fetches awen's upload script and sends the raw bytes to upload_host, and the upload completes only with the exact file you measured. If it stops at a refusal, next_steps says what to do for its code. Without a POSIX shell, send the same requests to upload_url with the authorization. 4) Within 30 minutes, call import_file with the same project_id and folder_id and this upload_id to place the file; an upload not placed by then is deleted. For several files, prepare every file, run every command, then place each upload with import_file: each keeps its own times. The command needs network access to script_host for the script, then to upload_host for the file. If curl cannot reach script_host it prints only its own error: ask the user to allow both hosts. Otherwise, when the command fails, its last line, starting with awen:, says what to do next. Drive takes files up to 512 MB, images up to 95 MB and any video, never programs. Only an MP4 opens as a video in awen: other formats save as plain files. Needs a key with awen:write. Costs 2 units of the key's rate limit.