> ## Documentation Index
> Fetch the complete documentation index at: https://docs.go.gbgplc.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete journey state

> Delete a completed journey session. 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 `409`. The API returns `200` when it schedules the deletion, and the deletion runs shortly afterwards. To confirm the deletion, call `/journey/state/fetch` until it returns an error. For more details, see the [delete journey data guide](/docs/go-v1/tutorials/delete-journey-session).

> [!WARNING]
>
> 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](https://docs.go.gbgplc.com/docs/go-v1/platform/investigate/delete-journey-session.md) in the Investigation portal.

For step-by-step instructions, see [Delete journey data with the API](https://docs.go.gbgplc.com/docs/go-v1/tutorials/delete-journey-session.md).


## OpenAPI

````yaml docs/go-v1/openapi-v1.json POST /journey/state/delete
openapi: 3.0.3
info:
  title: GBG GO API Reference
  description: >-
    The GBG GO API enables authentication, customer journey execution, task
    management, and tracking verification progress.
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://eu.platform.go.gbgplc.com/captain/api
  - url: https://us.platform.go.gbgplc.com/captain/api
  - url: https://au.platform.go.gbgplc.com/captain/api
  - url: https://api.auth.gbgplc.com/as/token.oauth2
security:
  - bearerAuth: []
paths:
  /journey/state/delete:
    post:
      summary: Delete journey state
      description: >-
        Delete a completed journey session. 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 `409`. The API returns
        `200` when it schedules the deletion, and the deletion runs shortly
        afterwards. To confirm the deletion, call `/journey/state/fetch` until
        it returns an error. For more details, see the [delete journey data
        guide](/docs/go-v1/tutorials/delete-journey-session).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                instanceId:
                  type: string
                  description: >-
                    Unique identifier for the journey instance to delete.
                    Returned when you start a journey.
                  example: PRC-b294e258-d918-11f1-9747-46db552413b4
              required:
                - instanceId
      responses:
        '200':
          description: >-
            Deletion scheduled. The deletion runs shortly after the response
            returns. To confirm it, call `/journey/state/fetch` until it returns
            an error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  instanceId:
                    type: string
                    description: Unique identifier for the journey instance to delete.
                    example: PRC-b294e258-d918-11f1-9747-46db552413b4
                required:
                  - instanceId
        '400':
          description: >-
            Bad request. The access token is missing or invalid, the body has no
            `instanceId` or isn't valid JSON, or no journey with this
            `instanceId` is available to your organisation. A journey that's
            already deleted, an incorrect `instanceId`, and another
            organisation's journey all return the same
            `journey-instance-not-found` error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code.
                    example: 400
                  message:
                    type: string
                    description: Error message describing what went wrong.
                  error:
                    type: string
                    description: Error identifier.
                  loggerMessage:
                    type: string
                    description: >-
                      Internal diagnostic detail. It can change, so don't parse
                      it.
              examples:
                invalidToken:
                  summary: Missing or invalid access token
                  value:
                    status: 400
                    message: Invalid token
                    error: invalid-token
                    loggerMessage: 'Token validation error: GongHttpException: Invalid token'
                missingInstanceId:
                  summary: No instanceId in the body
                  value:
                    status: 400
                    message: Bad Request.
                    error: bad-request-error
                    loggerMessage: InstanceId is required
                journeyNotFound:
                  summary: No journey with this instanceId is available
                  value:
                    status: 400
                    message: >-
                      Error fetching the state: Please review the journey
                      instance id
                    error: journey-instance-not-found
                    loggerMessage: >-
                      Journey instance with id
                      PRC-2e8083d5-d919-11f1-bd16-5e93a4671847 not found. Error:
                      Request failed with status code 404
        '404':
          description: >-
            The method or path is wrong. For example, the request used `GET` or
            `DELETE` instead of `POST`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code.
                    example: 404
                  message:
                    type: string
                    description: Error message describing what went wrong.
                  error:
                    type: string
                    description: Error identifier.
                  loggerMessage:
                    type: string
                    description: >-
                      Internal diagnostic detail. It can change, so don't parse
                      it.
              examples:
                wrongMethod:
                  summary: GET instead of POST
                  value:
                    status: 404
                    message: Cannot GET /captain/api/journey/state/delete
                    error: not-found-error
        '409':
          description: >-
            The journey doesn't have the status `Completed`. This includes a
            journey that's still in progress and a journey that ended with the
            status `Error`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code.
                    example: 409
                  message:
                    type: string
                    description: Error message describing what went wrong.
                  error:
                    type: string
                    description: Error identifier.
                  loggerMessage:
                    type: string
                    description: >-
                      Internal diagnostic detail. It can change, so don't parse
                      it.
              examples:
                notCompleted:
                  summary: Journey doesn't have the status Completed
                  value:
                    status: 409
                    message: An inflight journey can not be deleted
                    error: journey-instance-not-found
                    loggerMessage: >-
                      The journey PRC-b294e258-d918-11f1-9747-46db552413b4 is
                      not available for delete.
        '500':
          description: >-
            An unexpected error occurred. Retry later. If the error repeats,
            then contact GBG support with the response body and the time of the
            request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code.
                    example: 500
                  message:
                    type: string
                    description: Error message describing what went wrong.
                  error:
                    type: string
                    description: Error identifier.
                  loggerMessage:
                    type: string
                    description: >-
                      Internal diagnostic detail. It can change, so don't parse
                      it.
                  path:
                    type: string
                    description: The request path.
                  timestamp:
                    type: string
                    format: date-time
                    description: When the error occurred.
              examples:
                unexpectedError:
                  summary: Unexpected error
                  value:
                    status: 500
                    message: Internal server error
                    error: default-error
                    path: /captain/api/journey/state/delete
                    timestamp: '2026-11-05T12:59:50.464Z'
        '503':
          description: Service unavailable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code.
                    example: 503
                  message:
                    type: string
                    description: Error message describing what went wrong.
                  error:
                    type: string
                    description: Error identifier.
                  loggerMessage:
                    type: string
                    description: >-
                      Internal diagnostic detail. It can change, so don't parse
                      it.
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````