Skip to main content
To delete a journey session, send its instanceId to the /journey/state/delete endpoint. You can delete only journeys with the status Completed. For any other journey, including a journey that ended with the status Error, the API returns a 409 error.
This request deletes the journey’s data from the GBG Go API service only. It doesn’t delete the journey session record, documents, or biometrics in the Investigation portal. To delete those, for example for a GDPR erasure request, use Delete journey session in the Investigation portal.

Before you begin

Make sure you have:

Choose the base URL for your region

Use the base URL for the region where your journeys run. The examples on this page use the Europe base URL. If your journeys run in another region, then replace eu with us or au.

Step 1: Check that the journey has completed

This step is optional. If you’re not sure whether the journey has completed, then fetch its state first.
cURL
For the status values in the response, see Step 6: Fetch journey state.

Step 2: Delete the journey session

Send a POST request to /journey/state/delete with the instanceId in a JSON body. The endpoint uses the POST method, not the HTTP DELETE method.
cURL

Request headers

Request body fields

The API ignores any other fields in the request body.

Handle the response

The API returns 200 when it schedules the deletion, before the deletion runs. The response contains the instance ID of the journey.
JSON
The deletion runs a few seconds after the response. Until then, /journey/state/fetch can still return the journey, and a repeated delete request returns 200 again. In rare cases, a 200 response isn’t followed by a deletion. To confirm the deletion, call /journey/state/fetch until it returns an error.

After deletion

Once the deletion finishes, you can’t fetch or delete the journey again:
  • A /journey/state/fetch request for the same instanceId returns a 500 error with the message Server setup has some issues.
  • A second /journey/state/delete request returns a 400 error with the identifier journey-instance-not-found.

Error responses

Each error returns a body with the HTTP status, an error message, and an error identifier. Most errors also include a loggerMessage field:
JSON
Check the HTTP status as well as error. The identifier journey-instance-not-found is returned both for a journey that hasn’t completed (409) and for a journey that isn’t available to your organisation (400).
For help with these errors, see Handle errors.

FAQ

No. It deletes the journey’s data from the GBG Go API service only. To delete the journey session record, documents, and biometrics, use Delete journey session in the Investigation portal.
No. You can delete only journeys with the status Completed, and you can’t delete a journey that ended with the status Error. For any other journey, the API returns a 409 error.
Yes, a retry has no extra effect. If the deletion has run, then the retry returns a 400 error with the identifier journey-instance-not-found. If the deletion hasn’t run yet, then the retry returns 200 again.A 400 error doesn’t prove that the deletion ran, because the API also returns it for an incorrect instanceId. To confirm the deletion, check that a delete request for this instanceId returned 200, and that /journey/state/fetch for the same instanceId now returns an error.