> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api.docs.modulards.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.docs.modulards.com/_mcp/server.

# OAuth · Deny authorization

DELETE https://oauth/authorize
Content-Type: application/json

Denies the pending OAuth authorization from the dashboard consent screen (Passport session endpoint).

Same contract as the approve: single-use `auth_token`, dashboard session cookie plus `X-XSRF-TOKEN`.

**Responses**:

* With `Accept: application/json`: **200** `{"redirect": url}` — the client callback carrying `error=access_denied` and `state`, delivered to the client the same way it receives a code (the SPA navigates top level).
* Without it: **302** with the same URL in `Location`.
* Expired, unknown or reused `auth_token`: **403**.

Host root, no `/api` prefix.

Reference: https://api.docs.modulards.com/modular-ds-public-api/o-auth-deny-authorization

## Authentication

- `Authorization` header (bearer token, required)

## Request

### Body (application/json)

- `auth_token` (string, required)

## Response

### 200

OK

- `redirect` (string, required)

## Examples

**Request**

```json
{
  "auth_token": "<auth_token from the consent screen URL>"
}
```

**Response**

```json
{
  "redirect": "https://claude.ai/api/mcp/auth_callback?error=access_denied&state=client-state-123"
}
```

**SDK Code**

```python OAuth · Deny authorization_example
import requests

url = "https://https/oauth/authorize"

payload = { "auth_token": "<auth_token from the consent screen URL>" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.delete(url, json=payload, headers=headers)

print(response.json())
```

```javascript OAuth · Deny authorization_example
const url = 'https://https/oauth/authorize';
const options = {
  method: 'DELETE',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"auth_token":"<auth_token from the consent screen URL>"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go OAuth · Deny authorization_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://https/oauth/authorize"

	payload := strings.NewReader("{\n  \"auth_token\": \"<auth_token from the consent screen URL>\"\n}")

	req, _ := http.NewRequest("DELETE", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby OAuth · Deny authorization_example
require 'uri'
require 'net/http'

url = URI("https://https/oauth/authorize")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"auth_token\": \"<auth_token from the consent screen URL>\"\n}"

response = http.request(request)
puts response.read_body
```

```java OAuth · Deny authorization_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://https/oauth/authorize")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"auth_token\": \"<auth_token from the consent screen URL>\"\n}")
  .asString();
```

```php OAuth · Deny authorization_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://https/oauth/authorize', [
  'body' => '{
  "auth_token": "<auth_token from the consent screen URL>"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp OAuth · Deny authorization_example
using RestSharp;

var client = new RestClient("https://https/oauth/authorize");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"auth_token\": \"<auth_token from the consent screen URL>\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift OAuth · Deny authorization_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["auth_token": "<auth_token from the consent screen URL>"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://https/oauth/authorize")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```