Search documentation
karat

+

K

User Documentation ↗

Put Media Item

POST/api/v2/mediasets/{mediaSetRid}/items
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 an existing media set. The body of the request must contain the binary content of the file and the Content-Type header must be application/octet-stream. A branch name, or branch rid, or view rid may optionally be specified. If none is specified, the item will be uploaded to the default branch. If more than one is specified, an error is thrown.

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

Path parameters

mediaSetRid
string

The Resource Identifier (RID) of a Media Set in Foundry.

Query parameters

mediaItemPath
string
optional

A user-specified identifier for a media item within a media set. Paths must be less than 256 characters long. If multiple items are written to the same media set at the same path, then when retrieving by path the media item which was written last is returned.

branchName
string
optional

Specifies the specific branch by name to which this media item will be uploaded. May not be provided if branch rid or view rid are provided.

branchRid
string
optional

Specifies the specific branch by rid to which this media item will be uploaded. May not be provided if branch name or view rid are provided.

viewRid
string
optional

Specifies the specific view by rid to which this media item will be uploaded. May not be provided if branch name or branch rid are provided.

transactionId
string
optional

The id of the transaction associated with this request. Required if this is a transactional media set.

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

PutMediaItemResponse
object
Hide child attributes

Hide child attributes

mediaItemRid
string

The Resource Identifier (RID) of an individual Media Item within a Media Set in Foundry.

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/mediasets/{mediaSetRid}/items?mediaItemPath=q3-data%252fmy-file.png&preview=true" \ -d '@/path/to/file'