Skip to content

Set, get and delete points of interest

By , Head of IntegrationsUpdated

Open this page in a new chat

Short answer

This page has 3 commands: Set point of interest (POST /v2/files/poi), Get user points of interest (GET /v2/files/poi) and Delete point of interest (DELETE /v2/files/poi). 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 set, get and delete points of interest
  • Which parameters each of the 3 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.

POSThttps://api.sirv.com/v2/files/poi

Use this API method to set coordinates of the POI (point of interest) on the image.

Query parameters

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

Request body (JSON)

FieldTypeRequiredExampleDescription
namestringNoBlueLakeName of the POI
xnumberNo0.5Relative X coordinate of the center of the POI. Up to 1.
ynumberNo0.5Relative Y coordinate of the center of the POI. Up to 1.
widthnumberNo0.5Relative width of the POI. Up to 1.
heightnumberNo0.5Relative height of the POI. Up to 1.

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/poi?filename=%2FREST%20API%20Examples%2Fblue-lake.jpg', {
method: 'POST',
headers: { authorization: `Bearer ${process.env.SIRV_TOKEN}`, 'content-type': 'application/json' },
body: JSON.stringify({
"name": "BlueLake",
"x": 0.5,
"y": 0.5,
"width": 0.5,
"height": 0.5
}),
});
console.log(res.status, await res.text());

Response

HTTP 200 with an empty body when the command succeeds.

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

Use this API method to get coordinates of all the POI (points of interest) on the image.

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

{
"BlueLake": {
"x": 0.5,
"y": 0.5,
"width": 0.5,
"height": 0.5
}
}
DELETEhttps://api.sirv.com/v2/files/poi

Use this API method to delete POI (point of interest) on the image.

Query parameters

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

Request body (JSON)

FieldTypeRequiredExampleDescription
namestringNoBlueLakeName of the POI

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/poi?filename=%2FREST%20API%20Examples%2Fblue-lake.jpg', {
method: 'DELETE',
headers: { authorization: `Bearer ${process.env.SIRV_TOKEN}`, 'content-type': 'application/json' },
body: JSON.stringify({
"name": "BlueLake"
}),
});
console.log(res.status, await res.text());

Response

HTTP 200 with an empty body when the command succeeds.

Back to top