Skip to main content
Perplexity

Search documentation

Type to search this documentation.

Cancel Agent Response

POST

/

v1

/

agent

/

/

cancel

Cancel Agent Response

curl --request POST \
  --url https://api.perplexity.ai/v1/agent/{id}/cancel \
  --header 'Authorization: Bearer <token>'
title="200"
{
  "response_id": "<string>",
  "status": "cancelling"
}
title="400"
{
  "error": {
    "message": "<string>",
    "code": "<string>",
    "type": "<string>"
  }
}
title="404"
{
  "error": {
    "message": "<string>",
    "code": "<string>",
    "type": "<string>"
  }
}

Authorization

string

header

required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

id

string

required

Response id (resp_<...>)

The cancel request was accepted; the run is being cancelled.

response_id

string

required

The response id (resp_<...>).

status

enum<string>

required

Always cancelling - the cancel was accepted and the run stops asynchronously. An already-terminal run returns 400 instead, so no terminal status appears here.

Available options:

cancelling

Was this page helpful?

⌘I

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu