---
title: "PATCH /api/v1/servicevariables/{service_variable_id}/"
method: PATCH
path: "/api/v1/servicevariables/{service_variable_id}/"
tags: ["servicevariables"]
---

# PATCH /api/v1/servicevariables/{service_variable_id}/

`PATCH /api/v1/servicevariables/{service_variable_id}/`

## Request

- Base URL: `https://uptime.com` (the document declares no server; this is the origin it was published from)
- URL: `https://uptime.com/api/v1/servicevariables/{service_variable_id}/`
- Auth: none declared
- TypeScript: <https://skmtc.dev/uptime/apis/uptime-com-openapi-schema/docs/api/v1/servicevariables/:service_variable_id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Update a service variable

    ** Request Body Requirements **

    variable_name can only include alphanumeric characters and underscores
    variable_name must be unique for the service

    property_name must be the name of a property that can be in the credential
    These properties are based on the credential type
    Here is the map of credential types to the properties that can be used:
        BASIC = "password", "username"
        CERTIFICATE = "certificate", "key", "passphrase"
        TOKEN = "secret"

## Path parameters

- `service_variable_id` string, required

## Request body

- ServiceVariableUpdate
  - `credential_id` integer, nullable
  - `variable_name` string, nullable
  - `property_name` string, nullable

## Response `200`

- ServiceVariableModel
  - `id` integer, required
  - `credential` object
    - `id` integer
    - `credential_type` 'BASIC' | 'CERTIFICATE' | 'TOKEN' | 'TOTP', required
    - `display_name` string, required
    - `description` string
    - `hint` string
    - `username` string
    - `version` string
    - `used_secret_properties` string[]
    - `created_by` string, nullable
  - `property_name` string, required
  - `variable_name` string, required
  - `deleted_at` string, date-time, required
  - `account` string, required
  - `service` string, required

---

[API](https://skmtc.dev/uptime/apis/uptime-com-openapi-schema.md) - [All operations](https://skmtc.dev/uptime/apis/uptime-com-openapi-schema/llms.txt) - [OpenAPI document](https://skmtc.dev/uptime/apis/uptime-com-openapi-schema/revisions/e1e4a57a60d8?raw)
