---
title: "ثبت تصمیم کاربر (اجازه / انصراف) و دریافت آدرس بازگشت"
method: POST
path: "/oauth/authorize"
tags: ["oauth"]
---

# ثبت تصمیم کاربر (اجازه / انصراف) و دریافت آدرس بازگشت

`POST /oauth/authorize`

## Request

- Base URL: `https://barchin.net/api`
- URL: `https://barchin.net/api/oauth/authorize`
- Auth: HTTP bearer

allow: کد یک‌بارمصرف (۵ دقیقه) می‌سازد و redirect_uri?code=…&state=… برمی‌گرداند. deny: redirect_uri?error=access_denied&state=…. state همیشه عیناً برگردانده می‌شود.

## Request body

- AuthorizeDecisionIn: The consent page's answer. Every OAuth parameter is optional *here* so a bad or missing one is reported in the same ``{code, message, redirect_to?}`` shape as the GET, not as a generic validation error.
  - `response_type` string, nullable
  - `client_id` string, nullable
  - `redirect_uri` string, nullable
  - `scope` string, nullable
  - `state` string, nullable
  - `code_challenge` string, nullable
  - `code_challenge_method` string, nullable
  - `decision` 'allow' | 'deny', required: allow: «اجازه می‌دهم»؛ deny: «انصراف».

## Response `200`

Successful Response

- AuthorizeRedirectOut
  - `redirect_to` string, required: مرورگر را به این آدرس بفرستید (redirect_uri با code یا error).

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `422`: Unprocessable Entity
- `429`: Too Many Requests

---

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