Skip to content

Upload a file

Request

Uploads a single file and returns its id. Attach the file to the resource it belongs to within 24 hours; an unattached file is deleted after that.

Security
form_session or user_session or component_session or component_token or api_token
Query
purposestringrequired

The intended use of the file. Use oob_task_pdf for a PDF of a form that was completed outside Onboarded, then supply the returned file id as the task's pdf_file_id to complete it out of band.

Value:"oob_task_pdf"
Bodymultipart/form-datarequired
filestring, (binary)required

The file to upload

curl -i -X POST \
  'https://docs.onboarded.com/_mock/openapi/api/v1/files?purpose=oob_task_pdf' \
  -H 'Authorization: Bearer <YOUR_Onboarded form session token_HERE>' \
  -H 'Content-Type: multipart/form-data' \
  -F file=string

Responses

FileUploadResponse

Bodyapplication/json
idstring(FileId)required

File Identifier

file_namestringrequired

The uploaded file's original name

mime_typestringrequired

The stored file's media type

sizenumberrequired

Size of the file in bytes

purposestringrequired

The purpose the file was uploaded for

Value:"oob_task_pdf"
created_atstring(DateTimeUtc)required

a string to be decoded into a DateTime.Utc

Response
{ "id": "f_01k5vmjjhq2wzt8b6rnq4c9xye", "file_name": "string", "mime_type": "string", "size": 0, "purpose": "oob_task_pdf", "created_at": "string" }