---
title: "[cloud-only] Submit OAuth consent decision"
method: POST
path: "/oauth/authorize"
tags: ["auth"]
---

# \[cloud-only\] Submit OAuth consent decision

`POST /oauth/authorize`

[cloud-only] JSON-only consent submission. The handler verifies the per-row CSRF token, atomically marks the authorization request consumed (single-use covers both allow and deny paths), then returns the redirect URL the browser must navigate to. The URL contains either `code` + original `state` for allow, or the RFC 6749 §5.2 error and `state` for deny.

Workspace membership is re-checked at submission time. Consent is persisted keyed by `(user_id, client_id, resource_id, workspace_id)`; broadening the previously approved scope set requires a fresh consent flow.

## Request body

- object
  - `oauth_request_id` string, uuid, required
  - `csrf_token` string, required
  - `decision` 'allow' | 'deny', required
  - `workspace_id` string, required

## Response `200`

Redirect URL for the frontend to navigate to (allow → with code+state; deny → with error+state)

- OAuthAuthorizeRedirectResponse — [cloud-only] Redirect target produced after a JSON consent submission. The frontend must navigate the browser to this URL so custom-scheme client callbacks work without relying on fetch-visible 302 headers.
  - `redirect_url` string, uri, required — OAuth client redirect URI with either code+state for allow, or error+state for deny.

## Other responses

- `400` — Bad request (CSRF mismatch, expired/consumed request, inaccessible workspace)
- `403` — Scope broadening on consent re-grant — fresh consent flow required
- `404` — OAuth disabled

## Changes

- **2026-05-21** `eda7dd3d95f1` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/comfy-org/apis/comfyui-api/changes/oauth/authorize/post.md)

---

[API](https://skmtc.dev/comfy-org/apis/comfyui-api.md) · [All operations](https://skmtc.dev/comfy-org/apis/comfyui-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/comfy-org/comfyui-api/revisions/c4db9e1283df/schema)
