Skip to content

Get and set all file metadata

By , Head of IntegrationsUpdated

Open this page in a new chat

Short answer

This page has 2 commands: Get all file meta (GET /v2/files/meta) and Set all file meta (POST /v2/files/meta). Get all the meta for a file, in a single request. Each call needs a bearer token and counts towards your hourly API limit.

After reading this you will know

  • How to get and set all file metadata
  • Which parameters each of the 2 commands takes
  • Sample code in 9 languages and a sample answer

Every command on this page needs a bearer token and counts towards your hourly limit.

GEThttps://api.sirv.com/v2/files/meta

Get all the meta for a file, in a single request.

Unlike the API methods for getting meta title, description, tags and product data, this API method will return all meta data, making it the fastest and easiest way to get meta via the API. (You can also get file meta simply by requesting a file URL with ?info appended - example).

Query parameters

NameTypeRequiredExampleDescription
filenamestringYes/REST API Examples/blue-lake.jpgPath of the file in your account, starting with /.

Example request

// Your bearer token, from POST /v2/token, in the SIRV_TOKEN environment variable
const res = await fetch('https://api.sirv.com/v2/files/meta?filename=%2FREST%20API%20Examples%2Fblue-lake.jpg', {
method: 'GET',
headers: { authorization: `Bearer ${process.env.SIRV_TOKEN}` },
});
console.log(res.status, await res.text());

Example response

{
"tags": [
"lake",
"water"
],
"title": "Blue Lake",
"description": "Blue Lake in the Winter",
"product": {
"id": "LLBB77",
"name": "Blue Lake Card",
"brand": "BLUE LAKE LLC",
"category1": "Cards",
"category2": "Lakes"
},
"approval": {
"datetime": "2026-02-23T14:08:00.165Z",
"approved": false,
"comment": "It looks too cold!"
}
}
POSThttps://api.sirv.com/v2/files/meta

Add multiple meta fields in a single request. Any of the 10 types of meta can be added or changed with this API method.

If you’re adding a lot of meta, this is the fastest and lowest load way to add meta data.

Query parameters

NameTypeRequiredExampleDescription
filenamestringYes/REST API Examples/blue-lake.jpgPath of the file in your account, starting with /.

Request body (JSON)

FieldTypeRequiredExampleDescription
tagsarray of stringNo["lake","water"]Tags of the file.
titlestringNoBlue LakeTitle of the file.
descriptionstringNoBlue Lake in the WinterDescription of the file.
productobjectNoProduct details of the file.
product.idstringNoLLBB77Product ID or SKU.
product.namestringNoBlue Lake CardProduct name.
product.brandstringNoBLUE LAKE LLCBrand of the product.
product.category1stringNoCardsMain product category.
product.category2stringNoLakesSecond product category.
approvalobjectNoApproval status of the file.
approval.approvedbooleanYesfalsetrue to approve the file, false to reject it.
approval.commentstringYesIt looks too cold!A note on the decision.

Example request

// Your bearer token, from POST /v2/token, in the SIRV_TOKEN environment variable
const res = await fetch('https://api.sirv.com/v2/files/meta?filename=%2FREST%20API%20Examples%2Fblue-lake.jpg', {
method: 'POST',
headers: { authorization: `Bearer ${process.env.SIRV_TOKEN}`, 'content-type': 'application/json' },
body: JSON.stringify({
"tags": [
"lake",
"water"
],
"title": "Blue Lake",
"description": "Blue Lake in the Winter",
"product": {
"id": "LLBB77",
"name": "Blue Lake Card",
"brand": "BLUE LAKE LLC",
"category1": "Cards",
"category2": "Lakes"
},
"approval": {
"approved": false,
"comment": "It looks too cold!"
}
}),
});
console.log(res.status, await res.text());

Response

HTTP 200 with an empty body when the command succeeds.

Back to top