POST
/api/v1/data-residency/dpasUpsert a Data Processing Agreement
Creates or updates the org's DPA terms (sub-processors, allowed regions, transfer mechanism) consumed by the data-residency engine. Org-scoped; RLS-enforced; emits a data_residency.dpa.upsert audit row.
Authentication
Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/api-keys.
Request body required
Example
{
"projectId": "00000000-0000-0000-0000-000000000000",
"processorName": "string",
"processorType": "cloud-provider",
"regions": [
"us-east"
],
"classifications": [
"public"
],
"signedAt": "2026-07-14T19:53:34.703Z",
"expiresAt": "2026-07-14T19:53:34.703Z",
"dpaUrl": "https://example.com",
"contactEmail": "user@example.com",
"sccs": false,
"bcrs": false,
"adequacyBasis": "string",
"lastAuditedAt": "2026-07-14T19:53:34.703Z",
"status": "active"
}Schema
{
"application/json": {
"schema": {
"type": "object",
"properties": {
"projectId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"processorName": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"processorType": {
"type": "string",
"enum": [
"cloud-provider",
"sub-processor",
"analytics",
"ai-provider",
"cdn",
"other"
]
},
"regions": {
"maxItems": 30,
"type": "array",
"items": {
"type": "string",
"enum": [
"us-east",
"us-west",
"eu-west",
"eu-central",
"ap-south",
"ap-northeast",
"ap-southeast",
"ca-central",
"sa-east",
"me-south",
"af-south"
]
}
},
"classifications": {
"maxItems": 20,
"type": "array",
"items": {
"type": "string",
"enum": [
"public",
"internal",
"confidential",
"pii",
"phi",
"pci",
"restricted"
]
}
},
"signedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
},
"expiresAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
},
"dpaUrl": {
"type": "string",
"maxLength": 2000,
"format": "uri"
},
"contactEmail": {
"type": "string",
"maxLength": 320,
"format": "email",
"pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
},
"sccs": {
"type": "boolean"
},
"bcrs": {
"type": "boolean"
},
"adequacyBasis": {
"type": "string",
"maxLength": 500
},
"lastAuditedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
},
"status": {
"type": "string",
"enum": [
"active",
"pending",
"expired",
"terminated"
]
}
},
"required": [
"projectId",
"processorName"
],
"additionalProperties": false
}
}
}Response
200 example
{
"success": true
}All status codes
200DPA upserted.
400(no description)
401(no description)
403Forbidden — insufficient role for this operation.
429(no description)
Code samples
cURL
curl -X POST \
https://evalguard.ai/api/v1/data-residency/dpas \
-H "Authorization: Bearer $EVALGUARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "projectId": "00000000-0000-0000-0000-000000000000", "processorName": "string", "processorType": "cloud-provider", "regions": [ "us-east" ], "classifications": [ "public" ], "signedAt": "2026-07-14T19:53:34.703Z", "expiresAt": "2026-07-14T19:53:34.703Z", "dpaUrl": "https://example.com", "contactEmail": "user@example.com", "sccs": false, "bcrs": false, "adequacyBasis": "string", "lastAuditedAt": "2026-07-14T19:53:34.703Z", "status": "active" }'TypeScript
import { EvalGuard } from "@evalguard/sdk";
const client = new EvalGuard({ apiKey: process.env.EVALGUARD_API_KEY });
const response = await client.request({
method: "POST",
path: "/api/v1/data-residency/dpas",
body: {
"projectId": "00000000-0000-0000-0000-000000000000",
"processorName": "string",
"processorType": "cloud-provider",
"regions": [
"us-east"
],
"classifications": [
"public"
],
"signedAt": "2026-07-14T19:53:34.703Z",
"expiresAt": "2026-07-14T19:53:34.703Z",
"dpaUrl": "https://example.com",
"contactEmail": "user@example.com",
"sccs": false,
"bcrs": false,
"adequacyBasis": "string",
"lastAuditedAt": "2026-07-14T19:53:34.703Z",
"status": "active"
},
});
console.log(response);Python
from evalguard import EvalGuard
import os
client = EvalGuard(api_key=os.environ["EVALGUARD_API_KEY"])
response = client.request(
method="POST",
path="/api/v1/data-residency/dpas",
body={
"projectId": "00000000-0000-0000-0000-000000000000",
"processorName": "string",
"processorType": "cloud-provider",
"regions": [
"us-east"
],
"classifications": [
"public"
],
"signedAt": "2026-07-14T19:53:34.703Z",
"expiresAt": "2026-07-14T19:53:34.703Z",
"dpaUrl": "https://example.com",
"contactEmail": "user@example.com",
"sccs": False,
"bcrs": False,
"adequacyBasis": "string",
"lastAuditedAt": "2026-07-14T19:53:34.703Z",
"status": "active"
},
)
print(response)Go
package main
import (
"context"
"fmt"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{"projectId":"00000000-0000-0000-0000-000000000000","processorName":"string","processorType":"cloud-provider","regions":["us-east"],"classifications":["public"],"signedAt":"2026-07-14T19:53:34.703Z","expiresAt":"2026-07-14T19:53:34.703Z","dpaUrl":"https://example.com","contactEmail":"user@example.com","sccs":false,"bcrs":false,"adequacyBasis":"string","lastAuditedAt":"2026-07-14T19:53:34.703Z","status":"active"}`)
req, _ := http.NewRequestWithContext(context.Background(), "POST", "https://evalguard.ai/api/v1/data-residency/dpas", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("EVALGUARD_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
fmt.Println(resp.Status)
}Errors
400401403429