Riferimento API
Creare un'assegnazione di guardrail
Collega una guardrail a una chiave API Standard o a un membro dell'account.
Collega una guardrail a una chiave API Standard o a un membro dell’account.
Endpoint
- URL di base
https://runapi.ai- Versione API
v1- Autenticazione
Authorization: Bearer YOUR_MANAGEMENT_API_KEY
02
Corpo JSONRichiesta
Invia i valori solo nella posizione di richiesta elencata.
Corpo JSON3 campi
account_user_idstring
Opzionale
ID prefisso del membro dell'account. Questo target richiede un amministratore dell'account.
api_token_idstring
Opzionale
ID prefisso della Chiave API Standard. Fornisci esattamente un ID target.
guardrail_idstring
Obbligatorio
ID prefisso del Guardrail.
03
HTTP 201Risposta di successo
POST /api/v1/guardrail_assignments
JSON
{
"account_user_id": null,
"api_token_id": "token_123",
"created_at": "2026-07-27T10:00:00.000Z",
"guardrail_id": "guardrail_123",
"id": "guardrail_assignment_123"
}
04
HTTP 401Risposta di errore (401)
Schema della risposta
JSON
{
"properties": {
"error": {
"description": "Messaggio di errore leggibile.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Esempio di risposta
JSON
{
"error": "Authentication required"
}
05
HTTP 403Risposta di errore (403)
Schema della risposta
JSON
{
"properties": {
"error": {
"description": "Messaggio di errore leggibile.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Esempio di risposta
JSON
{
"error": "Management API key required"
}
06
HTTP 400Risposta di errore (400)
Schema della risposta
JSON
{
"oneOf": [
{
"properties": {
"error": {
"description": "Messaggio di errore leggibile.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
},
{
"properties": {
"error": {
"description": "Riepilogo di convalida leggibile dall'utente.",
"type": "string"
},
"errors": {
"additionalProperties": {
"items": {
"type": "string"
},
"type": "array"
},
"description": "Messaggi di convalida con chiave per campo della richiesta pubblica, con un array di stringhe leggibili dall'utente per ogni campo.",
"type": "object"
}
},
"required": [
"error",
"errors"
],
"type": "object",
"unevaluatedProperties": false
}
]
}
Esempio di risposta
JSON
{
"error": "page must be an integer"
}
07
HTTP 403Risposta di errore (403)
Schema della risposta
JSON
{
"properties": {
"error": {
"description": "Messaggio di errore leggibile.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Esempio di risposta
JSON
{
"error": "Forbidden"
}
08
HTTP 404Risposta di errore (404)
Schema della risposta
JSON
{
"properties": {
"error": {
"description": "Messaggio di errore leggibile.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Esempio di risposta
JSON
{
"error": "Resource not found"
}
09
HTTP 422Risposta di errore (422)
Schema della risposta
JSON
{
"properties": {
"error": {
"description": "Riepilogo di convalida leggibile dall'utente.",
"type": "string"
},
"errors": {
"additionalProperties": {
"items": {
"type": "string"
},
"type": "array"
},
"description": "Messaggi di convalida con chiave per campo della richiesta pubblica, con un array di stringhe leggibili dall'utente per ogni campo.",
"type": "object"
}
},
"required": [
"error",
"errors"
],
"type": "object",
"unevaluatedProperties": false
}
Esempio di risposta
JSON
{
"error": "Validation failed",
"errors": {
"base": [
"Validation failed"
]
}
}
10
Esempio cURL
CURL
curl -X POST https://runapi.ai/api/v1/guardrail_assignments \
-H 'Authorization: Bearer YOUR_MANAGEMENT_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"guardrail_id":"guardrail_123","api_token_id":"token_123"}'