Skip to main content
POST
Create resource

Authorizations

Authorization
string
header
required

Enter your API token from the Haystack dashboard

Path Parameters

itemId
integer
required

Body

application/json
title
string
required

Display title for the resource

contentType
enum<string>
required
Available options:
file,
link,
video
subTitle
string | null
description
string | null
resourceTypeId
integer | null

Category for grouping (see /resource-types)

fileMimeType
string

Required when contentType is file

Example:

"application/pdf"

fileSizeBytes
integer

Required when contentType is file

Example:

1048576

originalFilename
string

Original filename, used to choose an extension

Required when contentType is link

externalPlatform
enum<string>

Required when contentType is video

Available options:
youtube,
vimeo
externalPlatformId
string

Required when contentType is video

Example:

"dQw4w9WgXcQ"

Response

Resource created. For file content type, upload the file to uploadUrl via PUT to complete.

resource
object
uploadUrl
string | null

Presigned S3 URL for file uploads (PUT). Null for link and video resources.

Example:

"https://s3.amazonaws.com/bucket/key?signature=..."