POST/v2/public/slack

Receive a Slack slash command

Receives a Slack slash-command request and returns a response for Slack. Provide the command payload and the Slack signature and timestamp headers so the request can be processed and verified.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

3 parameters
payloadobjectrequired
The Slack command payload, including the channel, command, team, and user details; `channel_id`, `channel_name`, `command`, `team_domain`, `team_id`, `text`, `user_id`, and `user_name` must be included.
X-Slack-Signaturestringrequired
The signature Slack provides to verify the request.
X-Slack-Request-Timestampstringrequired
The timestamp Slack provides with the request.

5 status codes
200Returns a string containing the response for the Slack command.
400Returned when the request is invalid, including when required command payload data is missing.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
401Returned when authentication or Slack signature verification fails.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
403Returned when the request is forbidden.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
404Returned when the requested resource is not found.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional

Error handling

The payload query parameter must include channel_id, channel_name, command, team_domain, team_id, text, user_id, and user_name; send both required Slack headers. A 400 indicates an invalid request, a 401 indicates failed authentication or signature verification, a 403 indicates insufficient access, and a 404 indicates that the requested resource was not found.