Skip to content

Pin a report

POST
/stores/{storeRef}/reports/pins
curl --request POST \
--url https://apibase.ecomweb.app/api/v1/stores/example/reports/pins \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "saved_report_id": "example", "preset_key": "example" }'

Pins a preset or saved report for the user the API key acts as. Pins are personal and do not affect teammates. Send exactly one of saved_report_id or preset_key. Pinning a report that is already pinned is not an error. The response has no body.

Required scopes: read:analytics

storeRef
required
string

The store’s ref, as returned by GET /stores.

Media typeapplication/json
object
saved_report_id

A saved report’s id

string
preset_key

A built-in preset’s key

string
<= 100 characters

Example generated

{
"saved_report_id": "example",
"preset_key": "example"
}

The report was pinned. The response body is empty.

Media typeapplication/json
string
0

Example generated

example

The request is malformed or failed validation.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}