> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vyomflow.co.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Respond to a pending CREDIT_APPROVAL or CLARIFICATION waitpoint

> Idempotent — a repeat call on an already-resolved waitpoint still returns 200 with the current DTO, never an error.



## OpenAPI

````yaml /openapi.json post /api/public/v1/waitpoints/{waitpointId}/respond
openapi: 3.1.0
info:
  title: VyomFlow API
  version: 1.0.0
  description: >-
    The versioned public REST surface (`/api/public/v1/*`, bearer API-key auth)
    plus the app's own internal `/api/v1/*` surface (Clerk session-token auth),
    generated directly from the same Zod contracts the Route Handlers validate
    against — never a hand-maintained duplicate. The MCP endpoint (`/api/mcp`)
    is a separate streamable-HTTP JSON-RPC transport, not expressible here — see
    the MCP guide.
servers:
  - url: https://api.vyomflow.co.in
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
paths:
  /api/public/v1/waitpoints/{waitpointId}/respond:
    post:
      tags:
        - Public API
      summary: Respond to a pending CREDIT_APPROVAL or CLARIFICATION waitpoint
      description: >-
        Idempotent — a repeat call on an already-resolved waitpoint still
        returns 200 with the current DTO, never an error.
      parameters:
        - schema:
            type: string
            minLength: 1
          required: true
          name: waitpointId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - CREDIT_APPROVAL
                    approved:
                      type: boolean
                  required:
                    - kind
                    - approved
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - CLARIFICATION
                    answer:
                      type: string
                      minLength: 1
                      maxLength: 2000
                  required:
                    - kind
                    - answer
      responses:
        '200':
          description: Waitpoint resolved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Waitpoint'
        '400':
          description: >-
            Response kind doesn't match this waitpoint's kind, or malformed
            body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: Missing, invalid, or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: Valid key missing the required `waitpoints:respond` scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: Not found (non-leaking — see above).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
        - ApiKeyAuth:
            - waitpoints:respond
components:
  schemas:
    Waitpoint:
      oneOf:
        - type: object
          properties:
            id:
              type: string
            agentRunId:
              type: string
            kind:
              type: string
              enum:
                - CREDIT_APPROVAL
            status:
              type: string
              enum:
                - PENDING
                - COMPLETED
                - EXPIRED
            requestPayload:
              type: object
              properties:
                toolName:
                  type: string
                estimatedCredits:
                  type: number
                  minimum: 0
                threshold:
                  type: number
                  minimum: 0
              required:
                - toolName
                - estimatedCredits
                - threshold
            resolvedPayload:
              type:
                - object
                - 'null'
              properties:
                approved:
                  type: boolean
                respondedAt:
                  type: string
              required:
                - approved
                - respondedAt
            expiresAt:
              type: string
            resolvedAt:
              type:
                - string
                - 'null'
          required:
            - id
            - agentRunId
            - kind
            - status
            - requestPayload
            - resolvedPayload
            - expiresAt
            - resolvedAt
        - type: object
          properties:
            id:
              type: string
            agentRunId:
              type: string
            kind:
              type: string
              enum:
                - CLARIFICATION
            status:
              type: string
              enum:
                - PENDING
                - COMPLETED
                - EXPIRED
            requestPayload:
              type: object
              properties:
                question:
                  type: string
                options:
                  type: array
                  items:
                    type: string
              required:
                - question
            resolvedPayload:
              type:
                - object
                - 'null'
              properties:
                answer:
                  type: string
                respondedAt:
                  type: string
              required:
                - answer
                - respondedAt
            expiresAt:
              type: string
            resolvedAt:
              type:
                - string
                - 'null'
          required:
            - id
            - agentRunId
            - kind
            - status
            - requestPayload
            - resolvedPayload
            - expiresAt
            - resolvedAt
    ApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details: {}
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        Clerk-native API key, `Authorization: Bearer <key>`. Minted at
        https://www.vyomflow.co.in/settings/api-keys, scoped per operation. 401
        = missing/invalid/revoked key; 403 = valid key missing the required
        scope.

````