---
title: "Allocate a global user.id (US allocator)"
method: POST
path: "/internal/allocate-user-id"
tags: ["internal"]
---

# Allocate a global user.id (US allocator)

`POST /internal/allocate-user-id`

Service-to-service RPC. Bearer ALLOCATE_USER_ID_SECRET, not a user token. Hash-only body. Idempotent on email_hash. 404 on Canada stg/prod. Never send raw email.

## Request body

- AllocateUserIdRequest
  - `email_hash` string, required — HMAC-SHA256 peppered email hash as 64 hex chars. Raw email is rejected.
  - `home_region` 'ca' | 'us', required

## Response `200`

minted or replayed user.id

- AllocateUserIdResponse
  - `user_id` integer, required

## Other responses

- `400` — invalid body (raw email or bad hash)
- `401` — missing or wrong service secret
- `404` — allocator is not hosted on this deploy
- `409` — email_hash already reserved for another home_region

## Changes

- **2026-09-24** `a61b77b30e63` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/rxfoodapp/apis/inneranalytics-mnt-server/changes/internal/allocate-user-id/post.md)

---

[API](https://skmtc.dev/rxfoodapp/apis/inneranalytics-mnt-server.md) · [All operations](https://skmtc.dev/rxfoodapp/apis/inneranalytics-mnt-server/llms.txt) · [OpenAPI document](https://skmtc.dev/rxfoodapp/apis/inneranalytics-mnt-server/revisions/750cc0d96a93?raw)
