---
title: "Update a price watch"
method: PATCH
path: "/v1/subscriptions/{id}"
tags: ["Subscriptions"]
---

# Update a price watch

`PATCH /v1/subscriptions/{id}`

## Request

- Base URL: `https://api.oilpriceapi.com`
- URL: `https://api.oilpriceapi.com/v1/subscriptions/{id}`
- Auth: API key in header `Authorization`

Update the configurable fields of one price watch owned by the authenticated account.

## Path parameters

- `id` string, required

## Request body

- object
  - `name` string
  - `codes` string[]
  - `code` string: Legacy single-code shorthand; folded into `codes`.
  - `interval_seconds` integer: Evaluation interval in seconds, subject to the account tier's minimum.
  - `deliver_webhook` boolean
  - `status` 'active' | 'paused'

## Response `200`

Subscription updated

- PriceWatchResponse
  - `status` 'success', required
  - `data` object, required
    - `subscription` PriceWatch, required: A persistent commodity watch evaluated on the configured interval.
      - `id` string, required
      - `name` string, nullable
      - `codes` string[], required
      - `interval_seconds` integer, required
      - `status` 'active' | 'paused', required
      - `deliver_webhook` boolean, required
      - `source` 'api' | 'mcp' | 'dashboard', required
      - `tool_name` string, nullable
      - `last_evaluated_at` string, date-time, nullable
      - `next_run_at` string, date-time, nullable
      - `created_at` string, date-time, required

## Other responses

- `401`: Unauthorized
- `404`: Subscription not found
- `422`: Price watch validation failed.
- `500`: Unexpected server error. Retry transient failures with bounded backoff and retain the request ID when contacting support.

---

[API](https://skmtc.dev/oilpriceapi/apis/oil-price-api-v1.md) - [All operations](https://skmtc.dev/oilpriceapi/apis/oil-price-api-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/oilpriceapi/apis/oil-price-api-v1/revisions/7f8b4d763210?raw)
