API Reference

Dokumentazzjoni

Din hija product-facing reference għall-public API. L-istess identity, tenant, style version, avatar family, style options, size u WebP output għandhom jibqgħu stable matul major release.

Core Endpoints

  • GET /v1/avatar: returns an avatar asset directly
  • GET /v1/avatar/link: stores the generated avatar in configured object storage and returns signed-link metadata
  • GET /avatar/<kind>/<identity>/webp: path-style public avatar URL
  • GET /docs/openapi.json: machine-readable API description

Operational Endpoints

GET /healthz huwa public għal load balancers u uptime checks. GET /metrics huwa loopback-only u jirritorna 404 għal non-local peers.

Namespace Support

Uża tenant u style_version biex tifred visual identity spaces bejn products jew rollout phases.

GET https://hashavatar.app/v1/[email protected]&tenant=acme&style_version=v2&algorithm=sha512&kind=wizard&background=white&accessory=hat&color=deep-sea-blue&expression=cool&shape=squircle&format=webp&size=256

Anonymous IDs

Ibgħat internal stable id jew one-way application hash minflok raw personal data.

printf '%s' '[email protected]' | sha256sum | cut -d' ' -f1

Rate Limits

Il-public service japplika origin-side rate limits, b'limits aktar stretti għal /v1/avatar/link, direct avatar requests b'persist=true u /og.png għax object storage writes u Open Graph image rendering jiswew aktar minn direct rendering.

Timeouts

Avatar generation u storage operations huma bounded b'server-side timeouts biex expensive requests ma jistgħux iżommu l-origin bla limitu.

Errors

  • 400: invalid kind, unsupported algorithm jew format, size, jew missing identity
  • 408: generation jew storage timeout
  • 429: rate limit exceeded
  • 500: rendering jew storage failure

OpenAPI

Għal generated clients jew tooling, uża /docs/openapi.json.