Product

Product Features SDLC How to Compare Docs Screenshots

Start here

Getting started Download Questions

More

Security Roadmap About

Pipelines

Ask for and change an exception through the API

A token does what its owner could do on the screen. Make one on the IDE tokens page with the reports scope. The pipeline kit on the same page has the same calls as ready made scripts.

What to do

  1. Find the finding. You only get back what you can open in the web app.

    curl -sS -H "Authorization: Bearer $TOKEN" \
      "$GCR/api/v1/findings?limit=20"
  2. Ask for the exception. The reason needs at least twenty characters, and it needs a date to end. It waits for an administrator, even on an administrator's token.

    curl -sS -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
      -d '{"reason":"Internal tool behind the VPN, replaced in Q1.","expires":"2027-01-31"}' \
      "$GCR/api/v1/findings/4182/exceptions"
  3. Change it. On a rejected or withdrawn one this resubmits it. An approved one goes back to waiting, and its finding returns to the reports until somebody agrees again.

    curl -sS -X PATCH -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
      -d '{"expires":"2027-03-31"}' "$GCR/api/v1/exceptions/77"
  4. Withdraw it if it is no longer needed.

    curl -sS -X POST -H "Authorization: Bearer $TOKEN" "$GCR/api/v1/exceptions/77/withdraw"
  5. Find your requests by id, by status, or by the finding's GCR id.

    curl -sS -H "Authorization: Bearer $TOKEN" "$GCR/api/v1/exceptions?status=requested"

A tip

Approving, rejecting and writing exclusions need the separate approve scope, which only an administrator's token can carry. A pipeline token that leaks can ask, and cannot hide anything. The API reference tab lists every call and downloads an OpenAPI file and a Postman collection.

Other guides