> You are reading the Docusign Developer Documentation. For clean Markdown of any page, append .md to the page URL.
>
> Documentation indexes by section:
> - APIs and SDKs: https://docusign.docs.buildwithfern.com/docs/llms.txt
> - Platform 101: https://docusign.docs.buildwithfern.com/platform/llms.txt
> - Extension Apps: https://docusign.docs.buildwithfern.com/extension-apps/llms.txt
> - Docusign CLI: https://docusign.docs.buildwithfern.com/docusign-cli/llms.txt
>
> Authentication (OAuth, JWT Grant, M2M): https://docusign.docs.buildwithfern.com/platform/auth
> Webhooks and Connect: https://docusign.docs.buildwithfern.com/platform/webhooks
>
> OpenAPI specifications: https://docusign.docs.buildwithfern.com/openapi.json
> MCP server: https://docusign.docs.buildwithfern.com/_mcp/server

# Cancel running workflow instance

POST https://api-d.docusign.com/v1/accounts/{accountId}/workflows/{workflowId}/instances/{instanceId}/actions/cancel

This operation cancels a running Workflow Builder workflow instance by its unique identifier (`instanceId`).
Once canceled, the workflow instance will no longer continue executing any remaining steps.

### Use Cases:
- Stopping a workflow execution when it is no longer needed or relevant
- Manually intervening in a workflow to prevent it from reaching completion if conditions change

### Key Features:
- **Immediate Termination**: Ensures the workflow instance no longer processes subsequent steps
- **Clear Feedback**: Returns a confirmation message including both the instance and workflow identifiers


Reference: https://developers.docusign.com/docs/workflow-builder-api/reference/workflowbuilder/workflowinstancemanagement/cancelworkflowinstance

## Authentication

- `Authorization` header (bearer token, required) — OAuth2 authentication. - Demo: - authorizationUrl: https://account-d.docusign.com/oauth/auth - tokenUrl: https://account-d.docusign.com/oauth/token - Production: - authorizationUrl: https://account.docusign.com/oauth/auth - tokenUrl: https://account.docusign.com/oauth/token

## Servers

- `https://api-d.docusign.com` (Demo, default)
- `https://api.docusign.com` (Production)

## Request

### Path parameters

- `accountId` (string, required) — The unique identifier of the account.
- `workflowId` (string, required) — A universally unique identifier (UUID) in standard 8-4-4-4-12 format.
- `instanceId` (string, required) — Unique identifier for the workflow instance

## Response

### 200

A message confirming the instance was canceled, including the instance and workflow IDs

- `message` (string, optional)

## Errors

### 400 Bad Request Error

Bad Request - The request could not be understood or was missing required parameters.

- `type` (string, required) — A URI reference that identifies the problem type. Use 'about:blank' when the problem has no additional semantics beyond the HTTP status code.
- `title` (string, required) — A short, human-readable summary of the problem type.
- `status` (integer, required) — The HTTP status code.
- `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem.
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem (typically the request path).
- `timestamp` (datetime, optional) — The timestamp when the error occurred.
- `request_id` (string, optional) — Correlation identifier for the request, useful for support investigations.
- `errors` (list of ValidationError, optional) — Optional list of individual validation or domain errors.

### 401 Unauthorized Error

Unauthorized - Authentication is required and has failed or not been provided.

- `type` (string, required) — A URI reference that identifies the problem type. Use 'about:blank' when the problem has no additional semantics beyond the HTTP status code.
- `title` (string, required) — A short, human-readable summary of the problem type.
- `status` (integer, required) — The HTTP status code.
- `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem.
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem (typically the request path).
- `timestamp` (datetime, optional) — The timestamp when the error occurred.
- `request_id` (string, optional) — Correlation identifier for the request, useful for support investigations.
- `errors` (list of ValidationError, optional) — Optional list of individual validation or domain errors.

### 403 Forbidden Error

Forbidden - The request was valid, but you do not have permission to perform the action.

- `type` (string, required) — A URI reference that identifies the problem type. Use 'about:blank' when the problem has no additional semantics beyond the HTTP status code.
- `title` (string, required) — A short, human-readable summary of the problem type.
- `status` (integer, required) — The HTTP status code.
- `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem.
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem (typically the request path).
- `timestamp` (datetime, optional) — The timestamp when the error occurred.
- `request_id` (string, optional) — Correlation identifier for the request, useful for support investigations.
- `errors` (list of ValidationError, optional) — Optional list of individual validation or domain errors.

### 404 Not Found Error

Not Found - The requested resource could not be found.

- `type` (string, required) — A URI reference that identifies the problem type. Use 'about:blank' when the problem has no additional semantics beyond the HTTP status code.
- `title` (string, required) — A short, human-readable summary of the problem type.
- `status` (integer, required) — The HTTP status code.
- `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem.
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem (typically the request path).
- `timestamp` (datetime, optional) — The timestamp when the error occurred.
- `request_id` (string, optional) — Correlation identifier for the request, useful for support investigations.
- `errors` (list of ValidationError, optional) — Optional list of individual validation or domain errors.

### 409 Conflict Error

Conflict - The request conflicts with the current state of the resource.

- `type` (string, required) — A URI reference that identifies the problem type. Use 'about:blank' when the problem has no additional semantics beyond the HTTP status code.
- `title` (string, required) — A short, human-readable summary of the problem type.
- `status` (integer, required) — The HTTP status code.
- `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem.
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem (typically the request path).
- `timestamp` (datetime, optional) — The timestamp when the error occurred.
- `request_id` (string, optional) — Correlation identifier for the request, useful for support investigations.
- `errors` (list of ValidationError, optional) — Optional list of individual validation or domain errors.

### 500 Internal Server Error

Internal Server Error

- `type` (string, required) — A URI reference that identifies the problem type. Use 'about:blank' when the problem has no additional semantics beyond the HTTP status code.
- `title` (string, required) — A short, human-readable summary of the problem type.
- `status` (integer, required) — The HTTP status code.
- `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem.
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem (typically the request path).
- `timestamp` (datetime, optional) — The timestamp when the error occurred.
- `request_id` (string, optional) — Correlation identifier for the request, useful for support investigations.
- `errors` (list of ValidationError, optional) — Optional list of individual validation or domain errors.

## Types

### ValidationError

A single field-level or domain validation error.

- `code` (string, required) — Machine-readable error code.
- `message` (string, required) — Human-readable description of the error.
- `target` (string, optional) — The field or parameter this error relates to.

## Examples

**Response**

```json
{
  "message": "Successfully canceled the workflow instance {instanceId} in {workflowId}"
}
```