Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
user_api_key
What it is
Part of account security — creates, lists, and deletes a user's API keys.
Authenticating a request with a key lives in macro_authorization, not
here.
Start here
src/domain/service.rs: create/list/delete operations.src/outbound/pg_user_api_keys_repo.rs: the"UserApiKey"table repository (featurepostgres); also exposes lookup-by-key formacro_authorization.src/inbound/axum_router.rs(featureinbound): HTTP routes.
These routes refuse an account manager's credential (AccountHolderOrInternal),
whose hash lives in account_manager_grants rather than "UserApiKey".
Scope
- Owns: the
"UserApiKey"table's lifecycle. - Not here: validating the
x-macro-user-api-keyheader on an incoming request →macro_authorization.
Boundaries
- Depends on:
macro_user_id,macro_authorization(featureinbound). - Used by:
services/document_storage_service,services/authentication_service(agent setup).
Checks
cargo test -p user_api_key(SQLX_OFFLINEunset).
Related
- Rules:
.agents/rules/rust/security.md