---
title: "Oauth Approve"
method: POST
path: "/api/v1/auth/oauth/approve"
---

# Oauth Approve

`POST /api/v1/auth/oauth/approve`

## Request

- Base URL: `https://api.mesharc.dev` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mesharc.dev/api/v1/auth/oauth/approve`
- Auth: none declared

Connect the app: one grant, backed by one ordinary API key.

Gated exactly like POST /me/keys, because that is what this is -- minting
a key. Looser would mean a member could get one through read-only consent,
and that a 30-day credential could be issued on a session cookie alone
without the second factor being shown again.

The workspace comes from the session (`auth["org"]`), never from the body:
`require("admin")` reads the role from the session's current org, so taking
the org from anywhere else would check one workspace and write to another.

## Headers

- `authorization` string, nullable
- `x-mesharc-tenant` string, nullable

## Request body

- OAuthDecision
  - `client_id` string, required
  - `redirect_uri` string, required
  - `code_challenge` string, required
  - `code_challenge_method` string
  - `scope` string
  - `state` string, nullable
  - `resource` string

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

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