---
title: "Record the provider auto-merge receipt for one grant"
method: POST
path: "/v1/automation-runs/{run_id}/actions/auto-merge/consume"
tags: ["Automation"]
---

# Record the provider auto-merge receipt for one grant

`POST /v1/automation-runs/{run_id}/actions/auto-merge/consume`

## Request

- Base URL: `https://api.agentry.sh`
- URL: `https://api.agentry.sh/v1/automation-runs/{run_id}/actions/auto-merge/consume`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Consumes the matching one-time action token and records the exact provider receipt. The receipt must prove auto_merge_enabled=true and bypass_used=false and match the granted subject exactly.

## Path parameters

- `run_id` string, required

## Headers

- `X-Agentry-Action-Token` string, required
- `X-Agentry-Lease-Token` string, required

## Request body

- object
  - `grant_id` string, required
  - `receipt` object, required
    - `vcs_provider` 'github' | 'gitlab' | 'bitbucket', required
    - `repository` string, uri, required: Absolute HTTPS URL without embedded username or password credentials.
    - `pr_url` string, uri, required: Absolute HTTPS URL without embedded username or password credentials.
    - `pr_number` integer, required
    - `provider_pull_request_id` string, required
    - `head_sha` string, required
    - `merge_method` 'squash' | 'merge' | 'rebase', required
    - `auto_merge_enabled` true, required
    - `bypass_used` false, required

## Response `200`

OK

- object
  - `run_id` string, required
  - `grant_id` string, required
  - `status` string, required
  - `receipt_hash` string, 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)
