Skip to content
POST/api/v1/security/model-scan/{scanId}/promote

Promote scanned model to an environment

Promotes a scanned model to a deployment environment, gated on verdict='safe'. Suspicious/malicious scans are blocked (403 PROMOTE_BLOCKED) unless override=true with a reason (>=8 chars). Admin only; every call writes a model_promotions audit row.

Authentication

Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.

Parameters

scanId in pathrequired
string

Request body required

Example

{
  "toEnv": "<Target environment, e.g. staging, prod.>",
  "fromEnv": "string",
  "override": false,
  "reason": "<Required (>=8 chars) when override=true;>"
}
Schema
{
  "application/json": {
    "schema": {
      "type": "object",
      "required": [
        "toEnv"
      ],
      "properties": {
        "toEnv": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$",
          "description": "Target environment, e.g. staging, prod."
        },
        "fromEnv": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$"
        },
        "override": {
          "type": "boolean",
          "description": "Force promotion of a non-safe scan."
        },
        "reason": {
          "type": "string",
          "minLength": 8,
          "description": "Required (>=8 chars) when override=true; logged for audit."
        }
      }
    }
  }
}

Response

200 example

{
  "success": true
}

All status codes

200Promoted/override decision.
400(no description)
401(no description)
403Forbidden — non-admin, or promotion blocked (PROMOTE_BLOCKED).
404(no description)
409Conflict — CONFLICT.
429(no description)
500Internal Server Error — DB_ERROR.

Code samples

cURL

# {scanId} is shown with an EXAMPLE value — replace it with real values.
curl -X POST \
  https://evalguard.ai/api/v1/security/model-scan/00000000-0000-0000-0000-000000000000/promote \
  -H "Authorization: Bearer $EVALGUARD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "toEnv": "<Target environment, e.g. staging, prod.>", "fromEnv": "string", "override": false, "reason": "<Required (>=8 chars) when override=true;>" }'

TypeScript

// The TypeScript SDK (@evalguard/sdk) exposes TYPED methods — runEval,
// getEval, runSecurityScan, checkFirewall, … — not a generic request().
// For an arbitrary endpoint, call it directly:
// {scanId} is shown with an EXAMPLE value — replace it with real values.

const res = await fetch("https://evalguard.ai/api/v1/security/model-scan/00000000-0000-0000-0000-000000000000/promote", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.EVALGUARD_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "toEnv": "<Target environment, e.g. staging, prod.>",
    "fromEnv": "string",
    "override": false,
    "reason": "<Required (>=8 chars) when override=true;>"
  }),
});
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:
# {scanId} 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(
    "POST",
    "https://evalguard.ai/api/v1/security/model-scan/00000000-0000-0000-0000-000000000000/promote",
    headers=headers,
    json={
    "toEnv": "<Target environment, e.g. staging, prod.>",
    "fromEnv": "string",
    "override": False,
    "reason": "<Required (>=8 chars) when override=true;>"
},
)
print(response.status_code, response.json())

Go

package main

import (
	"context"
	"fmt"
	"net/http"
	"os"
	"strings"
)

// {scanId} is shown with an EXAMPLE value — replace it with real values.
func main() {
	body := strings.NewReader(`{"toEnv":"<Target environment, e.g. staging, prod.>","fromEnv":"string","override":false,"reason":"<Required (>=8 chars) when override=true;>"}`)
	req, _ := http.NewRequestWithContext(context.Background(), "POST", "https://evalguard.ai/api/v1/security/model-scan/00000000-0000-0000-0000-000000000000/promote", 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

400401403404409429500

Other Security endpoints