> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://developer.staging.frame.io/platform/v4/api-reference/files/create/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.staging.frame.io/_mcp/server. # Create file POST https://api.frame.io/v4/accounts/{account_id}/folders/{folder_id}/files Content-Type: application/json Create new file under parent folder. `Create file (local upload)` and `Create file (remote upload)` have replaced this endpoint. Rate Limits: 5 calls per 1 second(s) per account\_user Reference: https://developer.staging.frame.io/platform/api-reference/files/create ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `account_id` (string, required) - `folder_id` (string, required) ### Body (application/json) This endpoint expects a FileCreateParams. - `data` (FileCreateParamsData, required) ## Response ### 201 Created - `data` (FileWithUploadUrls, required) ### 202 Accepted - `data` (FileWithUploadUrls, required) ## Errors ### 400 Bad Request Error Bad Request - `errors` (list of BadRequestErrorsItems, required) ### 401 Unauthorized Error Unauthorized - `errors` (list of UnauthorizedErrorsItems, required) ### 403 Forbidden Error Forbidden - `errors` (list of ForbiddenErrorsItems, required) ### 404 Not Found Error Not Found - `errors` (list of NotFoundErrorsItems, required) ### 422 Unprocessable Entity Error Unprocessable Entity - `errors` (list of UnprocessableEntityErrorsItems, required) ### 429 Too Many Requests Error Too Many Requests - `errors` (list of TooManyRequestsErrorsItems, required) ## Types ### FileCreateParamsData - `file_size` (integer, required) — File size in bytes (up to 5TB) - `media_type` (string, required) — MIME type, Example: image/gif - `name` (string, required) — File name - `source_url` (string, optional) — Source URL - Initiates a remote upload from the given URL when present ### FileWithUploadUrls - `created_at` (string, required) — Creation timestamp - `file_size` (integer, required) — File size in bytes - `media_type` (string, required) — File media type - `parent_id` (string, required, nullable) — Parent Folder or Version Stack ID - `project_id` (string, required) — Project ID - `status` (enum, required) - Allowed values: `created`, `transcoded`, `uploaded` - `type` (enum, required) - Allowed values: `file`, `folder`, `version_stack` - `updated_at` (string, required) — Update timestamp - `view_url` (string, required) — URL to view the asset in the Frame.io web application - `id` (string, optional) — File ID - `name` (string, optional) — File Name - `upload_urls` (list of UploadUrl, optional) — File upload URLs. Number of URLs returned will vary depending on the file size. ### BadRequestErrorsItems - `detail` (string, required) - `source` (BadRequestErrorsItemsSource, optional) - `title` (string, optional) ### UnauthorizedErrorsItems - `detail` (string, required) - `source` (UnauthorizedErrorsItemsSource, optional) - `title` (string, optional) ### ForbiddenErrorsItems - `detail` (string, required) - `source` (ForbiddenErrorsItemsSource, optional) - `title` (string, optional) ### NotFoundErrorsItems - `detail` (string, required) - `source` (NotFoundErrorsItemsSource, optional) - `title` (string, optional) ### UnprocessableEntityErrorsItems - `detail` (string, required) - `source` (UnprocessableEntityErrorsItemsSource, optional) - `title` (string, optional) ### TooManyRequestsErrorsItems - `detail` (string, required) - `source` (TooManyRequestsErrorsItemsSource, optional) - `title` (string, optional) ### UploadUrl - `size` (integer, required) — Upload chunk size - `url` (string, required) — S3 presigned URL. Client should make a PUT request to this URL that includes the "x-amz-acl: private" header along with the file or file chunk data. ### BadRequestErrorsItemsSource - `pointer` (string, optional) ### UnauthorizedErrorsItemsSource - `pointer` (string, optional) ### ForbiddenErrorsItemsSource - `pointer` (string, optional) ### NotFoundErrorsItemsSource - `pointer` (string, optional) ### UnprocessableEntityErrorsItemsSource - `pointer` (string, optional) ### TooManyRequestsErrorsItemsSource - `pointer` (string, optional) ## Examples ### Example 1 **Request** ```json { "data": { "file_size": 1137444, "media_type": "image/png", "name": "asset.png" } } ``` **Response** ```json { "data": { "created_at": "2023-09-25T19:18:29.614189Z", "file_size": 1137444, "media_type": "image/png", "parent_id": "06dd2657-2d56-4c80-afcc-482284725745", "project_id": "abdc8443-a4a1-4179-b052-00fe593c841e", "status": "created", "type": "file", "updated_at": "2024-02-07T16:44:41.986478Z", "view_url": "https://next.frame.io/project/d5e6011c-2bc9-4596-be05-77d562627112/view/5a89a9fb-0900-4b23-826b-127b90e4db4c", "id": "67b11ddd-fadc-45f0-ac1d-2f8ae929126c", "name": "asset.png", "upload_urls": [ { "size": 20000000, "url": "https://my.fileupload.url.dev" } ] } } ``` **SDK Code** ```python import requests url = "https://api.frame.io/v4/accounts/175d2d12-e32d-4bd0-ba04-a0d5c98acf10/folders/9809285a-fa09-4bfd-aa38-3f6c71d31550/files" payload = { "data": { "file_size": 1137444, "media_type": "image/png", "name": "asset.png" } } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.frame.io/v4/accounts/175d2d12-e32d-4bd0-ba04-a0d5c98acf10/folders/9809285a-fa09-4bfd-aa38-3f6c71d31550/files'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"data":{"file_size":1137444,"media_type":"image/png","name":"asset.png"}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.frame.io/v4/accounts/175d2d12-e32d-4bd0-ba04-a0d5c98acf10/folders/9809285a-fa09-4bfd-aa38-3f6c71d31550/files" payload := strings.NewReader("{\n \"data\": {\n \"file_size\": 1137444,\n \"media_type\": \"image/png\",\n \"name\": \"asset.png\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.frame.io/v4/accounts/175d2d12-e32d-4bd0-ba04-a0d5c98acf10/folders/9809285a-fa09-4bfd-aa38-3f6c71d31550/files") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"data\": {\n \"file_size\": 1137444,\n \"media_type\": \"image/png\",\n \"name\": \"asset.png\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.frame.io/v4/accounts/175d2d12-e32d-4bd0-ba04-a0d5c98acf10/folders/9809285a-fa09-4bfd-aa38-3f6c71d31550/files") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"data\": {\n \"file_size\": 1137444,\n \"media_type\": \"image/png\",\n \"name\": \"asset.png\"\n }\n}") .asString(); ``` ```php request('POST', 'https://api.frame.io/v4/accounts/175d2d12-e32d-4bd0-ba04-a0d5c98acf10/folders/9809285a-fa09-4bfd-aa38-3f6c71d31550/files', [ 'body' => '{ "data": { "file_size": 1137444, "media_type": "image/png", "name": "asset.png" } }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.frame.io/v4/accounts/175d2d12-e32d-4bd0-ba04-a0d5c98acf10/folders/9809285a-fa09-4bfd-aa38-3f6c71d31550/files"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"data\": {\n \"file_size\": 1137444,\n \"media_type\": \"image/png\",\n \"name\": \"asset.png\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["data": [ "file_size": 1137444, "media_type": "image/png", "name": "asset.png" ]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.frame.io/v4/accounts/175d2d12-e32d-4bd0-ba04-a0d5c98acf10/folders/9809285a-fa09-4bfd-aa38-3f6c71d31550/files")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Example 2 **Request** ```json { "data": { "file_size": 1137444, "media_type": "image/png", "name": "asset.png" } } ``` **Response** ```json { "data": { "created_at": "2023-09-25T19:18:29.614189Z", "file_size": 1137444, "media_type": "image/png", "parent_id": "06dd2657-2d56-4c80-afcc-482284725745", "project_id": "abdc8443-a4a1-4179-b052-00fe593c841e", "status": "created", "type": "file", "updated_at": "2024-02-07T16:44:41.986478Z", "view_url": "https://next.frame.io/project/d5e6011c-2bc9-4596-be05-77d562627112/view/5a89a9fb-0900-4b23-826b-127b90e4db4c", "id": "67b11ddd-fadc-45f0-ac1d-2f8ae929126c", "name": "asset.png", "upload_urls": [ { "size": 20000000, "url": "https://my.fileupload.url.dev" } ] } } ``` **SDK Code** ```python import requests url = "https://api.frame.io/v4/accounts/175d2d12-e32d-4bd0-ba04-a0d5c98acf10/folders/9809285a-fa09-4bfd-aa38-3f6c71d31550/files" payload = { "data": { "file_size": 1137444, "media_type": "image/png", "name": "asset.png" } } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.frame.io/v4/accounts/175d2d12-e32d-4bd0-ba04-a0d5c98acf10/folders/9809285a-fa09-4bfd-aa38-3f6c71d31550/files'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"data":{"file_size":1137444,"media_type":"image/png","name":"asset.png"}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.frame.io/v4/accounts/175d2d12-e32d-4bd0-ba04-a0d5c98acf10/folders/9809285a-fa09-4bfd-aa38-3f6c71d31550/files" payload := strings.NewReader("{\n \"data\": {\n \"file_size\": 1137444,\n \"media_type\": \"image/png\",\n \"name\": \"asset.png\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.frame.io/v4/accounts/175d2d12-e32d-4bd0-ba04-a0d5c98acf10/folders/9809285a-fa09-4bfd-aa38-3f6c71d31550/files") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"data\": {\n \"file_size\": 1137444,\n \"media_type\": \"image/png\",\n \"name\": \"asset.png\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.frame.io/v4/accounts/175d2d12-e32d-4bd0-ba04-a0d5c98acf10/folders/9809285a-fa09-4bfd-aa38-3f6c71d31550/files") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"data\": {\n \"file_size\": 1137444,\n \"media_type\": \"image/png\",\n \"name\": \"asset.png\"\n }\n}") .asString(); ``` ```php request('POST', 'https://api.frame.io/v4/accounts/175d2d12-e32d-4bd0-ba04-a0d5c98acf10/folders/9809285a-fa09-4bfd-aa38-3f6c71d31550/files', [ 'body' => '{ "data": { "file_size": 1137444, "media_type": "image/png", "name": "asset.png" } }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.frame.io/v4/accounts/175d2d12-e32d-4bd0-ba04-a0d5c98acf10/folders/9809285a-fa09-4bfd-aa38-3f6c71d31550/files"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"data\": {\n \"file_size\": 1137444,\n \"media_type\": \"image/png\",\n \"name\": \"asset.png\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["data": [ "file_size": 1137444, "media_type": "image/png", "name": "asset.png" ]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.frame.io/v4/accounts/175d2d12-e32d-4bd0-ba04-a0d5c98acf10/folders/9809285a-fa09-4bfd-aa38-3f6c71d31550/files")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```