import requests
url = "https://platform.ankra.app/api/v1/org/ai-gateway/scm-bindings/{provider}/{binding_external_id}"
payload = {
"ai_review": True,
"mention_replies": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ai_review: true, mention_replies: true})
};
fetch('https://platform.ankra.app/api/v1/org/ai-gateway/scm-bindings/{provider}/{binding_external_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/ai-gateway/scm-bindings/{provider}/{binding_external_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ai_review": true,
"mention_replies": true
}
'{
"success": true,
"provider": "<string>",
"binding_external_id": "<string>",
"ai_review": true,
"mention_replies": true,
"pr_previews": true,
"merge_when_green": true,
"review_model": "<string>",
"review_drafts": true,
"max_reviews_per_pr": 123,
"custom_instructions": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Update a source-control binding's AI review switches
Organisation admin only. ai_review and mention_replies are required; every other member is optional and an omitted member keeps its stored value. merge_when_green is the switch behind merge-when-green: with it on, and the binding’s AI mode set to Agent, an ‘@ankraai merge when green’ comment, the portal button or the scm_merge_pull_request tool records a merge intent that Ankra settles once the pull request is green.
import requests
url = "https://platform.ankra.app/api/v1/org/ai-gateway/scm-bindings/{provider}/{binding_external_id}"
payload = {
"ai_review": True,
"mention_replies": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ai_review: true, mention_replies: true})
};
fetch('https://platform.ankra.app/api/v1/org/ai-gateway/scm-bindings/{provider}/{binding_external_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/ai-gateway/scm-bindings/{provider}/{binding_external_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ai_review": true,
"mention_replies": true
}
'{
"success": true,
"provider": "<string>",
"binding_external_id": "<string>",
"ai_review": true,
"mention_replies": true,
"pr_previews": true,
"merge_when_green": true,
"review_model": "<string>",
"review_drafts": true,
"max_reviews_per_pr": 123,
"custom_instructions": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The source-control provider of the binding: github, gitlab or bitbucket.
The provider's own id of the binding: the GitHub App installation id, the GitLab or Bitbucket credential id.
Body
Omitted keeps the stored value.
Switches merge-when-green on for the binding. Omitted keeps the stored value. The binding's AI mode must also be Agent for a request to be honoured.
An organisation model-catalog key; the empty string inherits the platform default; omitted keeps the stored value.
Omitted keeps the stored value.
0 means no cap; omitted keeps the stored value.
The empty string clears it; omitted keeps the stored value.