---
title: "Propose an improved AI prompt based on selected audits."
method: POST
path: "/aipromptproposals"
tags: ["AI"]
---

# Propose an improved AI prompt based on selected audits.

`POST /aipromptproposals`

Generates a prompt improvement proposal asynchronously using Gemini, based on the selected completed audits. Returns 202 Accepted immediately with status `progressing`; poll GET /aipromptproposals/{id} for completion. All selected audits must belong to the same AI and reference the AI's current prompt version.

## Request body

- object
  - `ai_id` string, uuid, required — The AI participant whose prompt should be improved.
  - `audit_ids` string[], required — The completed AI audits to use as evidence for the proposal.
  - `language` string — BCP47 language code for proposal output (e.g. "en-US", "ko-KR"). Defaults to "en-US".

## Response `202`

Proposal accepted and running in background.

- AIManagerAIPromptProposal
  - `id` string, uuid — The unique identifier of the prompt proposal.
  - `customer_id` string, uuid — The customer who owns this proposal.
  - `ai_id` string, uuid — The AI participant whose prompt is being improved. Returned from the `GET /ais` response.
  - `audit_ids` string[] — Ordered list of AI audit IDs the proposal was derived from. Returned from the `GET /aiaudits` response.
  - `basis_prompt_history_id` string, uuid — The prompt history snapshot the proposal was generated against.
  - `original_prompt` string — The basis prompt text captured at proposal time.
  - `proposed_prompt` string — The Gemini-generated improved prompt. Empty until status is completed.
  - `rationale` string — Gemini's explanation for the proposed prompt change. Empty until status is completed.
  - `status` 'progressing' | 'completed' | 'failed' | 'accepted' | 'rejected' | 'expired' — Status of the AI prompt proposal.
  - `error` string — Canonicalized failure reason if status is failed or expired.
  - `applied_prompt_history_id` string, uuid — The prompt history ID created when this proposal was accepted. Empty until accepted.
  - `tm_create` string, date-time — Timestamp when the proposal was created.
  - `tm_update` string, date-time, nullable — Timestamp when the proposal was last updated.
  - `tm_delete` string, date-time, nullable — Timestamp when the proposal was deleted.

## Other responses

- `400` — Invalid request (INVALID_ARGUMENT).
- `401` — Authentication required (UNAUTHENTICATED).
- `404` — Resource not found (NOT_FOUND).
- `409` — State conflict (ALREADY_EXISTS or FAILED_PRECONDITION).
- `429` — Rate or quota exceeded (RESOURCE_EXHAUSTED).
- `500` — Internal error (INTERNAL).

---

[API](https://skmtc.net/voipbin/apis/voipbin-api.md) · [All operations](https://skmtc.net/voipbin/apis/voipbin-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/voipbin/voipbin-api/revisions/79e779080bcc/schema)
