Document DELETE /admins/remove - #633
Conversation
The endpoint has shipped and been callable for a long time (app/controllers/api/v3/admins_controller.rb#remove in intercom/intercom) but was never added to the spec. Adds the path, parameters, and coded error responses actually returned by the controller. No behaviour change.
|
Companion to intercom/developer-docs#1110 |
|
Documents intercom/intercom#563277. |
| type: integer | ||
| - name: reassign_messages_admin_id | ||
| in: query | ||
| required: false |
There was a problem hiding this comment.
Mark reassign_messages_admin_id, reassign_owner_admin_id and reassign_articles_author_id as required.
Leaving any of them out returns 404, not 200. single_admin(nil) returns nil (app/controllers/api/v3/admins_controller.rb:188) and ensure_admin_is_human raises admin_not_found on nil (:257). The three calls are at :73-75.
So DELETE /admins/remove?admin_id=123 on its own fails.
Worth checking whether reassign_conversations_admin_id behaves the same way when omitted.
There was a problem hiding this comment.
One thing worth noting: the command underneath actually treats three of these as optional — there's
even a # Reassignment for replies is optional comment in permissions/delete.rb:113. It's the
controller's upfront checks that make them mandatory. Probably worth fixing there at some point, but
separate PR.
Review feedback on #633: the controller rejects a nil for every reassignment param, so `required: false` advertised a call shape that returns 404. The pre-flight checks at app/controllers/api/v3/admins_controller.rb:72-75 run before Permissions::Delete and reject all four. reassign_replies_teams stays optional — it has no pre-flight check. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Why?
The DELETE /admins/remove endpoint has been live and callable on the public API for a long time, but was never added to the OpenAPI spec. This documents the existing behavior — no code or behavior changes.
How?
Adds the /admins/remove path to the Preview spec with its parameters, success response, and the coded error responses the endpoint actually returns.
Generated with Claude Code