Syndai Docs

Revert a landed change

POST
/api/v1/external/coding/runs/{coding_run_id}/revert

Starts a revert run that undoes the change this run landed, and returns that run with its landing. Starting a revert is a new run of its own, so it does work like any run; calling again while a revert is open returns the same one. Returns 409 when the change has not landed, or when newer changes landed on top of it and force is not set. An API key may call this; a signed-in person must be a workspace owner or admin (403). 404 when the run did not land on its own.

Authorization

CustomerApiKey
headerAuthorizationBearer <API Key>

Customer API key sent as a bearer token

Path Parameters

coding_run_id*string
Formatuuid

Query Parameters

customer_id?|null

Request Body

application/json
  1. body
force?boolean
Defaultfalse

Response Body

Request fulfilled, document follows

application/json
  1. response
land*
run*
Example Request
curl -X POST 'https://api.syndai.ai/api/v1/external/coding/runs/497f6eca-6276-4993-bfeb-53cbbbba6f08/revert' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "land": {    "can_merge_anyway": false,    "commit_url": "string",    "deploy_status": "string",    "head_sha": "string",    "landed_sha": "string",    "live_url": "string",    "owner_step": "string",    "reason": "string",    "revert_of_run_id": "1e306a3f-a1e3-4923-8323-dbe1421af629",    "reverted_by_run_id": "51dd706d-ba27-424b-9048-1cd1baa3613f",    "security": {      "access": {        "intended": [          {            "quote": "string",            "sentence": "string"          }        ],        "members_see": [          "string"        ],        "unchecked": [          "string"        ],        "visitors_add": [          "string"        ],        "visitors_see": [          "string"        ]      },      "fixed": [        {          "proved": true,          "sentence": "string"        }      ],      "held": [        {          "file": "string",          "proved": true,          "sentence": "string",          "severity": "string"        }      ],      "state": "string"    },    "state": "string",    "strategy": "string",    "verified": true  },  "run": {    "api_value_usd": 0,    "artifact_retention_profile": "string",    "attention": {      "attention_at": "2019-08-24T14:15:22Z",      "attention_class": 0,      "note": "string",      "pause_kind": "string",      "resume_at": "2019-08-24T14:15:22Z",      "state": "string",      "state_entered_at": "2019-08-24T14:15:22Z",      "unread": false    },    "auto_run_kind": "string",    "autonomy_mode": "review",    "base_branch": "string",    "cap_usd": 0,    "chain": {      "root_run_id": "string",      "sequence": 0,      "slices": [        {          "feature_key": "string",          "run_id": "string",          "sequence": 0,          "state": "string",          "title": "string"        }      ],      "total": 0    },    "charged_usd": 0,    "coding_project_id": "683a2bf2-1a01-4056-990f-d7c9b6f3ef2e",    "coding_repository_id": "0d18edb4-5201-4374-8af8-14fdbf761813",    "created_at": "2019-08-24T14:15:22Z",    "current_activity_kind": "string",    "current_activity_since": "string",    "current_activity_target": "string",    "current_phase": "string",    "delivery_status": "string",    "economy": false,    "effective_resolution_sha256": "string",    "egress_profile": "string",    "environment_id": "40ef0e48-a11f-4963-a229-e396c9f7e7c4",    "external_request_id": "string",    "failure_origin": "string",    "harness_kind": "string",    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "ingress": {      "category": "string",      "excerpt": "string",      "inherited": false,      "source": "string",      "url": "string"    },    "land": {      "can_merge_anyway": false,      "commit_url": "string",      "deploy_status": "string",      "head_sha": "string",      "landed_sha": "string",      "live_url": "string",      "owner_step": "string",      "reason": "string",      "revert_of_run_id": "1e306a3f-a1e3-4923-8323-dbe1421af629",      "reverted_by_run_id": "51dd706d-ba27-424b-9048-1cd1baa3613f",      "security": {        "access": {          "intended": [            {              "quote": "string",              "sentence": "string"            }          ],          "members_see": [            "string"          ],          "unchecked": [            "string"          ],          "visitors_add": [            "string"          ],          "visitors_see": [            "string"          ]        },        "fixed": [          {            "proved": true,            "sentence": "string"          }        ],        "held": [          {            "file": "string",            "proved": true,            "sentence": "string",            "severity": "string"          }        ],        "state": "string"      },      "state": "string",      "strategy": "string",      "verified": true    },    "last_stage": "string",    "last_stage_at": "2019-08-24T14:15:22Z",    "lesson": {      "text": "string"    },    "memory_given": {      "answers": 0,      "brief": true,      "notes": 0    },    "origin": "string",    "parent_coding_run_id": "0087b7ae-a040-4979-b291-9a2d5a0db63c",    "policy_contract_sha256": "string",    "policy_resolved_at": "2019-08-24T14:15:22Z",    "pr_number": 0,    "pr_status": "string",    "pr_url": "string",    "preview_urls": {},    "prompt": "string",    "pull_requests": [      {        "base_branch": "string",        "branch": "string",        "draft": true,        "feature_key": "string",        "pr_number": 0,        "pr_status": "string",        "pr_url": "string",        "sequence": 0      }    ],    "readiness": {      "clarifying_questions": [        "string"      ],      "readiness": "string"    },    "redrive_count": 0,    "refund_under_review": false,    "refunded_usd": 0,    "result_kind": "string",    "schedule_id": "8929bb67-0da1-406c-99d2-5447376a4f58",    "schedule_kind": "string",    "service_coverage": [      {}    ],    "site_build": "string",    "spec_review_mode": "auto",    "stack_layer": 0,    "stack_total": 0,    "stopped": false,    "subscription_share": {      "account_label": "string",      "final": true,      "overage": true,      "pct": 0,      "provider": "string",      "window": "string"    },    "terminal_summary": {},    "thread_id": "1de43264-67cb-48af-89f9-e865c375bb84",    "title": "string",    "updated_at": "2019-08-24T14:15:22Z",    "validated_head_sha": "string",    "validation_iteration": 0,    "work_usd": 0  }}