Skip to content

Commit 8883efa

Browse files
mycollablabclaude
andcommitted
Fix org-contacts: use UUID (not base64) for orgId path param
The /contacts/organizations/{orgId}/* API requires UUID format, not the base64 format used by most other Admin endpoints. The codegen was sending base64 because the blanket --org-id → base64 rule in root.go applied to all non-CC commands indiscriminately. Fix: extend the orgId normalization condition in generate_cli.py to also apply UUID handling (--orgid flag, {orgid} path) for any endpoint whose path contains /contacts/organizations/, matching the explicit Postman note "orgId used in path are the org UUIDs." All 7 org-contacts commands now use --orgid and auto-receive a decoded UUID from root.go. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 88c43ca commit 8883efa

2 files changed

Lines changed: 41 additions & 38 deletions

File tree

cmd/admin/org_contacts.go

Lines changed: 35 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codegen/generate_cli.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,14 @@ def generate_command(ep, group_var, base_url_const, is_calling):
222222
original_name = ep.get('original_name', cmd_name)
223223
has_from = any(p['name'] == 'from' for p in query_params)
224224

225-
# Normalize orgId → orgid for CC commands so auto-populate in root.go works
226-
# consistently (CC APIs use UUID format via the --orgid flag path).
225+
# Normalize orgId → orgid so auto-populate in root.go resolves to UUID format.
226+
# Applies to CC commands (is_calling=False) and to any endpoint under
227+
# /contacts/organizations/ which explicitly requires UUID despite being in a
228+
# non-CC collection (Postman note: "orgId used in path are the org UUIDs").
227229
# For path params, rename both the flag and the param key (path uses {orgid}).
228230
# For query params, only rename the flag; keep the original API key (orgId).
229-
if not is_calling:
231+
needs_uuid_orgid = not is_calling or '/contacts/organizations/' in path
232+
if needs_uuid_orgid:
230233
path = path.replace('{orgId}', '{orgid}')
231234
for p in path_params:
232235
if p['name'] == 'orgId':

0 commit comments

Comments
 (0)