---
title: "Upsert Oauth Grant"
method: PUT
path: "/v1/oauth/grants/{client_id}"
---

# Upsert Oauth Grant

`PUT /v1/oauth/grants/{client_id}`

## Request

- Base URL: `https://api.segly.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.segly.io/v1/oauth/grants/{client_id}`
- Auth: HTTP bearer

Persist product permissions before Supabase mints the client token.

## Path parameters

- `client_id` string, required

## Request body

- OAuthGrantUpdateRequest
  - `scopes` string[], required
  - `purchase_enabled` boolean

## Response `200`

Successful Response

- OAuthGrantResource
  - `client_id` string, required
  - `scopes` string[], required
  - `purchase_enabled` boolean, required
  - `revoked_at` string, date-time, nullable
  - `updated_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/segly/apis/segly-io-api.md) · [All operations](https://skmtc.dev/segly/apis/segly-io-api/llms.txt) · [OpenAPI document](https://skmtc.dev/segly/apis/segly-io-api/revisions/f831b05317d0?raw)
