๐Ÿ“ฎ POST /api/v1/gsc/check-domain-safety/

Creates a CommandRequest for check_domain_safety.

๐Ÿงพ Request body

  • domain โ€” a domain
  • account_email โ€” optional
    • if omitted, the account is selected via DomainAccountMapping
  • callback_url โ€” optional

๐Ÿ“ Domain notes

If account_email is omitted, the domain must exist in DomainAccountMapping. The mapping stores root domains only (no subdomains).

Additionally, the domain is validated on the server:

  • normalized to lowercase
  • format validated with a regex
  • DNS resolvability checked via socket.gethostbyname

If the domain does not resolve from the service environment, the request is rejected by API validation.

๐Ÿ’ป curl example

curl -X POST "http://localhost:8000/api/v1/gsc/check-domain-safety/" \
  -H "Content-Type: application/json" \
  -H "AUTHORIZATION: Bearer <AUTHORIZATION_TOKEN>" \
  -d '{
    "domain": "example.com",
    "callback_url": "https://example.com/callback"
  }'