---
title: "Every access code, never the code itself. Owner only."
method: GET
path: "/v1/admin/codes"
tags: ["admin"]
---

# Every access code, never the code itself. Owner only.

`GET /v1/admin/codes`

## 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/codes`
- Auth: none declared

Every access code, newest first (at most 500): code_id, code_prefix (the first 7
characters), email (when bound), note, source (owner, request, proof), max_uses, uses,
expires_at, revoked_at, created_at and usable. The full code is never shown again
after it was made. Needs the admin scope and an admin account. MCP:
list_access_codes.

## Headers

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

## Response `200`

Successful Response

- AccessCodeList
  - `codes` AccessCodeItem[], required: newest first, at most 500; never the codes themselves
    - `code_id` string, required
    - `code_prefix` string, required: the first 7 characters, to tell codes apart
    - `email` string, nullable, required
    - `note` string, nullable, required
    - `source` 'owner' | 'request' | 'proof' | 'other', required
    - `max_uses` integer, required
    - `uses` integer, required
    - `expires_at` string, nullable, required
    - `revoked_at` string, nullable, required
    - `created_at` string, required
    - `usable` boolean, required: not revoked, not expired, not used up

## 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)
- `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)
