Skip to content

Execute or decline an AI suggestion

POST
/projects/{id}/ai-suggestions/{suggestionId}/action
curl --request POST \
--url https://example.com/api/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/ai-suggestions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/action \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "action": "execute", "reason": "example" }'

Executes pending close suggestions via the canonical merge-close sink or declines them.

id
required
string format: uuid

Project UUID

suggestionId
required
string format: uuid

AI suggestion row UUID

Media type application/json
object
action
required
string
Allowed values: execute decline
reason
string
<= 2000 characters

Updated suggestion; execute responses may include apply_result

Media type application/json
object
suggestion
required
object
id
required
string format: uuid
run_id
required
string format: uuid
ticket_id
required
string format: uuid
ticket_title
required
string | null
ticket_number
required
integer | null
suggestion_type
required
string
Allowed values: auto_close close_suggestion
confidence
required
number | null
evidence
required

Arbitrary JSON evidence payload

object
suggested_action
required
string | null
status
required
string
Allowed values: pending processing executed declined expired skipped
source
string | null
merge_sha
string | null
pr_number
integer | null
repo
string | null
created_at
string format: date-time
apply_result
object
merged
boolean
new_stage
string
roles_marked_done
Array<string>

Invalid request

Media type application/json
object
error
required

Human-readable error message

string
code

Stable machine-readable error code for client branching

string
fieldErrors

First validation message per field path

object
key
additional properties
string
issues

Structured validation issues (Zod)

Array<object>
object
path
required
string
message
required
string
retryAfter

Seconds until rate limit resets (429 responses)

number

Not authenticated

Media type application/json
object
error
required

Human-readable error message

string
code

Stable machine-readable error code for client branching

string
fieldErrors

First validation message per field path

object
key
additional properties
string
issues

Structured validation issues (Zod)

Array<object>
object
path
required
string
message
required
string
retryAfter

Seconds until rate limit resets (429 responses)

number
reconnect

True if re-linking GitHub may fix the issue

boolean

Forbidden

Media type application/json
object
error
required

Human-readable error message

string
code

Stable machine-readable error code for client branching

string
fieldErrors

First validation message per field path

object
key
additional properties
string
issues

Structured validation issues (Zod)

Array<object>
object
path
required
string
message
required
string
retryAfter

Seconds until rate limit resets (429 responses)

number

Not found

Media type application/json
object
error
required

Human-readable error message

string
code

Stable machine-readable error code for client branching

string
fieldErrors

First validation message per field path

object
key
additional properties
string
issues

Structured validation issues (Zod)

Array<object>
object
path
required
string
message
required
string
retryAfter

Seconds until rate limit resets (429 responses)

number

Suggestion is not pending or lost a concurrent update race

Media type application/json
object
error
string

Server error

Media type application/json
object
error
required

Human-readable error message

string
code

Stable machine-readable error code for client branching

string
fieldErrors

First validation message per field path

object
key
additional properties
string
issues

Structured validation issues (Zod)

Array<object>
object
path
required
string
message
required
string
retryAfter

Seconds until rate limit resets (429 responses)

number