---
title: "Approve a doc request"
method: POST
path: "/api/v1/doc-requests/{request_id}/approve"
tags: ["authed"]
---

# Approve a doc request

`POST /api/v1/doc-requests/{request_id}/approve`

## Request

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

Publish a doc request's draft: the doc's newest draft — including
any member's edits on top of the drafted one — becomes what readers
see (the assistant, and the public help center when that is live and
the doc isn't hidden there; draft.public_path is set exactly then),
the request becomes approved, and verification and re-indexing
start. Owners only. Only a ready_for_review request whose doc's newest
revision is still a draft can be approved.

## Path parameters

- `request_id` string, uuid, required: The doc request's id, as list_doc_requests returns it.

## Response `200`

Successful Response

- DocRequestDetailResponse: The request plus its draft; draft is null until the workflow has drafted (queued/working, or failed before drafting).
  - `id` string, uuid, required: The doc request's id.
  - `organization_id` string, uuid, required: The organization that owns the request.
  - `prompt` string, required: What the doc was requested to cover.
  - `status` 'queued' | 'working' | 'ready_for_review' | 'approved' | 'dismissed' | 'failed' | 'unfunded', required
  - `error` string, nullable, required: Why the request failed, in a sentence; null unless it failed.
  - `requested_by_user_id` string, uuid, required: The member who asked.
  - `requested_by` string, nullable, required: That member's name, or their email when they have no name.
  - `doc_id` string, uuid, nullable, required: The doc the draft was written into; null until a draft exists.
  - `created_at` string, date-time, required: When the request was made.
  - `updated_at` string, date-time, required: When the request last changed.
  - `draft` DocRequestDraftResponse, required: What the review screen needs about the drafted doc.
    - `doc_id` string, uuid, required: The drafted doc's id.
    - `doc_title` string, required: The drafted doc's title.
    - `slug` string, required: The drafted doc's URL slug.
    - `public_path` string, nullable, required: The doc's public path once approval releases it, while the help center shows it and is live; null otherwise.
    - `latest_revision` DocRevisionResponse, required
      - `id` string, uuid, required: The revision's id.
      - `doc_id` string, uuid, required: The doc this revision belongs to.
      - `parent_revision_id` string, uuid, nullable, required: The revision this one was edited from; null for the first.
      - `title` string, required: The doc's title as of this revision.
      - `body_md` string, required: The full body, in Markdown.
      - `body_format` 'md/v1', required: Versions of the body vocabulary; evolves additively, never in place.
      - `status` 'draft' | 'published' | 'superseded' | 'discarded', required
      - `authored_by_user_id` string, uuid, nullable, required: The member who wrote it; exactly one authored_by_* id is set.
      - `authored_by_request_id` string, uuid, nullable, required: The doc request whose agent drafted it.
      - `authored_by_rewrite_request_id` string, uuid, nullable, required: The update request whose agent drafted it.
      - `authored_by` string, nullable, required: Who wrote it, as a person reads it: the member's name or email, or the kind of agent request that drafted it.
      - `content_version` integer, required: Changes each time this revision's text is edited in place; send it back as parent_content_version.
      - `created_at` string, date-time, required: When the revision was created.
      - `updated_at` string, date-time, required: When the revision last changed, by an edit or a status change.

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `405`: Method not allowed
- `422`: Validation error
- `500`: Internal server error

---

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