Slack Interactions
curl --request POST \
--url https://api.example.com/slack/interactions \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'X-Slack-Request-Timestamp: <x-slack-request-timestamp>' \
--header 'X-Slack-Signature: <x-slack-signature>' \
--data 'payload=<string>'import requests
url = "https://api.example.com/slack/interactions"
payload = { "payload": "<string>" }
headers = {
"X-Slack-Request-Timestamp": "<x-slack-request-timestamp>",
"X-Slack-Signature": "<x-slack-signature>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Slack-Request-Timestamp': '<x-slack-request-timestamp>',
'X-Slack-Signature': '<x-slack-signature>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({payload: '<string>'})
};
fetch('https://api.example.com/slack/interactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/slack/interactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "payload=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded",
"X-Slack-Request-Timestamp: <x-slack-request-timestamp>",
"X-Slack-Signature: <x-slack-signature>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/slack/interactions"
payload := strings.NewReader("payload=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Slack-Request-Timestamp", "<x-slack-request-timestamp>")
req.Header.Add("X-Slack-Signature", "<x-slack-signature>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/slack/interactions")
.header("X-Slack-Request-Timestamp", "<x-slack-request-timestamp>")
.header("X-Slack-Signature", "<x-slack-signature>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("payload=%3Cstring%3E")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/slack/interactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Slack-Request-Timestamp"] = '<x-slack-request-timestamp>'
request["X-Slack-Signature"] = '<x-slack-signature>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "payload=%3Cstring%3E"
response = http.request(request)
puts response.read_body{
"status": "ok"
}Slack
Slack Interactions
Handles Slack interactive components for Human-in-the-Loop (HITL) workflows.
Supported Actions:
row_approve- Approve a pending tool callrow_reject- Reject a pending tool callsubmit_pause- Submit form data for a paused workflow
Setup: Configure this URL in your Slack App under Interactivity & Shortcuts > Request URL.
See the setup guide for step-by-step instructions or the HITL guide for approval workflows.
POST
/
slack
/
interactions
Slack Interactions
curl --request POST \
--url https://api.example.com/slack/interactions \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'X-Slack-Request-Timestamp: <x-slack-request-timestamp>' \
--header 'X-Slack-Signature: <x-slack-signature>' \
--data 'payload=<string>'import requests
url = "https://api.example.com/slack/interactions"
payload = { "payload": "<string>" }
headers = {
"X-Slack-Request-Timestamp": "<x-slack-request-timestamp>",
"X-Slack-Signature": "<x-slack-signature>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Slack-Request-Timestamp': '<x-slack-request-timestamp>',
'X-Slack-Signature': '<x-slack-signature>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({payload: '<string>'})
};
fetch('https://api.example.com/slack/interactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/slack/interactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "payload=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded",
"X-Slack-Request-Timestamp: <x-slack-request-timestamp>",
"X-Slack-Signature: <x-slack-signature>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/slack/interactions"
payload := strings.NewReader("payload=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Slack-Request-Timestamp", "<x-slack-request-timestamp>")
req.Header.Add("X-Slack-Signature", "<x-slack-signature>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/slack/interactions")
.header("X-Slack-Request-Timestamp", "<x-slack-request-timestamp>")
.header("X-Slack-Signature", "<x-slack-signature>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("payload=%3Cstring%3E")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/slack/interactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Slack-Request-Timestamp"] = '<x-slack-request-timestamp>'
request["X-Slack-Signature"] = '<x-slack-signature>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "payload=%3Cstring%3E"
response = http.request(request)
puts response.read_body{
"status": "ok"
}Headers
Unix timestamp when Slack sent the request
HMAC signature for request verification (v0=hash)
Body
application/x-www-form-urlencoded
URL-encoded JSON interaction payload (Slack sends interactive component data as a single form field)
Response
Interaction accepted
Was this page helpful?
⌘I