OAuth Server
Submit consent decision
Submit the user’s Approve or Deny decision. Returns the client
redirect_uri to send the browser to — with a code (and state) on
approval, or error=access_denied on denial. Bound to the live
session with an access token and a DPoP proof.
POST
/
v1
/
session
/
oauth
/
decision
Submit consent decision
curl --request POST \
--url https://{appId}.session.prelude.dev/v1/session/oauth/decision \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'DPoP: <api-key>' \
--data '
{
"oauth_req": "<string>",
"approve": true
}
'import requests
url = "https://{appId}.session.prelude.dev/v1/session/oauth/decision"
payload = {
"oauth_req": "<string>",
"approve": True
}
headers = {
"Authorization": "Bearer <token>",
"DPoP": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
DPoP: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({oauth_req: '<string>', approve: true})
};
fetch('https://{appId}.session.prelude.dev/v1/session/oauth/decision', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{appId}.session.prelude.dev/v1/session/oauth/decision",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'oauth_req' => '<string>',
'approve' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"DPoP: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{appId}.session.prelude.dev/v1/session/oauth/decision"
payload := strings.NewReader("{\n \"oauth_req\": \"<string>\",\n \"approve\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("DPoP", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{appId}.session.prelude.dev/v1/session/oauth/decision")
.header("Authorization", "Bearer <token>")
.header("DPoP", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"oauth_req\": \"<string>\",\n \"approve\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{appId}.session.prelude.dev/v1/session/oauth/decision")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["DPoP"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"oauth_req\": \"<string>\",\n \"approve\": true\n}"
response = http.request(request)
puts response.read_body{
"redirect_url": "<string>"
}{
"code": "bad_request",
"type": "bad_request"
}{
"code": "unauthorized",
"type": "unauthorized"
}{
"code": "internal",
"type": "internal"
}Authorizations
Access token obtained from session refresh
DPoP proof JWT (RFC 9449) bound to the calling session's key. Required
alongside the access token on the OAuth login-UI endpoints
(/oauth/continue, /oauth/pending, /oauth/decision). The Web SDK
constructs and rotates this proof for you.
Body
application/json
Response
OK
The URL the browser should navigate to next.
Example:
"https://auth.example.com/oauth/consent?oauth_req=oar_01jqebhswje1ka1z7ahr9rfsgt"
⌘I
Submit consent decision
curl --request POST \
--url https://{appId}.session.prelude.dev/v1/session/oauth/decision \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'DPoP: <api-key>' \
--data '
{
"oauth_req": "<string>",
"approve": true
}
'import requests
url = "https://{appId}.session.prelude.dev/v1/session/oauth/decision"
payload = {
"oauth_req": "<string>",
"approve": True
}
headers = {
"Authorization": "Bearer <token>",
"DPoP": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
DPoP: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({oauth_req: '<string>', approve: true})
};
fetch('https://{appId}.session.prelude.dev/v1/session/oauth/decision', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{appId}.session.prelude.dev/v1/session/oauth/decision",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'oauth_req' => '<string>',
'approve' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"DPoP: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{appId}.session.prelude.dev/v1/session/oauth/decision"
payload := strings.NewReader("{\n \"oauth_req\": \"<string>\",\n \"approve\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("DPoP", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{appId}.session.prelude.dev/v1/session/oauth/decision")
.header("Authorization", "Bearer <token>")
.header("DPoP", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"oauth_req\": \"<string>\",\n \"approve\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{appId}.session.prelude.dev/v1/session/oauth/decision")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["DPoP"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"oauth_req\": \"<string>\",\n \"approve\": true\n}"
response = http.request(request)
puts response.read_body{
"redirect_url": "<string>"
}{
"code": "bad_request",
"type": "bad_request"
}{
"code": "unauthorized",
"type": "unauthorized"
}{
"code": "internal",
"type": "internal"
}