PATCH
/api/v1/compliance/dpdp/sessionUpdate a DPDP session (consent change / close)
Updates consented purposes, child flag, metadata, or marks the session closed with a closure reason.
Authentication
Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/api-keys.
Request body required
Example
{
"sessionId": "00000000-0000-0000-0000-000000000000",
"consentedPurposes": [
"string"
],
"isChild": false,
"metadata": {},
"closed": false,
"closureReason": "string"
}Schema
{
"application/json": {
"schema": {
"type": "object",
"required": [
"sessionId"
],
"properties": {
"sessionId": {
"type": "string",
"format": "uuid"
},
"consentedPurposes": {
"type": "array",
"items": {
"type": "string"
}
},
"isChild": {
"type": "boolean"
},
"metadata": {
"type": "object"
},
"closed": {
"type": "boolean"
},
"closureReason": {
"type": "string"
}
}
}
}
}Response
All status codes
200Session updated.
400(no description)
401(no description)
429(no description)
Code samples
cURL
curl -X PATCH \
https://evalguard.ai/api/v1/compliance/dpdp/session \
-H "Authorization: Bearer $EVALGUARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "sessionId": "00000000-0000-0000-0000-000000000000", "consentedPurposes": [ "string" ], "isChild": false, "metadata": {}, "closed": false, "closureReason": "string" }'TypeScript
import { EvalGuard } from "@evalguard/sdk";
const client = new EvalGuard({ apiKey: process.env.EVALGUARD_API_KEY });
const response = await client.request({
method: "PATCH",
path: "/api/v1/compliance/dpdp/session",
body: {
"sessionId": "00000000-0000-0000-0000-000000000000",
"consentedPurposes": [
"string"
],
"isChild": false,
"metadata": {},
"closed": false,
"closureReason": "string"
},
});
console.log(response);Python
from evalguard import EvalGuard
import os
client = EvalGuard(api_key=os.environ["EVALGUARD_API_KEY"])
response = client.request(
method="PATCH",
path="/api/v1/compliance/dpdp/session",
body={
"sessionId": "00000000-0000-0000-0000-000000000000",
"consentedPurposes": [
"string"
],
"isChild": False,
"metadata": {},
"closed": False,
"closureReason": "string"
},
)
print(response)Go
package main
import (
"context"
"fmt"
"os"
"github.com/evalguard/evalguard-go"
)
func main() {
client := evalguard.NewClient(os.Getenv("EVALGUARD_API_KEY"))
resp, err := client.Request(context.Background(), "PATCH", "/api/v1/compliance/dpdp/session", map[string]any{"sessionId": "00000000-0000-0000-0000-000000000000", "consentedPurposes": []any{"string"}, "isChild": false, "metadata": map[string]any{}, "closed": false, "closureReason": "string"})
if err != nil { panic(err) }
fmt.Println(resp)
}Errors
400401429