PATCH
/api/v1/compliance/licences/{id}Update a licence, enforcing the lifecycle
Updates a register entry. Status changes are gated by the lifecycle, not only by RLS: 'granted' is reachable only from 'submitted', and only a granted licence can expire. An illegal move returns 409 naming the allowed set. Every accepted change appends to the append-only trail. Moving the dates or the status re-arms renewal alerting.
Authentication
Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.
Parameters
id in pathrequiredstringRequest body required
Example
{
"orgId": "00000000-0000-0000-0000-000000000000",
"status": "not_started",
"authority": "string",
"reference": "string",
"ownerUserId": "00000000-0000-0000-0000-000000000000",
"effectiveFrom": "string",
"expiresAt": "string",
"renewalLeadDays": 0,
"notes": "string",
"reason": "<Recorded on the trail entry — the 'why' >"
}Schema
{
"application/json": {
"schema": {
"type": "object",
"properties": {
"orgId": {
"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)$"
},
"status": {
"type": "string",
"enum": [
"not_started",
"preparing",
"submitted",
"granted",
"rejected",
"expired",
"withdrawn",
"not_applicable"
]
},
"authority": {
"type": "string",
"maxLength": 300
},
"reference": {
"type": "string",
"maxLength": 300
},
"ownerUserId": {
"nullable": true,
"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)$"
},
"effectiveFrom": {
"nullable": true,
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
"expiresAt": {
"nullable": true,
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
"renewalLeadDays": {
"type": "integer",
"minimum": 0,
"maximum": 730
},
"notes": {
"type": "string",
"maxLength": 4000
},
"reason": {
"type": "string",
"maxLength": 1000,
"description": "Recorded on the trail entry — the 'why' the columns cannot hold."
}
},
"required": [
"orgId"
],
"additionalProperties": false
}
}
}Response
200 example
{
"licence": {
"id": "00000000-0000-0000-0000-000000000000",
"orgId": "00000000-0000-0000-0000-000000000000",
"kind": "licence",
"name": "string",
"jurisdiction": "<'EU', ISO-3166 alpha-2, or a subdivision>",
"authority": "string",
"frameworkId": "string",
"reference": "string",
"status": "not_started",
"ownerUserId": "00000000-0000-0000-0000-000000000000",
"effectiveFrom": "2026-01-01",
"expiresAt": "2026-01-01",
"renewalLeadDays": 0,
"notes": "string",
"standing": "in_force",
"daysUntilExpiry": 0
}
}All status codes
200The updated licence.
400Validation failed
401Unauthenticated
403Insufficient role or permission
404No such licence in this organisation
409Illegal status transition — the response names the allowed set
429Too Many Requests — the per-key or per-organization rate limit was exceeded. Honour the Retry-After header.
500Internal Server Error — DB_ERROR.
503Schema behind code
Code samples
cURL
# {id} is shown with an EXAMPLE value — replace it with real values.
curl -X PATCH \
https://evalguard.ai/api/v1/compliance/licences/00000000-0000-0000-0000-000000000000 \
-H "Authorization: Bearer $EVALGUARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "orgId": "00000000-0000-0000-0000-000000000000", "status": "not_started", "authority": "string", "reference": "string", "ownerUserId": "00000000-0000-0000-0000-000000000000", "effectiveFrom": "string", "expiresAt": "string", "renewalLeadDays": 0, "notes": "string", "reason": "<Recorded on the trail entry — the '\''why'\'' >" }'TypeScript
// The TypeScript SDK (@evalguard/sdk) exposes TYPED methods — runEval,
// getEval, runSecurityScan, checkFirewall, … — not a generic request().
// For an arbitrary endpoint, call it directly:
// {id} is shown with an EXAMPLE value — replace it with real values.
const res = await fetch("https://evalguard.ai/api/v1/compliance/licences/00000000-0000-0000-0000-000000000000", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.EVALGUARD_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"orgId": "00000000-0000-0000-0000-000000000000",
"status": "not_started",
"authority": "string",
"reference": "string",
"ownerUserId": "00000000-0000-0000-0000-000000000000",
"effectiveFrom": "string",
"expiresAt": "string",
"renewalLeadDays": 0,
"notes": "string",
"reason": "<Recorded on the trail entry — the 'why' >"
}),
});
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:
# {id} is shown with an EXAMPLE value — replace it with real values.
import os
import requests
headers = {"Authorization": f"Bearer {os.environ['EVALGUARD_API_KEY']}"}
headers["Content-Type"] = "application/json"
response = requests.request(
"PATCH",
"https://evalguard.ai/api/v1/compliance/licences/00000000-0000-0000-0000-000000000000",
headers=headers,
json={
"orgId": "00000000-0000-0000-0000-000000000000",
"status": "not_started",
"authority": "string",
"reference": "string",
"ownerUserId": "00000000-0000-0000-0000-000000000000",
"effectiveFrom": "string",
"expiresAt": "string",
"renewalLeadDays": 0,
"notes": "string",
"reason": "<Recorded on the trail entry — the 'why' >"
},
)
print(response.status_code, response.json())Go
package main
import (
"context"
"fmt"
"net/http"
"os"
"strings"
)
// {id} is shown with an EXAMPLE value — replace it with real values.
func main() {
body := strings.NewReader(`{"orgId":"00000000-0000-0000-0000-000000000000","status":"not_started","authority":"string","reference":"string","ownerUserId":"00000000-0000-0000-0000-000000000000","effectiveFrom":"string","expiresAt":"string","renewalLeadDays":0,"notes":"string","reason":"<Recorded on the trail entry — the 'why' >"}`)
req, _ := http.NewRequestWithContext(context.Background(), "PATCH", "https://evalguard.ai/api/v1/compliance/licences/00000000-0000-0000-0000-000000000000", 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
400401403404409429500503