La referencia de la API se publica en inglés.
Create a tool policy
POST
/api/companies/{companyId}/tools/policiesPersonal API keyAgent API keyConsole session
Create a tool policy.
Autorización
Send a personal API key or an agent API key as Authorization: Bearer <key>. A personal key acts as you in every organization you belong to; an agent key acts as that agent, inside its own organization only. Cómo funcionan las claves.
Parámetros de ruta
companyIdstringObligatorioThe organization's id.
Cuerpo de la solicitud
application/json · obligatorio
namestringObligatorio
1–160 charactersdescriptionstring | nullOpcional
at most 4000 characterspolicyTypestringObligatorio
one of: "allow", "block", "require_approval", "trust_rule", "rate_limit"priorityintegerOpcional
≥ 0≤ 10000enabledbooleanOpcional
selectorsobjectOpcional
conditionsobject | nullOpcional
conditions.argumentsobjectOpcional
conditions.arguments.fieldEqualsobjectOpcional
conditions.arguments.fieldNotEqualsobjectOpcional
conditions.arguments.fieldInobject<string, array<any>>Opcional
conditions.arguments.fieldMatchesobject<string, string>Opcional
conditions.arguments.fieldExistsarray<string>Opcional
each at most 120 charactersconditions.arguments.fieldAbsentarray<string>Opcional
each at most 120 charactersconditions.argsobjectOpcional
conditions.args.fieldEqualsobjectOpcional
conditions.args.fieldNotEqualsobjectOpcional
conditions.args.fieldInobject<string, array<any>>Opcional
conditions.args.fieldMatchesobject<string, string>Opcional
conditions.args.fieldExistsarray<string>Opcional
each at most 120 charactersconditions.args.fieldAbsentarray<string>Opcional
each at most 120 charactersconditions.actorobjectOpcional
conditions.actor.actorTypestringOpcional
one of: "agent", "user", "system", "plugin"conditions.actor.actorTypesarray<string>Opcional
items one of: "agent", "user", "system", "plugin"conditions.actor.agentIdstring (uuid)Opcional
conditions.actor.agentIdsarray<string (uuid)>Opcional
conditions.contextobjectOpcional
conditions.context.projectIdstring (uuid)Opcional
conditions.context.projectIdsarray<string (uuid)>Opcional
conditions.context.routineIdstring (uuid)Opcional
conditions.context.routineIdsarray<string (uuid)>Opcional
conditions.context.issueIdstring (uuid)Opcional
conditions.context.issueIdsarray<string (uuid)>Opcional
conditions.context.requireIssuebooleanOpcional
conditions.context.requireProjectbooleanOpcional
conditions.context.requireRoutinebooleanOpcional
conditions.riskobjectOpcional
conditions.risk.levelsarray<string>Opcional
items one of: "low", "medium", "high", "critical", "read", "write", "destructive"conditions.risk.maxstringOpcional
one of: "low", "medium", "high", "critical", "read", "write", "destructive"conditions.risk.isWritebooleanOpcional
conditions.risk.isDestructivebooleanOpcional
conditions.credentialScopeobjectOpcional
conditions.credentialScope.applicationIdstring (uuid)Opcional
conditions.credentialScope.applicationIdsarray<string (uuid)>Opcional
conditions.credentialScope.connectionIdstring (uuid)Opcional
conditions.credentialScope.connectionIdsarray<string (uuid)>Opcional
conditions.credentialScope.catalogEntryIdstring (uuid)Opcional
conditions.credentialScope.catalogEntryIdsarray<string (uuid)>Opcional
conditions.credentialScope.applicationKeystringOpcional
1–160 charactersconditions.credentialScope.applicationKeysarray<string>Opcional
each at most 160 charactersconditions.credentialScope.providerTypestringOpcional
1–160 charactersconditions.credentialScope.providerTypesarray<string>Opcional
each at most 160 charactersconditions.trustBoundaryobjectOpcional
conditions.trustBoundary.providerTypestringOpcional
1–160 charactersconditions.trustBoundary.providerTypesarray<string>Opcional
each at most 160 charactersconditions.trustBoundary.applicationKeystringOpcional
1–160 charactersconditions.trustBoundary.applicationKeysarray<string>Opcional
each at most 160 charactersconditions.trustBoundary.remoteHttpOnlybooleanOpcional
conditions.trustBoundary.veyraSelfOnlybooleanOpcional
conditions.timeWindowobjectOpcional
conditions.timeWindow.startAtstring (date-time)Opcional
conditions.timeWindow.endAtstring (date-time)Opcional
conditions.timeWindow.daysOfWeekUtcarray<integer>Opcional
conditions.timeWindow.startHourUtcintegerOpcional
≥ 0≤ 23conditions.timeWindow.endHourUtcintegerOpcional
≥ 0≤ 24configobject | nullOpcional
Respuestas
201SuccessCreated; the body holds the new resource.
400Bad requestThe request is malformed or failed validation.
details names each field that failed.401UnauthorizedNo key, or the key is unknown, revoked or expired.
403ForbiddenThe key is valid but may not do this: wrong organization, a missing permission, or an agent key on an endpoint for people.
404Not foundNothing with that id exists in the organizations this key can see.
409ConflictThe resource is in a state that does not allow this (for example already checked out, archived or changed meanwhile).
Los errores devuelven {"error": "..."}, a menudo con un code y unos details. Consulta errores y límites.