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

# Update a widget token

> Updates the `payload` carried by the Wavix Embeddable widget token identified by `id`.



## OpenAPI

````yaml https://wavix.github.io/wavix-openapi/wavix-api.yaml put /v2/webrtc/tokens/{id}
openapi: 3.1.0
info:
  title: Wavix APIs
  description: >-
    Wavix provides robust APIs that let you integrate voice and text messaging
    features directly into your app. Send text, place calls, and access detailed
    reports  programmatically.
  termsOfService: https://wavix.com/terms-and-conditions
  license:
    name: MIT
    identifier: MIT
  contact:
    name: Wavix
    url: https://wavix.com
    email: support@wavix.com
  version: '1.0'
servers:
  - url: https://api.wavix.com
    description: https://api.wavix.com
    variables: {}
security:
  - bearerAuth: []
tags:
  - name: SIP trunks
    description: SIP trunks
  - name: Buy
    description: Numbers
  - name: Cart
    description: Numbers
  - name: My numbers
    description: Numbers
  - name: Billing
    description: Billing, transactions, and invoices
  - name: Profile
    description: Account profile and customer information
  - name: CDRs
    description: Call detail records and call history
  - name: Speech Analytics
    description: Call transcription and speech analytics
  - name: SMS and MMS
    description: Messaging
  - name: Number Validator
    description: Phone number validation
  - name: Link shortener
    description: Short link and click metrics
  - name: 2FA
    description: Two-factor authentication
  - name: 10DLC
    description: 10DLC Campaigns and Brands
  - name: API Keys
    description: API key management
  - name: Call webhooks
    description: Webhook configuration for call events
  - name: Call control
    description: Programmable Voice
  - name: Call streaming
    description: Real-time call audio streaming over WebSocket
  - name: Call recording
    description: Call recording
  - name: Sub-accounts
    description: Sub-account management
  - name: Voice campaigns
    description: Outbound voice campaigns
  - name: Wavix Embeddable
    description: WebRTC embeddable widget
paths:
  /v2/webrtc/tokens/{id}:
    put:
      tags:
        - Wavix Embeddable
      summary: Update a widget token
      description: >-
        Updates the `payload` carried by the Wavix Embeddable widget token
        identified by `id`.
      operationId: webrtc_tokens_update
      parameters:
        - name: id
          in: path
          description: The UUID of the widget token to update.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: >-
          Fields to update on the widget token. Only included fields are
          changed.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebRTCTokenUpdateRequest'
        required: true
      responses:
        '200':
          description: Returns the updated widget token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebRTCToken'
              examples:
                success:
                  summary: Successful response
                  value:
                    uuid: 550e8400-e29b-41d4-a716-446655440000
                    sip_trunk: my-sip-trunk
                    payload: {}
                    ttl: 3600
        '400':
          $ref: '#/components/responses/BadRequestErrorResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedErrorResponse'
        '403':
          $ref: '#/components/responses/ForbiddenErrorResponse'
        '404':
          $ref: '#/components/responses/NotFoundErrorResponse'
      deprecated: false
      security:
        - bearerAuth:
            - embeddable:write
components:
  schemas:
    WebRTCTokenUpdateRequest:
      title: WebRTCTokenUpdateRequest
      type: object
      additionalProperties: false
      required:
        - payload
      properties:
        payload:
          type: object
          description: >-
            Arbitrary client-defined data to associate with the token, replacing
            the existing payload.
          example: {}
    WebRTCToken:
      title: WebRTCToken
      description: >-
        Represents a WebRTC token that authorizes the Wavix embeddable widget to
        register against a SIP trunk.
      type: object
      additionalProperties: false
      required:
        - uuid
        - sip_trunk
      properties:
        uuid:
          type: string
          description: Unique identifier of the WebRTC token.
          example: 550e8400-e29b-41d4-a716-446655440000
        sip_trunk:
          type: string
          description: Name of the SIP trunk the token authenticates against.
          example: my-sip-trunk
        payload:
          type:
            - object
            - 'null'
          description: Arbitrary client-defined data associated with the token.
          example: {}
        ttl:
          type:
            - integer
            - 'null'
          minimum: 1
          description: Time to live, in seconds. `null` means no expiration.
          example: 3600
    ValidationErrorResponse:
      title: ValidationErrorResponse
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        message:
          type: string
          description: >-
            Human-readable description naming the missing or invalid request
            parameter.
          example: Missing or invalid parameter <param_name>
    UnauthorizedErrorResponse:
      title: UnauthorizedErrorResponse
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        error:
          type: boolean
          description: >-
            Indicates that the response represents an error. Always `true` for
            this error.
          example: true
        message:
          type: string
          description: >-
            Human-readable description stating that authentication is missing or
            invalid.
          example: Unauthorized
    ForbiddenErrorResponse:
      title: ForbiddenErrorResponse
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        message:
          type: string
          description: Human-readable description of why access is forbidden.
          example: The service is not provisioned for your account.
    NotFoundErrorResponse:
      title: NotFoundErrorResponse
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        message:
          type: string
          description: >-
            Human-readable description stating that no resource matches the
            given ID.
          example: Record not found
  responses:
    BadRequestErrorResponse:
      description: Request failed. Missing or invalid parameter <param_name>
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorResponse'
    UnauthorizedErrorResponse:
      description: Unauthorized
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthorizedErrorResponse'
    ForbiddenErrorResponse:
      description: Request failed. The feature is disabled for your account.
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ForbiddenErrorResponse'
    NotFoundErrorResponse:
      description: Request failed. An object with the specified ID is not found.
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NotFoundErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Wavix API key. Pass as `Authorization: Bearer <api_key>`. Keys support
        per-resource scopes (none / read / write). See [Restricted keys and
        scopes](https://docs.wavix.com/api-reference/authentication#restricted-keys-and-scopes).

````