border.bot
Esc
  • Loading…
↑ ↓ to move↵ to openEsc to close
Docs menu

Add a restricted-goods rule

POST https://api.border.bot/v1/restrictions/rules

Requires an access token from an API client (Authorization: Bearer <access_token>).

A rule matched by HS code (and everything under it), by words in the item, or by origin, for one country or *. Free.

API client 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 or expired access token, or a revoked or expired API client (unauthorized). (Error)
  • 403: The API client doesn’t have the settings scope (forbidden, details.reason: "missing_scope"). (Error)
  • 429: Rate limited (rate_limited). Retry after Retry-After seconds; RateLimit says which limit was hit (r=0, t seconds until its window ends) and RateLimit-Policy its quota. (Error)
  • 500: Unexpected error (internal). (Error)

Example request#

curl -X POST https://api.border.bot/v1/restrictions/rules \
  -H "Authorization: Bearer $BORDERBOT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "country": "US",
    "ruleType": "prohibition",
    "code": "9304",
    "keywords": [
      "airsoft"
    ],
    "title": "No airsoft or air guns (company policy)"
  }'

Example response (200)#

JSON
{
  "data": {
    "id": "0199c3a2-7b4e-7d21-9f3a-2c5e8b1d4f60",
    "country": "string",
    "direction": "string",
    "ruleType": "string",
    "code": "string",
    "keywords": [
      "string"
    ],
    "origins": [
      "string"
    ],
    "title": "string",
    "summary": "string",
    "createdAt": "string"
  }
}