ci.runners.create-registration-token

Issue a one-time token a machine registers itself with

POST /ci/api/runners/registration-tokensIAM ci:ManageRunnersChanges stateDestructive

The token is returned once and stored hashed. It expires after 15 minutes and can be redeemed by exactly one machine. `configCommand` registers GitHub’s own runner (`./config.sh --url https://git.{root}/{org}[/{repo}] --token …`), which then runs GitHub-syntax jobs with `runs-on: self-hosted` (plus any labels it carries); `installCommand` installs the Deutsche Cloud agent on a Mac. A runner that will hold deploy credentials belongs in a group with `protectedRefsOnly`.

Request syntax

POST /ci/api/runners/registration-tokens
{
  "repositoryId": "string",
  "groupId": "string",
  "labels": "array of string"
}

Request body

  • repositoryIdOptional

    string

    Limit the token, and the runner it registers, to this repository (authorized on the repository); org-wide when absent

    Constraints: uuid

  • groupIdOptional

    string

    The runner group the machine joins; the Default group when absent

    Constraints: uuid

  • labelsOptional

    array of string

    Fix the runner’s custom labels; what the machine declares is then ignored (platform labels such as self-hosted, linux, x64 are kept)

    Constraints: 1-50 chars

Response

200 (not 201) with { token, expiresAt, repositoryId, runnerUrl, configCommand, linuxInstallCommand, installCommand }: the token, its expiry 15 minutes from now, and the commands that register a machine with it. 404 when groupId is not a runner group, or repositoryId not a repository, of this organization; 400 when the body is not JSON. An empty body is accepted (an organization-wide token for the Default group).

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow ci:ManageRunners on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud ci runners create-registration-token

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_ci_runners_create-registration-token.