Skip to content

Agent

DELETE /v2/agent/{job_id}

Copy page

Cancel an agent run.

DELETE /v2/agent/{job_id}

Authentication: your key as a bearer token.

Path parameters

FieldTypeRequiredDefault
job_idstringRequired

Request

bash
curl -X DELETE https://api.darkcrawl.dev/v2/agent/JOB_ID \
  -H "Authorization: Bearer $DARKCRAWL_API_KEY"

Response

Status 200.

Response
{
  "success": true
}

Errors

CodeStatus
NOT_FOUND404
CONFLICT409

What each code means, and what to do about it: Errors.

Notes

  • A run that is going stops at its next check, and one that is waiting ends at once. Both then read failed, with the error Agent was cancelled.
  • A run that has already finished answers 409 CONFLICT with the message Agent already finished.
  • An unknown or expired job, and another company's job, answer 404 NOT_FOUND.