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

# Add/Update Vendor Approval

> Add or update a vendor approval entry for a WhatsApp or SMS variant. Use this to record approval status from the vendor portal, including the vendor template ID and name.




## OpenAPI

````yaml PATCH /v2/{workspace}/template/{template_slug}/channel/{channel}/variant/{variant_id}/vendor_approval/
openapi: 3.1.1
info:
  title: SuprSend API
  description: APIs supported on suprsend platform
  version: 1.2.2
servers:
  - url: https://hub.suprsend.com
security:
  - sec0: []
  - BearerAuth: []
paths:
  /v2/{workspace}/template/{template_slug}/channel/{channel}/variant/{variant_id}/vendor_approval/:
    patch:
      summary: Add or Update Vendor Approval
      description: >
        Add or update a vendor approval entry for a WhatsApp or SMS variant. Use
        this to record approval status from the vendor portal, including the
        vendor template ID and name.
      operationId: vendor-approval-v2
      parameters:
        - in: path
          name: workspace
          required: true
          schema:
            type: string
        - in: path
          name: template_slug
          required: true
          schema:
            type: string
        - in: path
          name: channel
          required: true
          schema:
            type: string
            enum:
              - whatsapp
              - sms
        - in: path
          name: variant_id
          required: true
          schema:
            type: string
        - in: query
          name: mode
          schema:
            type: string
            enum:
              - live
            default: live
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - approval_status
                - vendor_slug
                - vendor_uid
              properties:
                approval_status:
                  type: string
                  enum:
                    - pending
                    - sent_for_approval
                    - approved
                    - rejected
                  description: Current approval status.
                  example: approved
                vendor_slug:
                  type: string
                  description: >-
                    Slug of the vendor (e.g., `twilio-whatsapp`,
                    `gupshup-whatsapp`, `msg91-sms`).
                  example: twilio-whatsapp
                vendor_uid:
                  type: string
                  description: Unique vendor identifier (e.g., WABA ID for WhatsApp).
                  example: waba_id-123221
                vendor_template_name:
                  type: string
                  description: >-
                    *(Required if approved)* Template name as registered at the
                    vendor portal.
                  example: tpl_v12
                vendor_template_id:
                  type: string
                  description: '*(Required if approved)* Template ID from the vendor portal.'
                  example: '1232'
                vendor_locale_code:
                  type: string
                  description: '*(Optional)* Locale code at the vendor end.'
                  example: en
                vendor_template_category:
                  type: string
                  description: '*(Optional)* Template category at the vendor end.'
                  enum:
                    - UTILITY
                    - MARKETING
                    - AUTHENTICATION
                  example: UTILITY
                provider_template_id:
                  type: string
                  description: >-
                    *(Optional, SMS only for msg91-sms)* Provider-level template
                    ID.
                comment:
                  type: string
                  description: '*(Required if rejected)* Reason for rejection.'
      responses:
        '200':
          description: Vendor approval entry updated
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Validation error — one or more variants have issues
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  error_code:
                    type: string
                  type:
                    type: string
                  message:
                    type: string
                  detail:
                    type: array
                    items:
                      type: string
              example:
                code: 400
                error_code: error
                type: ValidationError
                message: >-
                  ["one of more variants about to be committed have issues.\n[1]
                  email:default errors: {'body.raw.html': ['missing']}\n[2]
                  slack:default errors: {'body_text': ['missing']}"]
                detail:
                  - |-
                    one of more variants about to be committed have issues.
                    [1] email:default errors: {'body.raw.html': ['missing']}
                    [2] slack:default errors: {'body_text': ['missing']}
        '401':
          $ref: '#/components/responses/AuthenticationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
      security:
        - ServiceTokenAuth: []
      servers:
        - url: https://management-api.suprsend.com
      x-codeSamples:
        - lang: cURL
          label: Approve Variant
          source: >
            curl -X PATCH
            "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/channel/{channel}/variant/{variant_id}/vendor_approval/?mode=live"
            \
              --header 'Authorization: ServiceToken <token>' \
              --header 'Content-Type: application/json' \
              --data '{
                "approval_status": "approved",
                "vendor_slug": "twilio-whatsapp",
                "vendor_uid": "waba_id-123221",
                "vendor_template_name": "tpl_v12",
                "vendor_template_id": "1232",
                "vendor_locale_code": "en",
                "vendor_template_category": "UTILITY"
              }'
components:
  responses:
    AuthenticationError:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 401
            error_code: authentication_failed
            type: AuthenticationFailed
            message: Invalid service token.
            detail: Invalid service token.
    NotFoundError:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 404
            error_code: not_found
            type: NotFound
            message: workspace 'demo' not found
            detail: workspace 'demo' not found
  schemas:
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          description: HTTP status code
        error_code:
          type: string
          description: Specific error code identifier
        type:
          type: string
          description: Error type classification
        message:
          type: string
          description: Human-readable error message
        detail:
          type: string
          description: Additional error details
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where <token>
        is your auth token.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API_Key
      description: >-
        Pass as `Bearer <API_KEY>`. Get API Key from SuprSend dashboard
        Developers -> API Keys section.
    ServiceTokenAuth:
      type: apiKey
      in: header
      name: ServiceToken <token>
      description: >-
        You can get Service Token from [SuprSend dashboard -> Account Settings
        -> Service
        Tokens](https://app.suprsend.com/en/account-settings/service-tokens)
        section.

````