---
title: "Cancel agent execution"
url: "https://developers.bynder.com/apis/agents/versions/f5aecf98-613e-4ae8-b26a-ec2cdf804b2c/operations/cancelAgentExecution"
---

> Full API specification: https://developers.bynder.com/apis/agents/versions/f5aecf98-613e-4ae8-b26a-ec2cdf804b2c.md

# Cancel agent execution

`POST` `/api/1/agent/executions/{id}/cancel`

Operation ID: `cancelAgentExecution`

Cancels an agent execution that have not finished yet.

## Path parameters

- `id` (string, uuid, required) - Id of the agent execution

## Responses

- `204` - Cancellation processed (or nothing to cancel)
- `401` - Missing or invalid bearer token
- `403` - Caller lacks the required permission for this operation
- `404` - Resource not found
- `429` - Caller exceeded its configured request rate
- `5XX` - Gateway or a downstream service failed to process the request

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: AI Agents
  version: "1.0"
servers:
  - url: https://{your-bynder-domain}/
paths:
  /api/1/agent/executions/{id}/cancel:
    post:
      tags:
        - Executions
      summary: Cancel agent execution
      operationId: cancelAgentExecution
      description: Cancels an agent execution that have not finished yet.
      parameters:
        - $ref: "#/components/parameters/ExecutionId"
      responses:
        "204":
          description: Cancellation processed (or nothing to cancel)
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/TooManyRequests"
        5XX:
          $ref: "#/components/responses/ServerError"
security:
  - bearerAuth: []
components:
  parameters:
    ExecutionId:
      name: id
      in: path
      required: true
      description: Id of the agent execution
      schema:
        type: string
        format: uuid
  responses:
    Unauthorized:
      description: Missing or invalid bearer token
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
    Forbidden:
      description: Caller lacks the required permission for this operation
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
    TooManyRequests:
      description: Caller exceeded its configured request rate
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
    ServerError:
      description: Gateway or a downstream service failed to process the request
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
  schemas:
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
```
