> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://api.docs.modulards.com/modular-ds-public-api/oauth/oauth-deny-authorization/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://api.modulards.com/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/oauth/oauth-deny-authorization ## Request ### Body (application/json) This endpoint expects an object. - `auth_token` (string, optional) ## Response ### 200 200 OK · denial redirect - `redirect` (string, optional) ## Examples ### 200 OK · denial redirect **Response** ```json { "redirect": "https://claude.ai/api/mcp/auth_callback?error=access_denied&state=client-state-123" } ``` **SDK Code** ```python 200 OK · denial redirect import requests url = "https://api.modulards.com/oauth/authorize" response = requests.delete(url) print(response.json()) ``` ```javascript 200 OK · denial redirect const url = 'https://api.modulards.com/oauth/authorize'; const options = {method: 'DELETE'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go 200 OK · denial redirect package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.modulards.com/oauth/authorize" req, _ := http.NewRequest("DELETE", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby 200 OK · denial redirect require 'uri' require 'net/http' url = URI("https://api.modulards.com/oauth/authorize") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Delete.new(url) response = http.request(request) puts response.read_body ``` ```java 200 OK · denial redirect import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.delete("https://api.modulards.com/oauth/authorize") .asString(); ``` ```php 200 OK · denial redirect request('DELETE', 'https://api.modulards.com/oauth/authorize'); echo $response->getBody(); ``` ```csharp 200 OK · denial redirect using RestSharp; var client = new RestClient("https://api.modulards.com/oauth/authorize"); var request = new RestRequest(Method.DELETE); IRestResponse response = client.Execute(request); ``` ```swift 200 OK · denial redirect import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/oauth/authorize")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "DELETE" 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() ``` ### OAuth · Deny authorization **Request** ```json { "auth_token": "" } ``` **Response** ```json { "redirect": "https://claude.ai/api/mcp/auth_callback?error=access_denied&state=client-state-123" } ``` **SDK Code** ```python OAuth · Deny authorization import requests url = "https://api.modulards.com/oauth/authorize" payload = { "auth_token": "" } headers = {"Content-Type": "application/json"} response = requests.delete(url, json=payload, headers=headers) print(response.json()) ``` ```javascript OAuth · Deny authorization const url = 'https://api.modulards.com/oauth/authorize'; const options = { method: 'DELETE', headers: {'Content-Type': 'application/json'}, body: '{"auth_token":""}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go OAuth · Deny authorization package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.modulards.com/oauth/authorize" payload := strings.NewReader("{\n \"auth_token\": \"\"\n}") req, _ := http.NewRequest("DELETE", url, payload) 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 require 'uri' require 'net/http' url = URI("https://api.modulards.com/oauth/authorize") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Delete.new(url) request["Content-Type"] = 'application/json' request.body = "{\n \"auth_token\": \"\"\n}" response = http.request(request) puts response.read_body ``` ```java OAuth · Deny authorization import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.delete("https://api.modulards.com/oauth/authorize") .header("Content-Type", "application/json") .body("{\n \"auth_token\": \"\"\n}") .asString(); ``` ```php OAuth · Deny authorization request('DELETE', 'https://api.modulards.com/oauth/authorize', [ 'body' => '{ "auth_token": "" }', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp OAuth · Deny authorization using RestSharp; var client = new RestClient("https://api.modulards.com/oauth/authorize"); var request = new RestRequest(Method.DELETE); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"auth_token\": \"\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift OAuth · Deny authorization import Foundation let headers = ["Content-Type": "application/json"] let parameters = ["auth_token": ""] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/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() ```