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

# Cancel journey

> Used to cause a user or a list of users to finish a multi-stage journey, preventing them from receiving more messages.

## OpenAPI

````json POST /cancel-journey/campaign
{
  "openapi": "3.1.0",
  "info": {
    "title": "external-api",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.eu.xtremepush.com/api/external"
    }
  ],
  "paths": {
    "/cancel-journey/campaign": {
      "post": {
        "summary": "Cancel journey",
        "description": "Used to cause a user or a list of users to finish a multi-stage journey, preventing them from receiving more messages.",
        "operationId": "cancel-journey",
        "deprecated": "false",
        "security": [],
        "requestBody": {
          "required": "true",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "apptoken",
                  "campaign_id"
                ],
                "properties": {
                  "apptoken": {
                    "type": "string",
                    "description": "Your app token"
                  },
                  "campaign_id": {
                    "type": "integer",
                    "format": "int32",
                    "description": "ID of the workflow campaign"
                  },
                  "target_by": {
                    "type": "string",
                    "description": "Specify the type of identifier used in target. Allowed values: `user_id` (unique client-defined ID), `email`, `profile_id` (Xtremepush profile ID)."
                  },
                  "target": {
                    "type": "string",
                    "description": "Targeted ID, type defined by `target_by`. Eg. `\"user1\"`."
                  }
                }
              },
              "examples": {
                "Cancel journey for a user": {
                  "value": {
                    "apptoken": "YOUR_APPTOKEN",
                    "campaign_id": "CAMPAIGN_ID",
                    "target_by": "user_id",
                    "target": "USER_ID"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "success": "true",
                      "code": "200",
                      "message": {
                        "campaign_id": "CAMPAIGNID",
                        "profile_id": "PROFILEID",
                        "0": {
                          "workflow_id": "WORKFLOWID",
                          "new_cancelled_journeys": "0",
                          "already_cancelled": "1",
                          "already_completed": "0"
                        },
                        "new_cancelled_journeys_total": "0",
                        "already_cancelled_total": "1",
                        "already_completed_total": "0"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": "false",
                      "default": "true"
                    },
                    "code": {
                      "type": "integer",
                      "example": "400",
                      "default": "0"
                    },
                    "errors": {
                      "type": "object"
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": {
                      "success": "false",
                      "code": "400",
                      "message": "General error information",
                      "errors": [
                        {
                          "text": [
                            "Detailed information about the specific error"
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Campaign Methods"
        ]
      }
    }
  }
}
````

