---
title: "Oauth"
description: "The oauth endpoints of the HTTP API."
---

> Documentation Index
> Fetch the complete documentation index at: https://slashobserve.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Oauth

## GET /oauth/requests/{id}

Read a pending request from an MCP client to act as the signed-in person.

The consent page reads this to show what the person approves. A request lives 10 minutes and is answered once. `client.name` is the name the client registered under and is not verified; `redirect_host` is where the browser returns after the answer, and `local` is true when that is this computer. `replaces_grant` is true when the person already connected this client. Only signed-in people may call it: a service-account key gets 403 `forbidden`.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (required) | path | `string` (uuid) |   |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The pending connection request. | `object` |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller is not allowed to perform the request; a role that is too low is code `forbidden_role`. | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | The resource does not exist, or the caller cannot see it; the two are never told apart. | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /oauth/requests/{id}/approve

Approve an MCP client so it acts as the signed-in person.

Answers once and consumes the request. `redirect_to` is the client's redirect URI with a one-time `code` (valid 60 seconds), the client's `state` and the issuer; the browser follows it. A person has at most 20 connected agents: approving a 21st client answers 409 `too_many_grants` and keeps the request, while approving a client the person already connected replaces that connection. Only signed-in people may call it, and a cookie session passes the cross-origin check: a service-account key gets 403 `forbidden`.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (required) | path | `string` (uuid) |   |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The request is approved. | `object` |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller is not allowed to perform the request; a role that is too low is code `forbidden_role`. | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | The resource does not exist, or the caller cannot see it; the two are never told apart. | [`Error`](/docs/reference/api/schemas/#error) |
| `409` | The person already has 20 connected agents (`too_many_grants`). The request stays pending. | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /oauth/requests/{id}/deny

Deny an MCP client's request to act as the signed-in person.

Answers once and consumes the request. `redirect_to` is the client's redirect URI with `error=access_denied`, the client's `state` and the issuer. Only signed-in people may call it: a service-account key gets 403 `forbidden`.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (required) | path | `string` (uuid) |   |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The request is denied. | `object` |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller is not allowed to perform the request; a role that is too low is code `forbidden_role`. | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | The resource does not exist, or the caller cannot see it; the two are never told apart. | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

Generated from [`api/openapi.yaml`](https://github.com/slashobserve/slashobserve/blob/c770e5e0/api/openapi.yaml) at `c770e5e0`. [Report a problem](https://github.com/slashobserve/slashobserve/issues/new).
