Skip to content

Run the pipeline manually

POST /api/v8/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches

Call this endpoint to run the pipeline manually.

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)
workflow_id path string Yes The workflow ID, or a file name with a yml or yaml suffix (not a full path)
access_token query string Yes User authorization code

Request Body:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ref": {
      "description": "Branch name or tag name",
      "type": "string"
    },
    "inputs": {
      "description": "Custom parameters in key-value form",
      "type": "object"
    }
  },
  "required": ["ref", "inputs"]
}

Response parameters

Field Type Always returned Nullable Description
workflow_id string Yes No Workflow ID
workflow_run_id string Yes No Pipeline run ID

Error responses

The following are examples of failure responses this endpoint may return.

400 Invalid parameters

{
  "error": "invalid_request",
  "message": "The ref parameter cannot be empty",
  "field": "ref"
}

401 Unauthenticated

{
  "error": "unauthorized",
  "message": "Missing or invalid access token"
}

The error field names returned by the backend take precedence.

HTTP response status codes

Status code Description
201 Created
400 Bad Request
401 Requires authentication
403 Forbidden
404 Not Found

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; <workflow_id> is replaced with the workflow ID, or a file name with a yml / yaml suffix; <token> is replaced with your AtomGit user access token.

cURL

curl -X POST 'https://api.atomgit.com/api/v8/repos/<owner>/<repo>/actions/workflows/<workflow_id>/dispatches?access_token=<token>'   -H 'Content-Type: application/json'   -d '{"ref": "main", "inputs": {"name": "value"}}'

JavaScript

// Native fetch (Node.js 18+ / browser)
const response = await fetch(
  "https://api.atomgit.com/api/v8/repos/<owner>/<repo>/actions/workflows/<workflow_id>/dispatches?access_token=<token>",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "Accept": "application/json",
    },
    body: JSON.stringify({
      ref: "main",
      inputs: { name: "value" },
    }),
  },
);

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/workflows/<workflow_id>/dispatches",
    params={"access_token": "<token>"},
    headers={
        "Content-Type": "application/json",
        "Accept": "application/json",
    },
    json={"ref": "main", "inputs": {"name": "value"}},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 201

{
  "workflow_id": "123456",
  "workflow_run_id": "789012"
}

Error codes

Error code Description
400 Invalid parameters or the request could not be parsed
401 Unauthenticated or invalid credentials (missing or invalid access token)
403 Forbidden (no permission to perform this operation)
404 The request path does not exist
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