---
title: "Authorize"
method: POST
path: "/oauth/authorize"
tags: ["oauth"]
---

# Authorize

`POST /oauth/authorize`

Mint an authorization code for the approving user. Returns the URL the
browser should be redirected to (``redirect_uri`` + ``code`` + ``state``).

The frontend has already authenticated the user (Supabase session) and
shown the consent UI; this endpoint enforces the protocol invariants.

## Request body

- AuthorizeRequest
  - `client_id` string, required
  - `redirect_uri` string, required
  - `code_challenge` string, required
  - `code_challenge_method` string
  - `response_type` string
  - `scope` string, nullable
  - `state` string, nullable
  - `resource` string, nullable
  - `device_name` string, nullable

## Response `200`

Successful Response

- object

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/repowise/apis/repowise-hosted-api.md) · [All operations](https://skmtc.dev/repowise/apis/repowise-hosted-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/repowise/repowise-hosted-api/revisions/1e57283a9737/schema)
