API-Referenz
Eine Guardrail-Zuweisung erstellen
Einen Guardrail einem Standard-API-Schlüssel oder einem Kontomitglied zuweisen.
Einen Guardrail einem Standard-API-Schlüssel oder einem Kontomitglied zuweisen.
Endpunkt
- Basis-URL
https://runapi.ai- API-Version
v1- Authentifizierung
Authorization: Bearer YOUR_MANAGEMENT_API_KEY
02
JSON-BodyAnfrage
Werte nur am angegebenen Anfrage-Speicherort senden.
JSON-Body3 Felder
account_user_idstring
Optional
Präfix-ID des Kontomitglieds. Dieses Ziel erfordert einen Kontoadministrator.
api_token_idstring
Optional
Standard-API-Schlüssel-Präfix-ID. Geben Sie genau eine Ziel-ID an.
guardrail_idstring
Erforderlich
Guardrail-Präfix-ID.
03
HTTP 201Erfolgsantwort
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 401Fehlerantwort (401)
Antwort-Schema
JSON
{
"properties": {
"error": {
"description": "Für Menschen lesbare Fehlermeldung.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Antwortbeispiel
JSON
{
"error": "Authentication required"
}
05
HTTP 403Fehlerantwort (403)
Antwort-Schema
JSON
{
"properties": {
"error": {
"description": "Für Menschen lesbare Fehlermeldung.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Antwortbeispiel
JSON
{
"error": "Management API key required"
}
06
HTTP 400Fehlerantwort (400)
Antwort-Schema
JSON
{
"oneOf": [
{
"properties": {
"error": {
"description": "Für Menschen lesbare Fehlermeldung.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
},
{
"properties": {
"error": {
"description": "Menschenlesbare Validierungszusammenfassung.",
"type": "string"
},
"errors": {
"additionalProperties": {
"items": {
"type": "string"
},
"type": "array"
},
"description": "Validierungsmeldungen nach öffentlichem Anforderungsfeld gegliedert, mit einem Array menschenlesbarer Zeichenketten für jedes Feld.",
"type": "object"
}
},
"required": [
"error",
"errors"
],
"type": "object",
"unevaluatedProperties": false
}
]
}
Antwortbeispiel
JSON
{
"error": "page must be an integer"
}
07
HTTP 403Fehlerantwort (403)
Antwort-Schema
JSON
{
"properties": {
"error": {
"description": "Für Menschen lesbare Fehlermeldung.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Antwortbeispiel
JSON
{
"error": "Forbidden"
}
08
HTTP 404Fehlerantwort (404)
Antwort-Schema
JSON
{
"properties": {
"error": {
"description": "Für Menschen lesbare Fehlermeldung.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Antwortbeispiel
JSON
{
"error": "Resource not found"
}
09
HTTP 422Fehlerantwort (422)
Antwort-Schema
JSON
{
"properties": {
"error": {
"description": "Menschenlesbare Validierungszusammenfassung.",
"type": "string"
},
"errors": {
"additionalProperties": {
"items": {
"type": "string"
},
"type": "array"
},
"description": "Validierungsmeldungen nach öffentlichem Anforderungsfeld gegliedert, mit einem Array menschenlesbarer Zeichenketten für jedes Feld.",
"type": "object"
}
},
"required": [
"error",
"errors"
],
"type": "object",
"unevaluatedProperties": false
}
Antwortbeispiel
JSON
{
"error": "Validation failed",
"errors": {
"base": [
"Validation failed"
]
}
}
10
cURL-Beispiel
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"}'