import requests
url = "https://platform.ankra.app/org/applications/{application_id}/setup-contract"
payload = { "options": {} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({options: {}})
};
fetch('https://platform.ankra.app/org/applications/{application_id}/setup-contract', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://platform.ankra.app/org/applications/{application_id}/setup-contract \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"options": {}
}'{
"outcome": "applied",
"changes": [
{
"option": "<string>",
"from": "<string>",
"to": "<string>"
}
],
"already_matching": [
"<string>"
],
"refusals": [
{
"reason": "<string>",
"option": "<string>"
}
],
"commit_sha": "<string>",
"pull_request_url": "<string>",
"setup_branch": "<string>",
"contract_store_failure": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Revise an application's proposed setup contract
Change named defaults on the application’s deploy option contract. The revised .ankra/ankra.yaml is committed to the setup branch and the stored parameters are reprojected from it; nothing is deployed. The revision is all-or-nothing: any refused member leaves the proposal exactly as it was. Every answered request is a 200 whose outcome the client must switch on - a refusal carries its reasons in refusals rather than as an empty changes list.
import requests
url = "https://platform.ankra.app/org/applications/{application_id}/setup-contract"
payload = { "options": {} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({options: {}})
};
fetch('https://platform.ankra.app/org/applications/{application_id}/setup-contract', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://platform.ankra.app/org/applications/{application_id}/setup-contract \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"options": {}
}'{
"outcome": "applied",
"changes": [
{
"option": "<string>",
"from": "<string>",
"to": "<string>"
}
],
"already_matching": [
"<string>"
],
"refusals": [
{
"reason": "<string>",
"option": "<string>"
}
],
"commit_sha": "<string>",
"pull_request_url": "<string>",
"setup_branch": "<string>",
"contract_store_failure": "<string>"
}{
"detail": "<string>"
}{
"detail": "<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
Body
Named deploy-option defaults to change. The object maps option name to the new default value, which is the shape the deploy contract itself stores. Every value is a string: the contract stores every option default as text.
Show child attributes
Show child attributes
Response
Successful Response
The answer to a revision request. Every answered request is a 200 carrying outcome; a refusal is a domain answer whose reasons the user has to read, not a malformed request. changes and refusals are always arrays.
What the revision request did. Clients switch on this: reading the changes list alone would render a refusal exactly like a request that needed no change. "applied" - the contract was rewritten, committed to the setup branch and reprojected onto the stored parameters. "already_matching" - every named default already held the requested value, so nothing was committed. "refused" - the proposal was left exactly as it was and refusals says why. "applied_contract_not_stored" - the revised descriptor was committed but the stored contract could not be reprojected from it, so the repository and the deploy form now describe different options.
applied, already_matching, refused, applied_contract_not_stored Show child attributes
Show child attributes
Show child attributes
Show child attributes