Skip to content

Add BotId and EnterpriseId to AuthTestResponse - #263

Open
vgribok wants to merge 1 commit into
soxtoby:masterfrom
vgribok:auth-test-bot-id
Open

vgribok wants to merge 1 commit into
soxtoby:masterfrom
vgribok:auth-test-bot-id

Conversation

@vgribok

@vgribok vgribok commented Oct 12, 2026

Copy link
Copy Markdown

auth.test documents two response fields that AuthTestResponse doesn't carry:
bot_id and enterprise_id.

  • bot_id is returned whenever the call is made with a bot token. It identifies
    the app installation and is distinct from user_id, so it can't be derived
    from the fields already present.
  • enterprise_id is returned for a token belonging to a team within an
    Enterprise Grid org.

Reference: https://docs.slack.dev/reference/methods/auth.test

Why it's useful

Slack ties chat.delete authority and DM-history visibility to the app
installation rather than the bot user. When a delete fails with
cant_delete_message, comparing auth.test's bot_id against the message's own
bot_id is what distinguishes "a different installation posted this" from a real
failure. MessageEvent already exposes BotId, so today only one half of that
comparison is reachable.

Notes

  • No JsonProperty attributes needed — the snake_case naming strategy in
    SlackJsonSettings maps both. Verified by deserializing a documented
    bot-token auth.test body.
  • Both fields are conditionally present, so they're string? under
    #nullable enable, following OauthV2AccessResponse.

Verification

SlackNet.Tests passes: 585 passed, 0 failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants