GRANSKA

Read one legal source

GEThttps://api.granska.cloud/v1/snippets/:id

Reads one legal source by its document id, full text included.

Bearer tokenSpends no quota

What it returns

The document id is the id GET /v1/snippets returned. This is the widest view of a source the API offers: the same metadata the list carries, plus two more fields.

  • content — the human-readable body of the source.
  • text — the internal representation the engine compiles into a prompt. Published because the contract has always published it, not because most integrations need it. normLevel, legalWeight and anchors are no longer returned. See Removed fields, and read authorityType instead.

updatedAt is a raw database timestamp rather than ISO 8601, the same quirk as on GET /v1/jobs/:jobId, and is absent on sources that have not been rewritten since they were imported.

Request
curl https://api.granska.cloud/v1/snippets/snip_3f0a \
  -H "Authorization: Bearer $TOKEN"
Response
{
  "snippet": {
    "id": "snip_3f0a",
    "tenantId": "SYSTEM",
    "snippetKey": "lss-7-goda-levnadsvillkor",
    "name": "7 § LSS — goda levnadsvillkor",
    "source": "SFS 1993:387",
    "authorityType": "STATUTE",
    "validFromYear": 1994,
    "validToYear": null,
    "updatedAt": {
      "_seconds": 1781164800,
      "_nanoseconds": 0
    },
    "content": "Personer som anges i 1 § har rätt till insatser i form av särskilt stöd …",
    "text": "<snippet id=\"snip_3f0a\">…</snippet>"
  }
}

Request

ParameterDescription
id
string·path·required
The id GET /v1/snippets returned for this source.

Errors

A source belonging to another organisation answers 403 here, where the list endpoint's key lookup answers 404. The difference is that a document id is not something a caller can guess its way to, so there is nothing to protect by conflating the two.

ErrorWhen
401
UNAUTHORIZED
The Authorization header is missing, is not a readable bearer token, or names no tenant.
401
TOKEN_EXPIRED
The access token was issued by this gateway and has since expired. Not probed: it needs a token older than its own lifetime.
403
FORBIDDEN
The source exists but belongs to another tenant. Not probed: it needs a source owned by a second tenant.
404
NOT_FOUND
No source with that id.
500
INTERNAL_ERROR
An unexpected server-side failure. Not probable from outside — reaching it means something is wrong.

Send it without writing a client

If your organisation already has an account, an administrator can read a source from the API tester at /admin/api-tester, which fills the :id segment in for you.