POST
/api/v1/data-residencyUpdate data-residency settings
Upserts a project's residency policy (one row per project, keyed on project_id — a second POST updates rather than duplicating). Body requires `projectId` and `primaryRegion`; `allowedRegions` (max 30), `dataClassificationRules` and `dpaConfig` are optional. Every region must match `xx-region-N` AND resolve to a real data plane — an unsupported region is rejected 400 with the supported list, never silently downgraded. Admin role and the Team plan are required for all changes; there is no multi-step confirmation step. Returns 201 with the stored row.
Authentication
Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.
Request body required
Example
{
"projectId": "00000000-0000-0000-0000-000000000000",
"primaryRegion": "string",
"allowedRegions": [
"string"
],
"dataClassificationRules": {},
"dpaConfig": {}
}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)$"
},
"primaryRegion": {
"type": "string",
"maxLength": 60,
"pattern": "^[a-z]{2,3}-[a-z]+-\\d{1,2}$"
},
"allowedRegions": {
"maxItems": 30,
"type": "array",
"items": {
"type": "string",
"maxLength": 60,
"pattern": "^[a-z]{2,3}-[a-z]+-\\d{1,2}$"
}
},
"dataClassificationRules": {
"type": "object",
"additionalProperties": {}
},
"dpaConfig": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"projectId",
"primaryRegion"
],
"additionalProperties": false
}
}
}Response
200 example
{
"success": true
}All status codes
200Updated.
201Created.
400(no description)
401(no description)
403Forbidden — insufficient role for this operation.
409Conflict — CONFLICT.
429(no description)
500Internal Server Error — DB_ERROR.
Code samples
cURL
curl -X POST \
https://evalguard.ai/api/v1/data-residency \
-H "Authorization: Bearer $EVALGUARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "projectId": "00000000-0000-0000-0000-000000000000", "primaryRegion": "string", "allowedRegions": [ "string" ], "dataClassificationRules": {}, "dpaConfig": {} }'TypeScript
// The TypeScript SDK (@evalguard/sdk) exposes TYPED methods — runEval,
// getEval, runSecurityScan, checkFirewall, … — not a generic request().
// For an arbitrary endpoint, call it directly:
const res = await fetch("https://evalguard.ai/api/v1/data-residency", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.EVALGUARD_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"projectId": "00000000-0000-0000-0000-000000000000",
"primaryRegion": "string",
"allowedRegions": [
"string"
],
"dataClassificationRules": {},
"dpaConfig": {}
}),
});
console.log(res.status, await res.json());Python
# The Python SDK (pip install evalguardai) exposes TYPED methods on
# EvalGuardClient — run_eval, get_eval, … — not a generic request().
# For an arbitrary endpoint, call it directly:
import os
import requests
headers = {"Authorization": f"Bearer {os.environ['EVALGUARD_API_KEY']}"}
headers["Content-Type"] = "application/json"
response = requests.request(
"POST",
"https://evalguard.ai/api/v1/data-residency",
headers=headers,
json={
"projectId": "00000000-0000-0000-0000-000000000000",
"primaryRegion": "string",
"allowedRegions": [
"string"
],
"dataClassificationRules": {},
"dpaConfig": {}
},
)
print(response.status_code, response.json())Go
package main
import (
"context"
"fmt"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{"projectId":"00000000-0000-0000-0000-000000000000","primaryRegion":"string","allowedRegions":["string"],"dataClassificationRules":{},"dpaConfig":{}}`)
req, _ := http.NewRequestWithContext(context.Background(), "POST", "https://evalguard.ai/api/v1/data-residency", 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
400401403409429500