Trigger an Azure DevOps pipeline run via REST API

domain: learn.microsoft.com/azure/devops · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Generate a Personal Access Token (PAT) in Azure DevOps under User Settings > Personal access tokens with 'Build (Read & execute)' scope
  2. Encode the PAT for Basic auth: base64-encode the string ':YOUR_PAT' (colon prefix, no username) and set the Authorization header to 'Basic ENCODED_VALUE'
  3. POST to 'https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}/runs?api-version=7.1' with Content-Type 'application/json'
  4. Include a JSON body with 'resources.repositories.self.refName' for the branch, and optionally 'templateParameters' and 'variables' objects for runtime overrides
  5. Poll GET on the returned 'url' field of the run object, checking 'state' (inProgress/completed) and 'result' (succeeded/failed/canceled)

Known gotchas

Related routes

Trigger a GitLab pipeline via pipeline trigger token API
docs.gitlab.com · 5 steps · unrated
Trigger a Bitbucket Pipelines build via the Pipelines API
developer.atlassian.com/cloud/bitbucket · 5 steps · unrated
Trigger a Codefresh pipeline run via the Codefresh API
codefresh.io/docs · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans