# Files ## Create **post** `/v2/vals/{val_id}/files` Create a new file, project val or directory ### Returns - **id:** `string` The id of the resource - **links:** `object` - **html:** `string` The URL of this resource on Val Town - **module:** `string` The URL of this resource's source code as a module - **self:** `string` The URL of this resource on this API - **endpoint:** `string` This resource's web endpoint, where it serves a website or API - **name:** `string` - **path:** `string` - **type:** `"directory" OR "file" OR "interval" OR 3 more` - `"directory"` - `"file"` - `"interval"` - `"http"` - `"email"` - `"script"` - **updatedAt:** `string` - **version:** `number` ## Retrieve **get** `/v2/vals/{val_id}/files` Get metadata for files and directories in a val. If path is an empty string, returns files at the root directory. ### Returns - **data:** `array of object` - **links:** `PaginationLinks` Links to use for pagination ## Update **put** `/v2/vals/{val_id}/files` Update a file's content ### Returns - **id:** `string` The id of the resource - **links:** `object` - **html:** `string` The URL of this resource on Val Town - **module:** `string` The URL of this resource's source code as a module - **self:** `string` The URL of this resource on this API - **endpoint:** `string` This resource's web endpoint, where it serves a website or API - **name:** `string` - **path:** `string` - **type:** `"directory" OR "file" OR "interval" OR 3 more` - `"directory"` - `"file"` - `"interval"` - `"http"` - `"email"` - `"script"` - **updatedAt:** `string` - **version:** `number` ## Delete **delete** `/v2/vals/{val_id}/files` Deletes a file or a directory. To delete a directory and all of its children, use the recursive flag. To delete all files, pass in an empty path and the recursive flag. ## Get Content **get** `/v2/vals/{val_id}/files/content` Download file content