Read the upload agreement
https://api.granska.cloud/v1/legal-agreementReads the upload agreement every uploaded document is submitted under: its current version, where it is read, and whether your organisation has accepted it. Read only: an administrator accepts it for the organisation in the GRANSKA app.
Two things before a document is accepted
Every document you send for analysis is submitted under one agreement: the GRANSKA Terms of
Service at agreementUrl. Once the agreement is enforced, a document is accepted only when both of
these hold:
- Your organisation has accepted the current version. A real administrator of your organisation does that, signed in to the GRANSKA app, where they read the agreement and confirm that they may bind the organisation. No API call can accept it, and an API key or an agent connection never accepts on anyone's behalf: it relies on the acceptance its administrator gave.
- Each request confirms its own document.
uploadAttestationonPOST /v1/upload-url, or onPOST /v1/analyzefor an inline or fetched document, is{ "agreementVersion": "<agreementVersion>", "uploadAuthorised": true }. Send it only once the person or system you act for has confirmed that they may submit that document.uploadAuthorised: falseis refused, never read as absent.
This call answers both questions before you upload anything. It spends nothing and changes nothing.
Reading the answer
agreementVersion is the version uploadAttestation must name. When it changes, a confirmation of
the earlier version is refused with 409 STALE_AGREEMENT_VERSION: read the agreement again and
confirm the new version.
organisationRequired and organisationAccepted say whether your organisation must accept, and
whether it has accepted the current version. When the first is true and the second false, ask an
administrator of your organisation to accept it in the app; until then every upload is answered
409 LEGAL_AGREEMENT_REQUIRED, whose details.missing names ORGANISATION_ACCEPTANCE.
mode is OFF before the agreement is collected, COLLECT while acceptances are being gathered and
nothing is refused for a missing one, and ENFORCE once it is required. userAccepted and
canAcceptOrganisation describe a person signed in with their own account; for an API key or an
agent connection both are always false, because neither has an acceptance of its own.
curl https://api.granska.cloud/v1/legal-agreement \
-H "Authorization: Bearer $TOKEN"{
"agreementVersion": "legal:2",
"agreementUrl": "https://www.granska.cloud/legal",
"mode": "ENFORCE",
"userAccepted": false,
"organisationRequired": true,
"organisationAccepted": true,
"canAcceptOrganisation": false
}Errors
| Error | When |
|---|---|
401UNAUTHORIZED | The Authorization header is missing, is not a readable bearer token, or names no tenant. |
401TOKEN_EXPIRED | The access token was issued by this gateway and has since expired. Not probed: it needs a token older than its own lifetime. |
500INTERNAL_ERROR | An unexpected server-side failure. Not probable from outside — reaching it means something is wrong. |
503SERVICE_UNAVAILABLE | The agreement could not be checked; details.reason is AGREEMENT_UNAVAILABLE and a Retry-After header says when to try again. Not probed: it needs an injected infrastructure failure. |