Skip to content

Get and set the approval flag

By , Head of IntegrationsUpdated

Open this page in a new chat

Short answer

This page has 2 commands: Get approval flag (GET /v2/files/meta/approval) and Set approval flag (POST /v2/files/meta/approval). Used as part of an image review and approval process. Each call needs a bearer token and counts towards your hourly API limit. Below are the parameters, sample code in 9 languages and a sample answer.

After reading this you will know

  • How to get and set the approval flag
  • 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/approval

Use this API method to get the file approval tag and optional comment for a file.

Used as part of an image review and approval process.

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/approval?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

{
"datetime": "2026-02-23T13:54:04.440Z",
"approved": false,
"comment": "It looks too cold!"
}
POSThttps://api.sirv.com/v2/files/meta/approval

Use this API method to set the file approval tag (approved or not) and an optional comment.

Used as part of an image review and approval process.

Query parameters

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

Request body (JSON)

FieldTypeRequiredExampleDescription
approvedbooleanYesfalsetrue to approve the file, false to reject it.
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/approval?filename=%2FREST%20API%20Examples%2Fblue-lake.jpg', {
method: 'POST',
headers: { authorization: `Bearer ${process.env.SIRV_TOKEN}`, 'content-type': 'application/json' },
body: JSON.stringify({
"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