Справочник API публикуется на английском языке.

Create a tool policy

POST/api/companies/{companyId}/tools/policies
Personal API keyAgent API keyConsole session
Veyra Docs TeamОбновлено Версия 4 · История

Create a tool policy.

Авторизация

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. Как работают ключи.

Параметры пути

companyIdstringОбязательныйThe organization's id.

Тело запроса

application/json · обязательно

namestringОбязательный1–160 characters
descriptionstring | nullНеобязательныйat most 4000 characters
policyTypestringОбязательныйone of: "allow", "block", "require_approval", "trust_rule", "rate_limit"
priorityintegerНеобязательный≥ 0≤ 10000
enabledbooleanНеобязательный
selectorsobjectНеобязательный
conditionsobject | nullНеобязательный
conditions.argumentsobjectНеобязательный
conditions.arguments.fieldEqualsobjectНеобязательный
conditions.arguments.fieldNotEqualsobjectНеобязательный
conditions.arguments.fieldInobject<string, array<any>>Необязательный
conditions.arguments.fieldMatchesobject<string, string>Необязательный
conditions.arguments.fieldExistsarray<string>Необязательныйeach at most 120 characters
conditions.arguments.fieldAbsentarray<string>Необязательныйeach at most 120 characters
conditions.argsobjectНеобязательный
conditions.args.fieldEqualsobjectНеобязательный
conditions.args.fieldNotEqualsobjectНеобязательный
conditions.args.fieldInobject<string, array<any>>Необязательный
conditions.args.fieldMatchesobject<string, string>Необязательный
conditions.args.fieldExistsarray<string>Необязательныйeach at most 120 characters
conditions.args.fieldAbsentarray<string>Необязательныйeach at most 120 characters
conditions.actorobjectНеобязательный
conditions.actor.actorTypestringНеобязательныйone of: "agent", "user", "system", "plugin"
conditions.actor.actorTypesarray<string>Необязательныйitems one of: "agent", "user", "system", "plugin"
conditions.actor.agentIdstring (uuid)Необязательный
conditions.actor.agentIdsarray<string (uuid)>Необязательный
conditions.contextobjectНеобязательный
conditions.context.projectIdstring (uuid)Необязательный
conditions.context.projectIdsarray<string (uuid)>Необязательный
conditions.context.routineIdstring (uuid)Необязательный
conditions.context.routineIdsarray<string (uuid)>Необязательный
conditions.context.issueIdstring (uuid)Необязательный
conditions.context.issueIdsarray<string (uuid)>Необязательный
conditions.context.requireIssuebooleanНеобязательный
conditions.context.requireProjectbooleanНеобязательный
conditions.context.requireRoutinebooleanНеобязательный
conditions.riskobjectНеобязательный
conditions.risk.levelsarray<string>Необязательныйitems one of: "low", "medium", "high", "critical", "read", "write", "destructive"
conditions.risk.maxstringНеобязательныйone of: "low", "medium", "high", "critical", "read", "write", "destructive"
conditions.risk.isWritebooleanНеобязательный
conditions.risk.isDestructivebooleanНеобязательный
conditions.credentialScopeobjectНеобязательный
conditions.credentialScope.applicationIdstring (uuid)Необязательный
conditions.credentialScope.applicationIdsarray<string (uuid)>Необязательный
conditions.credentialScope.connectionIdstring (uuid)Необязательный
conditions.credentialScope.connectionIdsarray<string (uuid)>Необязательный
conditions.credentialScope.catalogEntryIdstring (uuid)Необязательный
conditions.credentialScope.catalogEntryIdsarray<string (uuid)>Необязательный
conditions.credentialScope.applicationKeystringНеобязательный1–160 characters
conditions.credentialScope.applicationKeysarray<string>Необязательныйeach at most 160 characters
conditions.credentialScope.providerTypestringНеобязательный1–160 characters
conditions.credentialScope.providerTypesarray<string>Необязательныйeach at most 160 characters
conditions.trustBoundaryobjectНеобязательный
conditions.trustBoundary.providerTypestringНеобязательный1–160 characters
conditions.trustBoundary.providerTypesarray<string>Необязательныйeach at most 160 characters
conditions.trustBoundary.applicationKeystringНеобязательный1–160 characters
conditions.trustBoundary.applicationKeysarray<string>Необязательныйeach at most 160 characters
conditions.trustBoundary.remoteHttpOnlybooleanНеобязательный
conditions.trustBoundary.veyraSelfOnlybooleanНеобязательный
conditions.timeWindowobjectНеобязательный
conditions.timeWindow.startAtstring (date-time)Необязательный
conditions.timeWindow.endAtstring (date-time)Необязательный
conditions.timeWindow.daysOfWeekUtcarray<integer>Необязательный
conditions.timeWindow.startHourUtcintegerНеобязательный≥ 0≤ 23
conditions.timeWindow.endHourUtcintegerНеобязательный≥ 0≤ 24
configobject | nullНеобязательный

Ответы

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).

Ошибки возвращают {"error": "..."}, часто вместе с code и details. Подробнее: ошибки и ограничения.

Connectors