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.
Example
Section titled “Example”HTTP/1.1 404 Not Foundx-request-id: 3f6c2a9e-8b1d-4c7a-9e2f-5d4b1a0c7e93The API generates a new ID for every request. Any x-request-id header you send with a request is ignored.
Reading the request ID
Section titled “Reading the request ID”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"}curl -i \ -H "Authorization: Bearer $UPVIO_API_KEY" \ "https://api.upvio.com/v1/businesses/$UPVIO_BUSINESS_ID/vitals/scans/invalid-id"The -i flag prints the response headers, including x-request-id, before the body.
The @upvio/sdk-node SDK does not expose response headers. To read the request ID, make the request directly over HTTP.
Contacting support
Section titled “Contacting support”When reporting a failed request, include:
- The
x-request-idvalue - 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.