Search documentation
karat

+

K

User Documentation ↗

Upload Media Content

POST/api/v2/ontologies/{ontology}/objectTypes/{objectType}/media/{property}/upload
Warning

This endpoint is in preview and may be modified or removed at any time. To use this endpoint, add preview=true to the request query parameters.

Uploads a media item to the media set which backs the specified property. The property must be backed by a single media set and branch, otherwise an error will be thrown. The body of the request must contain the binary content of the file and the Content-Type header must be application/octet-stream.

Third-party applications using this endpoint via OAuth2 must request the following operation scopes: api:ontologies-read api:mediasets-read api:mediasets-write.

Path parameters

ontology
string

The API name of the ontology. To find the API name, use the List ontologies endpoint or check the Ontology Manager.

objectType
string

The API name of the object type. To find the API name, use the List object types endpoint or check the Ontology Manager.

property
string

The API name of the media reference property. To find the API name, check the Ontology Manager or use the Get object type endpoint.

Query parameters

mediaItemPath
string
optional

A path for the media item within its backing media set. Required if the backing media set requires paths.

preview
boolean
optional

A boolean flag that, when set to true, enables the use of beta features in preview mode.

Request body

body
string

Response body

MediaReference
object

The media reference for the uploaded media.

Hide child attributes

Hide child attributes

mimeType
string

The media type of the file or attachment. Examples: application/json, application/pdf, application/octet-stream, image/jpeg

reference
union

A union of the types supported by media reference properties.

Show child attributes

Show child attributes

Examples

Request

Copied!
1 2 3 4 5 curl -X POST \ -H "Content-type: application/octet-stream" \ -H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v2/ontologies/palantir/objectTypes/employee/media/profile_picture/upload?mediaItemPath=my-file.png&preview=true" \ -d '@/path/to/file'