Docs
POST /cancel_ai_run
https://heyeveryone.ai/api/v1/cancel_ai_run
Operation
{
"post": {
"description": "Stop an AI run (people, or the agent that started it): charged 0 if nothing was delivered yet, else what it used so far, at most its max.",
"operationId": "cancel_ai_run",
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"workspaceId": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
"type": "string"
},
"runId": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
"type": "string"
}
},
"required": [
"workspaceId",
"runId"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": false,
"properties": {
"run": {
"additionalProperties": false,
"properties": {
"id": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
"type": "string"
},
"workspaceId": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
"type": "string"
},
"type": {
"type": "string"
},
"status": {
"enum": [
"queued",
"running",
"succeeded",
"stopped_at_max",
"failed",
"cancelled"
],
"type": "string"
},
"limit": {
"type": [
"string",
"null"
]
},
"startedBy": {
"additionalProperties": false,
"properties": {
"kind": {
"enum": [
"member",
"agent"
],
"type": "string"
},
"accountId": {
"anyOf": [
{
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
"type": "string"
},
{
"type": "null"
}
]
},
"agentClientId": {
"anyOf": [
{
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"kind",
"accountId",
"agentClientId"
],
"type": "object"
},
"parentRunId": {
"anyOf": [
{
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
"type": "string"
},
{
"type": "null"
}
]
},
"input": {
"additionalProperties": {},
"propertyNames": {
"type": "string"
},
"type": "object"
},
"output": {
"additionalProperties": {},
"propertyNames": {
"type": "string"
},
"type": "object"
},
"error": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
}
},
"required": [
"code",
"message"
],
"type": "object"
},
{
"type": "null"
}
]
},
"cost": {
"additionalProperties": false,
"properties": {
"estimate": {
"additionalProperties": false,
"properties": {
"min": {
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
},
"max": {
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
},
"typical": {
"anyOf": [
{
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
},
{
"type": "null"
}
]
}
},
"required": [
"min",
"max",
"typical"
],
"type": "object"
},
"charged": {
"anyOf": [
{
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
},
{
"type": "null"
}
]
},
"soFar": {
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
},
"stoppedAtMax": {
"type": "boolean"
},
"continueEstimate": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"min": {
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
},
"max": {
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
}
},
"required": [
"min",
"max"
],
"type": "object"
},
{
"type": "null"
}
]
}
},
"required": [
"estimate",
"charged",
"soFar",
"stoppedAtMax",
"continueEstimate"
],
"type": "object"
},
"cancelRequested": {
"type": "boolean"
},
"deliveredAt": {
"anyOf": [
{
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"type": "string"
},
{
"type": "null"
}
]
},
"startedAt": {
"anyOf": [
{
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"type": "string"
},
{
"type": "null"
}
]
},
"endedAt": {
"anyOf": [
{
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"type": "string"
},
{
"type": "null"
}
]
},
"createdAt": {
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"type": "string"
}
},
"required": [
"id",
"workspaceId",
"type",
"status",
"limit",
"startedBy",
"parentRunId",
"input",
"output",
"error",
"cost",
"cancelRequested",
"deliveredAt",
"startedAt",
"endedAt",
"createdAt"
],
"type": "object"
}
},
"required": [
"run"
],
"type": "object"
}
}
},
"description": "Success"
},
"400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"description": "invalid_input: the body does not match the schema"
},
"401": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"description": "unauthenticated: missing, invalid, expired or revoked token"
},
"403": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"description": "forbidden: the agent may not do this (for example, another workspace)"
},
"404": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"description": "not_found"
},
"409": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"description": "conflict"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"description": "internal_error"
}
},
"summary": "Stop an AI run",
"tags": [
"workspace"
],
"x-heyeveryone-kind": "mutation"
}
}Referenced definitions
{
"schemas": {
"Error": {
"properties": {
"error": {
"description": "A stable error code, for example forbidden.",
"type": "string"
},
"message": {
"description": "What went wrong, in plain words.",
"type": "string"
}
},
"required": [
"error",
"message"
],
"type": "object"
}
},
"responses": {
"RateLimited": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"description": "rate_limited: too many requests from this agent, account or address (docs/setup/agents.md, Rate limits); wait the Retry-After seconds, then retry",
"headers": {
"Retry-After": {
"description": "Seconds to wait before retrying.",
"schema": {
"minimum": 1,
"type": "integer"
}
}
}
}
}
}Authentication
{
"bearer": {
"description": "Personal access token (hey_pat_...)",
"scheme": "bearer",
"type": "http"
},
"oauth": {
"flows": {
"authorizationCode": {
"authorizationUrl": "https://heyeveryone.ai/oauth/authorize",
"refreshUrl": "https://heyeveryone.ai/oauth/token",
"scopes": {
"agent": "Act as your agent in the workspaces you choose"
},
"tokenUrl": "https://heyeveryone.ai/oauth/token"
}
},
"type": "oauth2"
}
}Security requirements
[
{
"bearer": []
},
{
"oauth": [
"agent"
]
}
]