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

# update a variable

> change the default, rename, or connect / disconnect a tool. `toolId: null` disconnects (and drops the output pick); a new `toolId` resets it.



## OpenAPI

````yaml /openapi.json patch /v1/variables/{variable_id}
openapi: 3.1.0
info:
  title: silk api
  version: 1.0.0
  description: >-
    rumik ai's speech api. synthesize speech with the expressive `muga` model,
    the faster `mulberry` model or the multilingual `mulberry-1.6` model over
    http or a streaming websocket session, run conversational voice agents over
    webrtc, a realtime pcm socket or the phone, and manage everything the agents
    playground does — agents, voices, variables, tools, phone numbers, sip
    trunks and outbound calls — with the same api key.
  contact:
    name: rumik ai
    url: https://rumik.ai
servers:
  - url: https://silk-api.rumik.ai
    description: production
security:
  - bearerAuth: []
tags:
  - name: speech
    description: text-to-speech over HTTP and WebSocket.
  - name: voice agents
    description: start calls with a deployed agent from your own app.
  - name: agents
    description: build, configure, deploy and inspect your agents.
  - name: calls
    description: place outbound phone calls and read call history.
  - name: voices
    description: the voices, languages and styles an agent may use.
  - name: variables
    description: account-wide `{name}` prompt variables and their defaults.
  - name: tools
    description: HTTP tools agents call before or during a call.
  - name: phone numbers
    description: 'numbers rented through rumik: search, rent, connect, release.'
  - name: sip trunks
    description: bring your own numbers over SIP.
paths:
  /v1/variables/{variable_id}:
    patch:
      tags:
        - variables
      summary: update a variable
      description: >-
        change the default, rename, or connect / disconnect a tool. `toolId:
        null` disconnects (and drops the output pick); a new `toolId` resets it.
      operationId: updateVariable
      parameters:
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: the variable's id.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableUpdateRequest'
            examples:
              default:
                value:
                  defaultValue: acme corp
      responses:
        '200':
          description: ok.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Variable'
              examples:
                default:
                  value:
                    id: 019f9f43-5e71-7082-bd9e-0f1a2b3c4d5e
                    name: company
                    defaultValue: acme corp
                    toolId: null
                    toolOutput: null
                    createdAt: '2026-09-11T10:00:00Z'
                    updatedAt: '2026-09-11T10:00:00Z'
        '401':
          description: >-
            `unauthorized` — key missing, malformed, unknown, revoked or
            expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                unauthorized:
                  value:
                    error: Invalid API key
                    code: unauthorized
        '403':
          description: '`forbidden_scope` — the key was created without the `agent` scope.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                forbidden_scope:
                  value:
                    error: This API key lacks the 'agent' scope
                    code: forbidden_scope
        '404':
          description: '`agent_variable_not_found` — no such variable on this account.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                agent_variable_not_found:
                  value:
                    error: Variable not found
                    code: agent_variable_not_found
        '409':
          description: >-
            `agent_variable_name_taken` — another variable already has this name
            (case-insensitive).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                agent_variable_name_taken:
                  value:
                    error: A variable with this name already exists
                    code: agent_variable_name_taken
        '422':
          description: >-
            `agent_variable_invalid` — the tool named is not one of the
            account's before-call tools, or the output pick does not exist on
            it. `invalid_request` — a field is missing or malformed. `details`
            lists every failing field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                agent_variable_invalid:
                  value:
                    error: The variable is invalid
                    code: agent_variable_invalid
                invalid_request:
                  value:
                    error: >-
                      body.toNumber: must be an E.164 phone number, e.g.
                      +14155551234
                    code: invalid_request
                    details:
                      - loc: body.toNumber
                        message: must be an E.164 phone number, e.g. +14155551234
        '429':
          description: >-
            `rate_limited` — the key's per-minute budget is spent. `Retry-After`
            says how long to wait; the body carries `limit` and `current`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                rate_limited:
                  value:
                    error: Rate limit exceeded
                    code: rate_limited
                    limit: 100
                    current: 101
          headers:
            Retry-After:
              description: seconds to wait before retrying (per-key rate limit only).
              schema:
                type: integer
components:
  schemas:
    VariableUpdateRequest:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          description: rename the variable.
        defaultValue:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          description: the new default.
        toolId:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          description: connect a tool; `null` disconnects.
        toolOutput:
          anyOf:
            - type: string
              maxLength: 65
            - type: 'null'
          description: the output pick.
      type: object
      title: VariableUpdateRequest
      description: |-
        ``PATCH /agents/variables/{id}``: every field optional; ``toolId: null``
        disconnects the tool (and drops the output pick with it).
    Variable:
      properties:
        id:
          type: string
          format: uuid
          description: the variable's id.
        name:
          type: string
          description: the `{name}` prompts use.
        defaultValue:
          type: string
          description: the fallback value.
        toolId:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          description: the before-call tool feeding it, or null.
        toolOutput:
          anyOf:
            - type: string
            - type: 'null'
          description: the output taken from that tool, or null.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      type: object
      required:
        - id
        - name
        - defaultValue
        - toolId
        - toolOutput
        - createdAt
        - updatedAt
      title: Variable
      description: an account-wide `{name}` prompt variable.
    Error:
      type: object
      properties:
        error:
          type: string
          description: human-readable error message.
        code:
          type: string
          description: machine-readable error code.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        your rumik api key, e.g. `rk_live_...`. create one in the rumik
        dashboard.

````