---
title: "Allow: issue a one-time code and return to the app"
method: POST
path: "/oauth/consent"
tags: ["OAuth Consent"]
---

# Allow: issue a one-time code and return to the app

`POST /oauth/consent`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/oauth/consent`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

## Request body

- AuthorizeAllow
  - `project_id` integer, nullable: One project; with project_ids it must be one of them
  - `project_ids` integer[], nullable: The projects to pin the sign-in to; null = "All projects"
  - `client_id` string, required
  - `redirect_uri` string, required
  - `state` string, nullable
  - `code_challenge` string, required
  - `code_challenge_method` string, required
  - `read_only` boolean: Grant read-only access: the app may read but never change anything
  - `resource` string, nullable
  - `workspace_id` integer, nullable

## Response `200`

Return to the app

- ConsentRedirect
  - `redirect_url` string, required: Where to send the browser next: back to the app

## Other responses

- `400`: Bad Request
- `401`: Authorization error
- `403`: Request forbidden -- authorization will not help
- `404`: Not found

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/4b2c943a00dc?raw)
