Skip to Content
Urlizo API Docs
Examples

Examples

curl pronto para copiar. Placeholders <ACCESS_TOKEN> e <API_KEY> — nunca credenciais reais. Troque http://localhost:PORT pela base do seu ambiente.

Registrar e autenticar

curl -X POST http://localhost:PORT/auth/register \ -H "Content-Type: application/json" \ -d '{"email":"dev@example.com","password":"s3cret-p4ss","name":"Dev"}' curl -X POST http://localhost:PORT/auth/login \ -H "Content-Type: application/json" \ -d '{"email":"dev@example.com","password":"s3cret-p4ss"}'
curl -X POST http://localhost:PORT/api/v1/links \ -H "Authorization: Bearer <API_KEY>" \ -H "Content-Type: application/json" \ -d '{"destinationUrl":"https://example.com/landing","slug":"promo-2026"}'
curl "http://localhost:PORT/api/v1/links?page=1&pageSize=20&search=promo&isActive=true" \ -H "Authorization: Bearer <API_KEY>"

Criar domínio customizado

curl -X POST http://localhost:PORT/api/v1/domains \ -H "Authorization: Bearer <API_KEY>" \ -H "Content-Type: application/json" \ -d '{"domain":"go.example.com"}'

Reivindicar e ativar subdomínio

curl -X POST http://localhost:PORT/api/v1/subdomain \ -H "Authorization: Bearer <API_KEY>" \ -H "Content-Type: application/json" \ -d '{"subdomain":"acme"}' curl -X POST http://localhost:PORT/api/v1/subdomain/activate \ -H "Authorization: Bearer <API_KEY>"
curl "http://localhost:PORT/api/v1/analytics/<LINK_ID>?page=1&limit=50" \ -H "Authorization: Bearer <API_KEY>"

Criar webhook

curl -X POST http://localhost:PORT/api/v1/webhooks \ -H "Authorization: Bearer <API_KEY>" \ -H "Content-Type: application/json" \ -d '{"name":"Order events","url":"https://example.com/hooks/gw","events":["link.created"]}'

Erro de validação (400)

{ "success": false, "error": { "code": "VALIDATION_ERROR", "message": "Invalid request payload", "details": { "validationErrors": [{ "path": "destinationUrl", "message": "Invalid url" }] } }, "requestId": "req-01J0000000000000000000000" }