---
title: "Approve a request: make a one-use code and email it. Owner only."
method: POST
path: "/v1/admin/requests/{request_id}/approve"
tags: ["admin"]
---

# Approve a request: make a one-use code and email it. Owner only.

`POST /v1/admin/requests/{request_id}/approve`

## Request

- Base URL: `https://api.hookdetector.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.hookdetector.com/v1/admin/requests/{request_id}/approve`
- Auth: none declared

Make a one-use access code for the request, mark it approved and email the code to
the person. The code is in this response once, with emailed true or false: when the
email did not go out, send the code yourself or approve again, which revokes the
unused code and sends a new one. A request whose code was already used is 409
request_already_decided. Needs the admin scope and an admin account. MCP:
approve_access_request.

## Path parameters

- `request_id` string, required

## Headers

- `authorization` string, nullable: Bearer hd_... from POST /v1/accounts or POST /v1/keys

## Response `200`

Successful Response

- AccessApprovedOut
  - `request_id` string, required
  - `email` string, required
  - `status` 'approved', required
  - `decided_at` string, required
  - `code_id` string, required
  - `code_prefix` string, required
  - `code` string, required: the one-use code, shown here once and never again
  - `emailed` boolean, required: false: the email did not go out; send the code yourself, or approve again for a new one
  - `message` string, required

## Other responses

- `401`: missing, invalid, revoked or expired API key (code key_expired)
- `403`: the key lacks the admin scope (insufficient_scope), or its account is not the owner's (admin_required)
- `404`: not found on this account
- `409`: conflict with the account's state
- `413`: request body over the size cap
- `422`: invalid input
- `500`: our fault; names the request id

---

[API](https://skmtc.dev/hookdetector/apis/hook-detector.md) · [All operations](https://skmtc.dev/hookdetector/apis/hook-detector/llms.txt) · [OpenAPI document](https://skmtc.dev/hookdetector/apis/hook-detector/revisions/b136a2804d2b?raw)
