import requests
url = "https://api.platform.ankra.app/org/applications/{application_id}/subject-state"
headers = {"cookie": "ankra_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'ankra_session='}};
fetch('https://api.platform.ankra.app/org/applications/{application_id}/subject-state', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.platform.ankra.app/org/applications/{application_id}/subject-state \
--cookie ankra_session={
"subject": {
"kind": "<string>",
"application_id": "<string>",
"environment": "<string>",
"cluster_id": "<string>",
"namespace": "<string>",
"deploy_run_id": "<string>"
},
"read_at": "<string>",
"application": {
"status": "present",
"reason": "<string>",
"name": "<string>",
"repository": "<string>",
"branch": "<string>",
"state": "<string>",
"error_message": "<string>"
},
"binding": {
"status": "present",
"reason": "<string>",
"place": {
"cluster_id": "<string>",
"cluster_name": "<string>",
"namespace": "<string>",
"installation_id": "<string>",
"status": "<string>",
"environment_id": "<string>",
"environment_name": "<string>",
"cluster_outside_projects": true
},
"places": [
{
"cluster_id": "<string>",
"cluster_name": "<string>",
"namespace": "<string>",
"installation_id": "<string>",
"status": "<string>",
"environment_id": "<string>",
"environment_name": "<string>",
"cluster_outside_projects": true
}
]
},
"health": {
"status": "present",
"pods": {
"status": "present",
"total": 123,
"ready": 123,
"reason": "<string>",
"problems": [
{
"pod": "<string>",
"container": "<string>",
"reason": "<string>",
"message": "<string>"
}
],
"observed_at": "<string>"
},
"reason": "<string>",
"deployment_state": "<string>",
"state_message": "<string>",
"state_changed_at": "<string>",
"first_healthy_at": "<string>",
"last_live_at": "<string>"
},
"deploy_runs": {
"status": "present",
"runs": [
{
"id": "<string>",
"status": "<string>",
"created_at": "<string>",
"error_message": "<string>",
"error_code": "<string>",
"cluster_id": "<string>",
"cluster_name": "<string>",
"namespace": "<string>",
"finished_at": "<string>",
"cluster_outside_projects": true
}
],
"capped": true,
"reason": "<string>"
},
"builds": {
"status": "present",
"builds": [
{
"id": "<string>",
"status": "<string>",
"ref": "<string>",
"head_sha": "<string>",
"reason": "<string>",
"component": "<string>",
"error_class": "<string>",
"error_message": "<string>",
"started_at": "<string>",
"finished_at": "<string>"
}
],
"capped": true,
"reason": "<string>"
},
"pull_requests": {
"status": "present",
"ai_reviews": [
{
"url": "<string>",
"merge_state": "<string>",
"number": 123,
"title": "<string>",
"merged_at": "<string>",
"closed_at": "<string>",
"verdict": "<string>",
"summary": "<string>",
"branch": "<string>",
"head_sha": "<string>",
"lane": "<string>",
"created_at": "<string>"
}
],
"reason": "<string>",
"setup_pull_request": {
"url": "<string>",
"merge_state": "<string>",
"number": 123,
"title": "<string>",
"merged_at": "<string>",
"closed_at": "<string>",
"verdict": "<string>",
"summary": "<string>",
"branch": "<string>",
"head_sha": "<string>",
"lane": "<string>",
"created_at": "<string>"
}
},
"tickets": {
"status": "present",
"tickets": [
{
"id": "<string>",
"title": "<string>",
"status": "<string>",
"kind": "<string>",
"created_at": "<string>"
}
],
"reason": "<string>"
},
"platform_errors": {
"status": "present",
"errors": [
{
"message": "<string>",
"source": "<string>",
"source_id": "<string>",
"code": "<string>",
"occurred_at": "<string>",
"remedy": {
"kind": "deploy_again",
"label": "<string>",
"description": "<string>"
}
}
],
"reason": "<string>"
},
"chat_actions": {
"status": "present",
"actions": [
{
"action_id": "<string>",
"tool_name": "<string>",
"status": "<string>",
"created_at": "<string>",
"description": "<string>",
"completed_at": "<string>"
}
],
"reason": "<string>"
}
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get an application's subject state (browser session)
One platform read of everything Ankra records about the application in an environment (ankra-ab5fog.8): the application’s record, the place it runs (the one the query names by cluster and namespace, else the environment’s one deployment, else every place listed), the installation’s current state and the k8s mirror’s view of its pods, the newest deploy runs and platform builds with their errors, the setup pull request and the reviews Ankra AI wrote, the active platform errors with the remedy their code names, and the named conversation’s actions on it. Every section is three-state: a read that failed or was never attempted is unknown, never empty. Requires applications.read.
import requests
url = "https://api.platform.ankra.app/org/applications/{application_id}/subject-state"
headers = {"cookie": "ankra_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'ankra_session='}};
fetch('https://api.platform.ankra.app/org/applications/{application_id}/subject-state', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.platform.ankra.app/org/applications/{application_id}/subject-state \
--cookie ankra_session={
"subject": {
"kind": "<string>",
"application_id": "<string>",
"environment": "<string>",
"cluster_id": "<string>",
"namespace": "<string>",
"deploy_run_id": "<string>"
},
"read_at": "<string>",
"application": {
"status": "present",
"reason": "<string>",
"name": "<string>",
"repository": "<string>",
"branch": "<string>",
"state": "<string>",
"error_message": "<string>"
},
"binding": {
"status": "present",
"reason": "<string>",
"place": {
"cluster_id": "<string>",
"cluster_name": "<string>",
"namespace": "<string>",
"installation_id": "<string>",
"status": "<string>",
"environment_id": "<string>",
"environment_name": "<string>",
"cluster_outside_projects": true
},
"places": [
{
"cluster_id": "<string>",
"cluster_name": "<string>",
"namespace": "<string>",
"installation_id": "<string>",
"status": "<string>",
"environment_id": "<string>",
"environment_name": "<string>",
"cluster_outside_projects": true
}
]
},
"health": {
"status": "present",
"pods": {
"status": "present",
"total": 123,
"ready": 123,
"reason": "<string>",
"problems": [
{
"pod": "<string>",
"container": "<string>",
"reason": "<string>",
"message": "<string>"
}
],
"observed_at": "<string>"
},
"reason": "<string>",
"deployment_state": "<string>",
"state_message": "<string>",
"state_changed_at": "<string>",
"first_healthy_at": "<string>",
"last_live_at": "<string>"
},
"deploy_runs": {
"status": "present",
"runs": [
{
"id": "<string>",
"status": "<string>",
"created_at": "<string>",
"error_message": "<string>",
"error_code": "<string>",
"cluster_id": "<string>",
"cluster_name": "<string>",
"namespace": "<string>",
"finished_at": "<string>",
"cluster_outside_projects": true
}
],
"capped": true,
"reason": "<string>"
},
"builds": {
"status": "present",
"builds": [
{
"id": "<string>",
"status": "<string>",
"ref": "<string>",
"head_sha": "<string>",
"reason": "<string>",
"component": "<string>",
"error_class": "<string>",
"error_message": "<string>",
"started_at": "<string>",
"finished_at": "<string>"
}
],
"capped": true,
"reason": "<string>"
},
"pull_requests": {
"status": "present",
"ai_reviews": [
{
"url": "<string>",
"merge_state": "<string>",
"number": 123,
"title": "<string>",
"merged_at": "<string>",
"closed_at": "<string>",
"verdict": "<string>",
"summary": "<string>",
"branch": "<string>",
"head_sha": "<string>",
"lane": "<string>",
"created_at": "<string>"
}
],
"reason": "<string>",
"setup_pull_request": {
"url": "<string>",
"merge_state": "<string>",
"number": 123,
"title": "<string>",
"merged_at": "<string>",
"closed_at": "<string>",
"verdict": "<string>",
"summary": "<string>",
"branch": "<string>",
"head_sha": "<string>",
"lane": "<string>",
"created_at": "<string>"
}
},
"tickets": {
"status": "present",
"tickets": [
{
"id": "<string>",
"title": "<string>",
"status": "<string>",
"kind": "<string>",
"created_at": "<string>"
}
],
"reason": "<string>"
},
"platform_errors": {
"status": "present",
"errors": [
{
"message": "<string>",
"source": "<string>",
"source_id": "<string>",
"code": "<string>",
"occurred_at": "<string>",
"remedy": {
"kind": "deploy_again",
"label": "<string>",
"description": "<string>"
}
}
],
"reason": "<string>"
},
"chat_actions": {
"status": "present",
"actions": [
{
"action_id": "<string>",
"tool_name": "<string>",
"status": "<string>",
"created_at": "<string>",
"description": "<string>",
"completed_at": "<string>"
}
],
"reason": "<string>"
}
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Query Parameters
Response
The subject state, every section with its own presence
One platform read of everything Ankra records about an application in an environment. Every section is three-state: present, absent (a successful read that found nothing) or unknown (the read failed or was never attempted; never a negative).