---
title: "Authorize exactly one bounded draft PR"
method: POST
path: "/v1/automation-runs/{run_id}/actions/draft-pr/authorize"
tags: ["Automation"]
---

# Authorize exactly one bounded draft PR

`POST /v1/automation-runs/{run_id}/actions/draft-pr/authorize`

## Request

- Base URL: `https://api.agentry.sh`
- URL: `https://api.agentry.sh/v1/automation-runs/{run_id}/actions/draft-pr/authorize`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Validates path, change-type, line, file, test, approval, and PR budgets before issuing a short-lived one-time action token. It never grants merge, deploy, rollback, or direct push.

## Path parameters

- `run_id` string, required

## Headers

- `Idempotency-Key` string, required
- `X-Agentry-Lease-Token` string, required

## Request body

- object
  - `subject` object, required
    - `kind` 'draft_pr', required
    - `branch` string, required
    - `commit_sha` string, required
    - `change_types` string[], required
    - `changed_files` string[], required
    - `changed_lines` object, required
      - `added` integer, required
      - `deleted` integer, required
    - `tests` object[], required
      - `command` string, required
      - `status` 'passed' | 'failed' | 'skipped', required
      - `exit_code` integer
      - `duration_ms` integer
      - `output_excerpt` string

## Response `200`

OK

- object
  - `grant_id` string, required
  - `action` 'draft_pr', required
  - `action_token` string, required
  - `subject_hash` string, required
  - `expires_at` integer, required
  - `idempotent_replay` boolean
  - `next_action` string, required

## Other responses

- `default`: Error

---

[API](https://skmtc.dev/agentry/apis/agentry-api.md) · [All operations](https://skmtc.dev/agentry/apis/agentry-api/llms.txt) · [OpenAPI document](https://skmtc.dev/agentry/apis/agentry-api/revisions/abdecddf009f?raw)
