---
title: "PUT /vfields/{id}"
method: PUT
path: "/vfields/{id}"
tags: ["vfields"]
---

# PUT /vfields/{id}

`PUT /vfields/{id}`

## Request

- Base URL: `https://api.axiom.co/v2`
- URL: `https://api.axiom.co/v2/vfields/{id}`
- Auth: OAuth 2
  - Authorization code: `https://accounts.google.com/o/oauth2/v2/auth`
  - Token URL: `https://www.googleapis.com/oauth2/v4/token` scopes: `virtualFields|update`
- TypeScript: <https://skmtc.dev/axiom/apis/axiom-public-api/docs/vfields/:id/put.ts> (a function with typed inputs; its response is checked against the schema)

Replaces all fields of a virtual field. Omitted optional fields are cleared. The ID doesn't change, even if you change `name` or `dataset`.

## Path parameters

- `id` string, required

## Request body

- VirtualField
  - `dataset` string, required
  - `description` string
  - `expression` string, required
  - `name` string, required: Name of the virtual field. Use letters, digits, underscores, and hyphens, starting and ending with a letter or digit.
  - `type` string
  - `unit` string

## Response `200`

Updated virtual field.

- VirtualFieldWithId
  - `dataset` string, required
  - `description` string
  - `expression` string, required
  - `name` string, required: Name of the virtual field. Use letters, digits, underscores, and hyphens, starting and ending with a letter or digit.
  - `type` string
  - `unit` string
  - `id` string, required

## Other responses

- `400`: Missing `dataset`, `name`, or `expression`, an invalid `name`, or an expression that doesn't parse.
- `403`: You don't have permission to update virtual fields on the current or new dataset.
- `404`: Virtual field not found.

## Changes

- **2026-10-16** (v2) `fbc1b8430feb`: 3 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `403`
  - added the non-success response with the status `404`

[Operation history](https://skmtc.dev/axiom/apis/axiom-public-api/changes/vfields/:id/put.md)

---

[API](https://skmtc.dev/axiom/apis/axiom-public-api.md) - [All operations](https://skmtc.dev/axiom/apis/axiom-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/axiom/apis/axiom-public-api/revisions/7e39a295e3ba?raw)
