cURL
curl --request PATCH \ --url https://api.thehaystack.ai/v2/haystack/items/{itemId}/resources/{resourceId}/update \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "title": "<string>", "subTitle": "<string>", "description": "<string>", "resourceTypeId": 123, "linkTarget": "<string>", "externalPlatform": "youtube", "externalPlatformId": "<string>" } '
{ "resource": { "id": 123, "itemId": 123, "title": "<string>", "subTitle": "<string>", "description": "<string>", "resourceTypeId": 123, "displayOrder": 123, "contentType": "file", "fileMimeType": "<string>", "fileSizeBytes": 123, "externalPlatform": "youtube", "externalPlatformId": "<string>", "thumbnailImgUrl": "<string>", "url": "<string>", "resourceType": { "id": 123, "name": "<string>" }, "linkTarget": "<string>" } }
Update metadata for an existing resource. The contentType and underlying file cannot be changed once created — create a new resource if you need a different type.
contentType
Enter your API token from the Haystack dashboard
Only used on link resources
link
Only used on video resources
video
youtube
vimeo
Updated resource
Show child attributes