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.
Before you begin
Make sure you have:- Access token: Obtained in Step 1: Authenticate.
- Instance ID: The
instanceIdreturned by/journey/startwhen the journey started.
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
Step 2: Delete the journey session
Send aPOST 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 returns200 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/fetchrequest for the sameinstanceIdreturns a500error with the messageServer setup has some issues. - A second
/journey/state/deleterequest returns a400error with the identifierjourney-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 aloggerMessage 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).FAQ
Does deleting a journey session delete all customer data?
Does deleting a journey session delete all customer data?
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.
Can I delete a journey that's still in progress?
Can I delete a journey that's still in progress?
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.Is it safe to retry a delete request?
Is it safe to retry a delete request?
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.