GRANSKA

Remove an example document

DELETEhttps://api.granska.cloud/v1/examples/:exampleId

Removes an example document this organisation published, together with the frozen åtgärd answers under it.

Bearer tokenSpends no quota

What it removes

The example document and everything stored beneath it: the document, the stored audit, and any pre-written åtgärder published against it — the actions that GET /v1/examples/:profileId lists. All of it goes in one operation, so you never end up with answers left behind for an example that no longer exists.

Either the whole example is removed or none of it is. A request that fails leaves the example exactly as it was, still listed and still deletable.

Request
curl -X DELETE https://api.granska.cloud/v1/examples/tenant_9f3a_example_7QpL2vRk8mTx \
  -H "Authorization: Bearer $TOKEN"
Response
{
  "success": true,
  "message": "Example document and its frozen actions successfully deleted."
}

What you may remove

Examples your own organisation published, and those only.

  • A shared example — one that appears for every organisation — answers 403. Those belong to the platform; tell us and we will withdraw one.
  • An example belonging to another organisation answers 404, which is the same answer as an id that never existed. That is deliberate: the two cannot be told apart from outside, so this endpoint cannot be used to find out what anybody else has published.

Deleting is not un-publishing

An example is readable by your whole organisation while it exists — see the first section of the create page. Removing it stops it being served from here; it does not reach anything that already read it. Treat the decision to publish as the one that matters.

Request

ParameterDescription
exampleId
string·path·required
The id POST /v1/examples minted, which is also the id GET /v1/examples/:profileId lists it under.

Errors

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 example is a shared one. Those belong to the platform and are removed by us, not by a client. Not probed: it needs the id of a shared example, which the probe would then be asking to delete.
404
NOT_FOUND
No example with that id, or it belongs to another organisation — the two are one answer on purpose, so a caller cannot learn what another organisation has published by asking.
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 remove an example from the API tester at /admin/api-tester, or from the admin panel where it was published.