Retry failed tasks¶
POST /api/v8/repos/{owner}/{repo}/actions/runs/{run_id}/retry
Retry failed tasks.
Access token support¶
- AtomGit user access tokens
Anonymous access¶
This endpoint does not allow anonymous access.
Request parameters¶
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
owner |
path | string | Yes | Address path of the namespace that owns the repository (organization or personal address path) |
repo |
path | string | Yes | Repository path (path) |
run_id |
path | string | Yes | Pipeline run ID |
access_token |
query | string | Yes | User authorization code |
Request Body:
The request body is in application/json format; the required field job_run_ids is an array of job IDs to retry.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"job_run_ids": {
"description": "Array of job IDs",
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["job_run_ids"]
}
Response parameters¶
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
success |
boolean | Yes | No | Whether the retry succeeded |
Error responses¶
400 Invalid parameters
401 Unauthenticated
The error field names returned by the backend take precedence.
HTTP response status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
401 |
Requires authentication |
403 |
Forbidden |
Request example¶
Parameter notes¶
<owner>is replaced with the address path of the namespace that owns the repository (organization or personal address path);<repo>is replaced with the repository path (path);<run_id>is replaced with the pipeline run ID;<token>is replaced with your AtomGit user access token.
cURL¶
curl -X POST 'https://api.atomgit.com/api/v8/repos/<owner>/<repo>/actions/runs/<run_id>/retry?access_token=<token>' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{"job_run_ids": ["<job_run_id>"]}'
JavaScript¶
// Native fetch (Node.js 18+ / browser)
const response = await fetch(
"https://api.atomgit.com/api/v8/repos/<owner>/<repo>/actions/runs/<run_id>/retry?access_token=<token>",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
},
body: JSON.stringify({ job_run_ids: ["<job_run_id>"] }),
}
);
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
const data = await response.json();
console.log(data);
Python¶
import requests
resp = requests.post(
"https://api.atomgit.com/api/v8/repos/<owner>/<repo>/actions/runs/<run_id>/retry",
params={"access_token": "<token>"},
headers={
"Content-Type": "application/json",
"Accept": "application/json",
},
json={"job_run_ids": ["<job_run_id>"]},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
Error codes¶
| Error code | Description |
|---|---|
401 |
Unauthenticated or invalid credentials (missing or invalid access token) |
400 |
Invalid parameters or the request could not be parsed |
404 |
The request path does not exist |
405 |
The request method is not supported |
429 |
Too many requests; rate limit triggered |
500 |
Internal server error |
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc