Skip to content

Request IDs

Every API response includes an x-request-id header containing a unique ID for that request. Successful responses and errors both include it. The ID is only sent as a header, not in the JSON body.

HTTP/1.1 404 Not Found
x-request-id: 3f6c2a9e-8b1d-4c7a-9e2f-5d4b1a0c7e93

The API generates a new ID for every request. Any x-request-id header you send with a request is ignored.

const response = await fetch(
`https://api.upvio.com/v1/businesses/${businessId}/vitals/scans/invalid-id`,
{
headers: {
Authorization: `Bearer ${apiKey}`,
},
},
)
if (!response.ok) {
const body = await response.json()
console.error(response.headers.get('x-request-id'))
// "3f6c2a9e-8b1d-4c7a-9e2f-5d4b1a0c7e93"
console.error(body.error?.type) // "NotFoundError"
}

The @upvio/sdk-node SDK does not expose response headers. To read the request ID, make the request directly over HTTP.

When reporting a failed request, include:

  • The x-request-id value
  • The approximate time of the request
  • The HTTP method and endpoint
  • The HTTP status code and error.type

We recommend logging the request ID alongside failed requests in your own system, so it is available when you need to contact support.