Skip to main content
POST
/
public
/
apps
/
files
/
uploads
/
{file_upload_id}
Upload a file
curl --request POST \
  --url https://api.example.com/public/apps/files/uploads/{file_upload_id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "file": "<string>",
  "file_url": "https://example.com/files/document.pdf"
}
'
import requests

url = "https://api.example.com/public/apps/files/uploads/{file_upload_id}"

payload = {
"file": "<string>",
"file_url": "https://example.com/files/document.pdf"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({file: '<string>', file_url: 'https://example.com/files/document.pdf'})
};

fetch('https://api.example.com/public/apps/files/uploads/{file_upload_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/public/apps/files/uploads/{file_upload_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file' => '<string>',
'file_url' => 'https://example.com/files/document.pdf'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.example.com/public/apps/files/uploads/{file_upload_id}"

payload := strings.NewReader("{\n \"file\": \"<string>\",\n \"file_url\": \"https://example.com/files/document.pdf\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.example.com/public/apps/files/uploads/{file_upload_id}")
.header("Content-Type", "application/json")
.body("{\n \"file\": \"<string>\",\n \"file_url\": \"https://example.com/files/document.pdf\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/public/apps/files/uploads/{file_upload_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"file\": \"<string>\",\n \"file_url\": \"https://example.com/files/document.pdf\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "file_id": "<string>",
  "file_filename": "document.pdf",
  "file_size": 1024,
  "file_mimetype": "application/pdf",
  "file_url": "<string>",
  "created_at": "2023-12-25",
  "file_format": "DOCUMENT",
  "file_status": "PROCESSED",
  "file_status_message": "<string>",
  "document": {
    "filename": "<string>",
    "filetype": "<string>",
    "contents": [
      {
        "id": 123,
        "content": "<string>",
        "page": 123,
        "content_as_html": "<string>",
        "parent": 123
      }
    ],
    "images": [
      {
        "id": "<string>",
        "file_id": "<string>",
        "image_url": "<string>",
        "type": "<string>",
        "page": 123,
        "height": 123,
        "width": 123
      }
    ],
    "extracted_pages": "<string>",
    "time": 123
  },
  "document_extract_contents": true,
  "document_extract_images": true,
  "document_extract_pages": true,
  "document_pages": [
    1,
    2,
    3
  ],
  "document_progress": 123,
  "storage": "PERSISTENT"
}

Path Parameters

file_upload_id
string
required

The ID of the file upload

Body

The file to upload

file

File to be uploaded. It can be a file object, a base64 encoded string, or a file data object containing base64 data, name, and type.

file_url
string

URL of the file to be uploaded

Example:

"https://example.com/files/document.pdf"

Response

200 - application/json

Detailed information about a file

id
string
required

Unique identifier for the file

file_id
string
required

File identifier used in the storage system

file_filename
string
required

Name of the file

Example:

"document.pdf"

file_size
number
required

Size of the file in bytes

Example:

1024

file_mimetype
string
required

MIME type of the file

Example:

"application/pdf"

file_url
string
required

URL to access the file

created_at
string<date> | null
required

Timestamp when the file was created

file_format
enum<string>

Format of the file

Available options:
DOCUMENT
Example:

"DOCUMENT"

file_status
enum<string>

Current status of the file

Available options:
PROCESSING,
PROCESSED,
FAILED
Example:

"PROCESSED"

file_status_message
string

Status message providing additional information about the file status

document
object

Document data associated with the file

document_extract_contents
boolean

Flag indicating whether to extract contents from the document

document_extract_images
boolean

Flag indicating whether to extract images from the document

document_extract_pages
boolean

Flag indicating whether to extract pages from the document

document_pages
number[]

Array of page numbers to extract from the document

Maximum array length: 1024
Example:
[1, 2, 3]
document_progress
number

Progress of the document extraction process

storage
enum<string>
default:PERSISTENT

Whether the file is stored permanently or temporarily, indicating the storage type

Available options:
PERSISTENT,
TEMPORARY
Example:

"PERSISTENT"