Skip to main content
POST
/
orgs
/
{org_id}
/
contacts
/
{contact_id}
/
files
Upload Contact File
curl --request POST \
  --url https://api.useinvent.com/orgs/{org_id}/contacts/{contact_id}/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "file": "<string>",
  "file_url": "https://example.com/files/document.pdf",
  "allowed_types": [
    "*/*"
  ]
}
'
{
  "id": "<string>",
  "file_path": "<string>",
  "file_filename": "document.pdf",
  "file_size": 1024,
  "file_mimetype": "application/pdf",
  "file_url": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "source": "direct",
  "user": {
    "id": "<string>",
    "name": "<string>",
    "email": "jsmith@example.com",
    "avatar": "<string>",
    "seen_at": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer token authentication using your API key

Path Parameters

org_id
string
required

Org ID

contact_id
string
required

Contact ID

Body

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"

allowed_types
string[]

The allowed mime types for the file field (e.g. image/*, application/pdf)

Maximum array length: 255
Maximum string length: 255

Response

200 - application/json

A file in a contact collection, with its origin metadata

id
string
required

Unique identifier for the file

file_path
string
required

Path to the file in the storage system

Maximum string length: 2048
file_filename
string
required

Name of the file

Maximum string length: 255
Example:

"document.pdf"

file_size
number
required

Size of the file in bytes

Example:

1024

file_mimetype
string
required

MIME type of the file

Maximum string length: 255
Example:

"application/pdf"

file_url
string
required

URL to access the file

Maximum string length: 2048
created_at
string<date-time> | null
required

Timestamp when the file was created

source
enum<string>
required

Where the file came from in the contact: a direct upload, attached to a note, or sent in a chat

Available options:
direct,
note,
chat
user
object

Staff member who linked the file to the contact. Null when the file came from the contact themselves or was generated by the assistant.