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

# Respond to a playground tool approval card

> Resolves a playground approval card by approving or rejecting it. Approving executes the requested tool with the originally captured arguments and resumes the playground turn; rejecting stashes a rejection sentinel so the agent acknowledges and moves on. Returns the resumed AI response and any new approval cards.



## OpenAPI

````yaml /api-reference/openapi.yaml post /api/ai/playground/approval/respond
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/ai/playground/approval/respond:
    post:
      tags:
        - AI
      summary: Respond to a playground tool approval card
      description: >-
        Resolves a playground approval card by approving or rejecting it.
        Approving executes the requested tool with the originally captured
        arguments and resumes the playground turn; rejecting stashes a rejection
        sentinel so the agent acknowledges and moves on. Returns the resumed AI
        response and any new approval cards.
      operationId: post_ai_playground_approval_respond
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AIPlaygroundApprovalRespondRequest'
      responses:
        '200':
          description: Approval resolved and playground resumed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIPlaygroundApprovalRespondResponse'
        '400':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIErrorResponse'
        '403':
          description: Approval owner or organization mismatch
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIErrorResponse'
        '404':
          description: Approval expired or already handled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIErrorResponse'
        '500':
          description: Failed to resume playground after approval
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIErrorResponse'
        '503':
          description: Approval service temporarily unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    AIPlaygroundApprovalRespondRequest:
      type: object
      properties:
        approvalKey:
          type: string
          description: >-
            Opaque key for the approval card being resolved. Single-use —
            consumed atomically; a second call returns `approval_expired`.
        decision:
          type: string
          enum:
            - approve
            - reject
          description: >-
            `approve` runs the tool with the captured args; `reject` stashes a
            sentinel so the agent acknowledges and moves on.
        conversation:
          type: array
          description: >-
            Visible playground history at the moment the user clicked the
            approval card. Replayed on resume; a synthetic resume note is
            appended server-side.
          items:
            type: object
            properties:
              role:
                type: string
                enum:
                  - user
                  - assistant
              content:
                type: string
            additionalProperties: true
          default: []
        promptId:
          type: string
          description: >-
            Prompt id used for the original playground turn; the resumed turn
            re-runs the same prompt so behavior stays consistent.
        conversationId:
          type: string
          description: >-
            Optional conversation id used for context lookup on the resumed
            turn; matches the value originally passed to `/api/ai/playground`.
        promptOverride:
          type: string
          description: >-
            Optional inline prompt text that replaces the saved prompt for this
            resumed turn — used by editors testing un-saved edits.
        modelOverride:
          $ref: '#/components/schemas/AiModelOverride'
          description: >-
            Pin the resumed turn to a specific provider/model (e.g. `{ provider:
            'anthropic', model: 'claude-sonnet-4-6' }`) overriding the org's
            default assignment.
      required:
        - approvalKey
        - decision
        - promptId
      additionalProperties: true
      example:
        approvalKey: playground:5f7b1c2e8a1d4e0012c3b4a5:tool-call-7c2a
        decision: approve
        conversation:
          - role: user
            content: Please book me for Tuesday at 2pm.
          - role: assistant
            content: I will go ahead and request that slot.
        promptId: 5f7b1c2e8a1d4e0012c3b4a5
        conversationId: 64d2f9c5e8a1d4e001a0b1c2
        modelOverride:
          provider: anthropic
          model: claude-sonnet-4-6
    AIPlaygroundApprovalRespondResponse:
      type: object
      description: >-
        Returned after a playground approval is resolved (approve or reject).
        `response` carries the resumed agent reply; `toolError` flags that the
        underlying tool execution failed.
      properties:
        success:
          type: boolean
          enum:
            - true
        response:
          type: string
        decision:
          type: string
          enum:
            - approve
            - reject
        toolError:
          type: boolean
        approvalCards:
          type: array
          items:
            $ref: '#/components/schemas/AIApprovalCard'
      required:
        - success
        - response
        - decision
      additionalProperties: true
      example:
        success: true
        decision: approve
        response: Sent! I just texted Alex the confirmation.
    AIErrorResponse:
      type: object
      description: >-
        Error envelope used across AI endpoints. The `error` field is a stable
        machine-readable code on approval-related failures
        (`approval_owner_mismatch`, `approval_org_mismatch`, `approval_expired`,
        `approval_service_unavailable`) and a human-readable string elsewhere.
        `message` is set alongside on the approval paths so the UI can render
        both.
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
        message:
          type: string
      required:
        - error
      additionalProperties: true
      example:
        success: false
        error: approval_expired
        message: >-
          This approval request has expired or was already handled. Please send
          a new playground message to retry.
    AiModelOverride:
      type: object
      properties:
        provider:
          type: string
          enum:
            - anthropic
            - openai
            - google
        model:
          type: string
      required:
        - provider
        - model
      additionalProperties: false
      example:
        provider: anthropic
        model: claude-sonnet-4-6
    AIApprovalCard:
      type: object
      description: >-
        Pending tool-approval card surfaced by the playground when the agent
        wants to run a tool that requires sign-off.
      properties:
        approvalId:
          type: string
        toolName:
          type: string
        toolArgs:
          type: object
          additionalProperties: true
        createdAt:
          type: string
          format: date-time
        expiresAt:
          type: string
          format: date-time
      required:
        - approvalId
        - toolName
      additionalProperties: true
      example:
        approvalId: apr_64d2f9c5e8a1d4e001a0b1c2
        toolName: sendSms
        toolArgs:
          phone: '+14165550100'
          message: Hi Alex — confirming your appointment for Friday at 2pm.
        createdAt: '2026-05-20T15:04:01.135Z'
        expiresAt: '2026-05-20T15:09:01.135Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````