API Reference

દસ્તાવેજો

આ public API માટે product-facing reference છે. સમાન identity, tenant, style version, avatar family, style options, size અને WebP output major release દરમિયાન stable રહેવાની અપેક્ષા છે.

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 load balancers અને uptime checks માટે public છે. GET /metrics loopback-only છે અને non-local peers માટે 404 આપે છે.

Namespace Support

Products અથવા rollout phases વચ્ચે visual identity spaces અલગ કરવા tenant અને style_version વાપરો.

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

Raw personal data બદલે internal stable id અથવા one-way application hash મોકલો.

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

Rate Limits

Public service origin-side rate limits લાગુ કરે છે, /v1/avatar/link, persist=true ધરાવતી direct avatar requests અને /og.png માટે વધુ કડક limits સાથે, કારણ કે object storage writes અને Open Graph image rendering direct rendering કરતાં ખર્ચાળ છે.

Timeouts

Avatar generation અને storage operations server-side timeouts થી bounded છે જેથી expensive requests origin ને અનંત સમય સુધી કબજે ન કરી શકે.

Errors

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

OpenAPI

Generated clients અથવા tooling માટે વાપરો /docs/openapi.json.