---
title: "Approve a CLI device sign-in"
method: POST
path: "/oauth/device-approve"
tags: ["OAuth Consent"]
---

# Approve a CLI device sign-in

`POST /oauth/device-approve`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/oauth/device-approve`
- 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

- DeviceApprove
  - `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"
  - `user_code` string, required
  - `workspace_id` integer, nullable
  - `read_only` boolean: Grant read-only access: the app may read but never change anything

## Response `204`

Decision recorded

## Other responses

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

---

[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/fe078afe239b?raw)
