API-referentie
Een guardrail-toewijzing aanmaken
Koppel één guardrail aan een standaard API-sleutel of een accountlid.
Koppel één guardrail aan een standaard API-sleutel of een accountlid.
Eindpunt
- Basis-URL
https://runapi.ai- API-versie
v1- Authenticatie
Authorization: Bearer YOUR_MANAGEMENT_API_KEY
02
JSON-bodyVerzoek
Stuur waarden alleen op de vermelde verzoeklocatie.
JSON-body3 velden
account_user_idstring
Optioneel
Prefix-ID van een accountlid. Dit doel vereist een accountbeheerder.
api_token_idstring
Optioneel
Standaard API-sleutel prefix-ID. Geef exact één doel-ID op.
guardrail_idstring
Verplicht
Prefix-ID van de guardrail.
03
HTTP 201Succesvol antwoord
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 401Foutrespons (401)
Responsschema
JSON
{
"properties": {
"error": {
"description": "Leesbare foutmelding.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Responsvoorbeeld
JSON
{
"error": "Authentication required"
}
05
HTTP 403Foutrespons (403)
Responsschema
JSON
{
"properties": {
"error": {
"description": "Leesbare foutmelding.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Responsvoorbeeld
JSON
{
"error": "Management API key required"
}
06
HTTP 400Foutrespons (400)
Responsschema
JSON
{
"oneOf": [
{
"properties": {
"error": {
"description": "Leesbare foutmelding.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
},
{
"properties": {
"error": {
"description": "Leesbare validatiesamenvatting.",
"type": "string"
},
"errors": {
"additionalProperties": {
"items": {
"type": "string"
},
"type": "array"
},
"description": "Validatieberichten gekoppeld aan het openbare aanvraagveld, met een reeks leesbare tekenreeksen per veld.",
"type": "object"
}
},
"required": [
"error",
"errors"
],
"type": "object",
"unevaluatedProperties": false
}
]
}
Responsvoorbeeld
JSON
{
"error": "page must be an integer"
}
07
HTTP 403Foutrespons (403)
Responsschema
JSON
{
"properties": {
"error": {
"description": "Leesbare foutmelding.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Responsvoorbeeld
JSON
{
"error": "Forbidden"
}
08
HTTP 404Foutrespons (404)
Responsschema
JSON
{
"properties": {
"error": {
"description": "Leesbare foutmelding.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Responsvoorbeeld
JSON
{
"error": "Resource not found"
}
09
HTTP 422Foutrespons (422)
Responsschema
JSON
{
"properties": {
"error": {
"description": "Leesbare validatiesamenvatting.",
"type": "string"
},
"errors": {
"additionalProperties": {
"items": {
"type": "string"
},
"type": "array"
},
"description": "Validatieberichten gekoppeld aan het openbare aanvraagveld, met een reeks leesbare tekenreeksen per veld.",
"type": "object"
}
},
"required": [
"error",
"errors"
],
"type": "object",
"unevaluatedProperties": false
}
Responsvoorbeeld
JSON
{
"error": "Validation failed",
"errors": {
"base": [
"Validation failed"
]
}
}
10
cURL-voorbeeld
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"}'