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

# Propose instruction changes without saving; uses AI credits



## OpenAPI

````yaml https://api.sapt.ai/openapi.json post /projects/{projectId}/conversation-assistants/refine
openapi: 3.1.0
info:
  title: Sapt Platform API
  version: 1.0.0
  description: >-
    API for Sapt platform - project management, authentication, and email
    services
servers:
  - url: https://api.sapt.ai
    description: Production
  - url: http://localhost:8787
    description: Local development
security: []
tags:
  - name: Accounts
    description: >-
      The social accounts connected to a project. Start here — the `id` of an
      account is the `socialAccountId` that every posting, scheduling and
      analytics call takes.
  - name: Actions
  - name: Ads
  - name: Agents
  - name: Analytics
    description: >-
      Account- and post-level organic performance for connected Instagram and
      Facebook accounts.
  - name: Assets
  - name: Auth
  - name: CMS
  - name: CRM
  - name: Calendar
  - name: Comments
    description: >-
      Read, reply to, hide and delete comments on published Instagram and
      Facebook posts.
  - name: Content Calendar
    description: >-
      Create, schedule, update and publish organic posts, and stage the media
      they carry. Publishing a post whose status is `failed` retries it.
  - name: Contracts
  - name: Conversation assistants
  - name: Conversions
    description: >-
      Meta server-side Conversions API (CAPI): discover pixels, connect a pixel
      + CAPI token, and send deduped server-side conversions.
  - name: Dashboard Sidebar
  - name: Emails
  - name: Engagement
    description: >-
      Act as the Page or account on published posts: comment, like, unlike, and
      delete a published post.
  - name: Geo
  - name: Google Ads
  - name: Google Business
  - name: Integrations
    description: >-
      Connect third-party providers (Meta, Gmail, Google Business Profile, …).
      List providers, mint OAuth connect links, and poll connection status.
  - name: Invitations
  - name: Memory
  - name: OAuth Clients
  - name: Project Roles
  - name: Project Templates
  - name: Projects
  - name: Schedules
  - name: Service Accounts
  - name: Socials
    description: >-
      Organic social: the connected accounts, the content calendar, media
      staging, publishing, comments and engagement across Instagram, Facebook,
      TikTok, YouTube and Google Business Profile.
  - name: Team
  - name: Users
  - name: Web Analytics
  - name: Workflows
paths:
  /projects/{projectId}/conversation-assistants/refine:
    post:
      tags:
        - Conversation assistants
      summary: Propose instruction changes without saving; uses AI credits
      operationId: refineConversationAssistant
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: projectId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                configuration:
                  type: object
                  properties:
                    name:
                      type: string
                      minLength: 1
                      maxLength: 120
                    mode:
                      type: string
                      enum:
                        - 'off'
                        - review
                        - automatic
                    endpoints:
                      type: array
                      items:
                        oneOf:
                          - type: object
                            properties:
                              channel:
                                type: string
                                enum:
                                  - email
                              integrationAccountId:
                                type: string
                                format: uuid
                            required:
                              - channel
                              - integrationAccountId
                          - type: object
                            properties:
                              channel:
                                type: string
                                enum:
                                  - sms
                              phoneNumber:
                                type: string
                                pattern: ^\+[1-9]\d{7,14}$
                            required:
                              - channel
                              - phoneNumber
                          - type: object
                            properties:
                              channel:
                                type: string
                                enum:
                                  - whatsapp
                              phoneNumber:
                                type: string
                                pattern: ^\+[1-9]\d{7,14}$
                            required:
                              - channel
                              - phoneNumber
                      maxItems: 20
                    capabilities:
                      type: array
                      items:
                        oneOf:
                          - type: object
                            properties:
                              kind:
                                type: string
                                enum:
                                  - book_appointments
                              calendarPresetId:
                                type: string
                                format: uuid
                            required:
                              - kind
                              - calendarPresetId
                          - type: object
                            properties:
                              portalUrl:
                                type: string
                                format: uri
                              discountCode:
                                type: string
                                minLength: 1
                                maxLength: 80
                                pattern: ^[A-Za-z0-9_-]+$
                              discountPercent:
                                type: integer
                                minimum: 1
                                maximum: 100
                              kind:
                                type: string
                                enum:
                                  - wholesale_samples
                            required:
                              - portalUrl
                              - discountCode
                              - discountPercent
                              - kind
                          - type: object
                            properties:
                              kind:
                                type: string
                                enum:
                                  - take_requests
                            required:
                              - kind
                      maxItems: 2
                    instructions:
                      type: string
                      minLength: 1
                      maxLength: 12000
                    memoryKeys:
                      type: array
                      items:
                        type: string
                        minLength: 1
                        maxLength: 120
                      maxItems: 20
                    reviewExceptions:
                      type: string
                      maxLength: 4000
                    maxRepliesPerDay:
                      type: integer
                      minimum: 1
                      maximum: 30
                    maxOutputTokens:
                      type: integer
                      minimum: 128
                      maximum: 2048
                    handoffInstructions:
                      type: string
                      maxLength: 2000
                    audience: {}
                    priority:
                      type: integer
                      minimum: 0
                      maximum: 1000
                    remembers:
                      type: array
                      items:
                        type: string
                        minLength: 1
                        maxLength: 80
                      maxItems: 8
                  required:
                    - name
                    - mode
                    - endpoints
                    - capabilities
                    - instructions
                    - memoryKeys
                    - reviewExceptions
                    - maxRepliesPerDay
                    - maxOutputTokens
                    - handoffInstructions
                  additionalProperties: {}
                instruction:
                  type: string
              required:
                - configuration
                - instruction
      responses:
        '200':
          description: Reviewable changes
          content:
            application/json:
              schema:
                type: object
                properties:
                  configuration:
                    type: object
                    properties:
                      name:
                        type: string
                        minLength: 1
                        maxLength: 120
                      mode:
                        type: string
                        enum:
                          - 'off'
                          - review
                          - automatic
                      endpoints:
                        type: array
                        items:
                          oneOf:
                            - type: object
                              properties:
                                channel:
                                  type: string
                                  enum:
                                    - email
                                integrationAccountId:
                                  type: string
                                  format: uuid
                              required:
                                - channel
                                - integrationAccountId
                            - type: object
                              properties:
                                channel:
                                  type: string
                                  enum:
                                    - sms
                                phoneNumber:
                                  type: string
                                  pattern: ^\+[1-9]\d{7,14}$
                              required:
                                - channel
                                - phoneNumber
                            - type: object
                              properties:
                                channel:
                                  type: string
                                  enum:
                                    - whatsapp
                                phoneNumber:
                                  type: string
                                  pattern: ^\+[1-9]\d{7,14}$
                              required:
                                - channel
                                - phoneNumber
                        maxItems: 20
                      capabilities:
                        type: array
                        items:
                          oneOf:
                            - type: object
                              properties:
                                kind:
                                  type: string
                                  enum:
                                    - book_appointments
                                calendarPresetId:
                                  type: string
                                  format: uuid
                              required:
                                - kind
                                - calendarPresetId
                            - type: object
                              properties:
                                portalUrl:
                                  type: string
                                  format: uri
                                discountCode:
                                  type: string
                                  minLength: 1
                                  maxLength: 80
                                  pattern: ^[A-Za-z0-9_-]+$
                                discountPercent:
                                  type: integer
                                  minimum: 1
                                  maximum: 100
                                kind:
                                  type: string
                                  enum:
                                    - wholesale_samples
                              required:
                                - portalUrl
                                - discountCode
                                - discountPercent
                                - kind
                            - type: object
                              properties:
                                kind:
                                  type: string
                                  enum:
                                    - take_requests
                              required:
                                - kind
                        maxItems: 2
                      instructions:
                        type: string
                        minLength: 1
                        maxLength: 12000
                      memoryKeys:
                        type: array
                        items:
                          type: string
                          minLength: 1
                          maxLength: 120
                        maxItems: 20
                      reviewExceptions:
                        type: string
                        maxLength: 4000
                      maxRepliesPerDay:
                        type: integer
                        minimum: 1
                        maximum: 30
                      maxOutputTokens:
                        type: integer
                        minimum: 128
                        maximum: 2048
                      handoffInstructions:
                        type: string
                        maxLength: 2000
                      audience: {}
                      priority:
                        type: integer
                        minimum: 0
                        maximum: 1000
                      remembers:
                        type: array
                        items:
                          type: string
                          minLength: 1
                          maxLength: 80
                        maxItems: 8
                    required:
                      - name
                      - mode
                      - endpoints
                      - capabilities
                      - instructions
                      - memoryKeys
                      - reviewExceptions
                      - maxRepliesPerDay
                      - maxOutputTokens
                      - handoffInstructions
                    additionalProperties: {}
                  summary:
                    type: string
                  changes:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                        before:
                          type: string
                        after:
                          type: string
                      required:
                        - field
                        - before
                        - after
                required:
                  - configuration
                  - summary
                  - changes
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                  code:
                    type: string
                    description: Error code for programmatic handling
                required:
                  - message
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                  code:
                    type: string
                    description: Error code for programmatic handling
                required:
                  - message
        '402':
          description: Payment required
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                  code:
                    type: string
                    description: Error code for programmatic handling
                required:
                  - message
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                  code:
                    type: string
                    description: Error code for programmatic handling
                required:
                  - message
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT token obtained from /api/auth/token endpoint. Token is verified
        using JWKS and must include a valid user identifier.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.