NeccessoryNeccessory
REST API

Shareable reports

Turn a measurement into an end-to-end encrypted link your user can open or share.

Turn a stored measurement into a private web page your end user can open or share, for example with a clinician. The report is end-to-end encrypted: Neccessory stores only ciphertext.

Create a report

POST /sdk/v1/measurements/{id}/report

The measurement must belong to the signing key.

FieldTypeDefaultDescription
ttlHoursnumber72Lifetime in hours, 1–168. Values outside the range are clamped
burnAfterReadbooleanfalseThe first opening consumes the report
localestring"en"Language of the report page: en or ru
import { neccessory } from './neccessory.js';

const report = await neccessory(
  'POST',
  '/sdk/v1/measurements/meas_9c1f4b7ae2d05138b6a37f42/report',
  { ttlHours: 48, burnAfterRead: true, locale: 'en' },
);

neccessory is the helper from Authentication.

Response

201 Created:

{
  "ok": true,
  "data": {
    "reportId": "rpt_Qm7ZkT2pXc9LwR4vN8bYs1HdJ6fGa3Ue",
    "url": "https://neccessory.com/en/report/rpt_Qm7ZkT2pXc9LwR4vN8bYs1HdJ6fGa3Ue#pJ0x7uVv2kqzH1cR9mEwT4nY8sL3bF6gA5dK0iO2eZQ",
    "expiresAt": 1790172800000,
    "burnAfterRead": true
  }
}
FieldTypeDescription
reportIdstringReport ID, rpt_…
urlstringThe link to hand to the user. The part after # is the decryption key
expiresAtnumberWhen the report stops opening, epoch milliseconds
burnAfterReadbooleanWhether the first opening consumes the report

Errors

HTTPerror.codeCause
400validation_errorlocale is not en or ru, or ttlHours is not a number
401unauthorizedSignature or key problem
404not_foundThe measurement does not exist or belongs to another key
429rate_limitedMore than 30 reports in an hour for this key

Security model

  • Each report is encrypted with its own random key.
  • The key exists only in the URL fragment, after #. Browsers do not send the fragment to servers, and Neccessory does not keep the key. Only someone with the full link can read the report.
  • Neccessory stores the ciphertext until expiresAt.
  • With burnAfterRead, the first opening consumes the report.
  • A report that does not exist, has expired or was consumed returns the same "not found" page. A report ID reveals nothing on its own.
  • Give url to the user exactly as returned. Without the fragment the page cannot decrypt the report.
  • Treat the full URL as a secret. Do not write it to logs or analytics.
  • Create reports when the user asks to share, not in bulk. Each key can create 30 per hour.
  • Choose the shortest ttlHours that fits, and burnAfterRead for one-time viewing.
  • A report is a snapshot of the measurement at creation time.

What the report shows

The link opens https://neccessory.com/{locale}/report/{reportId}. The page decrypts the report in the browser and shows:

  • when the report was created;
  • signal quality;
  • heart rate, SDNN, RMSSD, breathing rate and stress index;
  • systolic and diastolic blood pressure and SpO2;
  • the wellness score and disclaimers.

Values that were not measured stay empty. The page is not indexed by search engines.