Docs menu
Get started
API reference
Classification
Landed cost
Products
Compliance
Reference
Origin
API reference
Add a restricted-goods rule
POST https://api.border.bot/v1/restrictions/rules
Requires an API key (Authorization: Bearer bb_live_…).
A rule matched by HS code (and everything under it), by words in the item, or by origin, for one country or *. Free.
API key scope: settings.
Request body (JSON)#
| Name | Type | Required | Description |
|---|---|---|---|
country |
"*" | string | no | |
direction |
"import" | "export" | no | |
ruleType |
"prohibition" | "restriction" | "observation" | yes | |
code |
string | no | |
keywords |
string[] | no | |
origins |
string[] | no | |
title |
string | yes | |
summary |
string | no |
Responses#
200: The rule. (RestrictionRuleResponse)400: Invalid input (invalid_input). (Error)401: Missing, invalid, revoked or expired API key (unauthorized). (Error)403: The API key doesn’t have thesettingsscope (forbidden,details.reason: "missing_scope"). (Error)429: Rate limited (rate_limited). Retry afterRetry-Afterseconds;RateLimitsays which limit was hit (r=0,tseconds until its window ends) andRateLimit-Policyits quota. (Error)500: Unexpected error (internal). (Error)
Example#
curl -X POST 'https://api.border.bot/v1/restrictions/rules' \
-H 'Authorization: Bearer bb_live_...' \
-H 'Content-Type: application/json' \
-d '{"country":"US","ruleType":"prohibition","code":"9304","keywords":["airsoft"],"title":"No airsoft or air guns (company policy)"}'