REST API
Query your Slack data programmatically using the Slack Memory REST API.
Authentication
All API requests require authentication using an API key. Include your key in the request headers:
X-API-Key: sk_live_your_api_key_hereOr use Bearer token format:
Authorization: Bearer sk_live_your_api_key_hereBase URL
https://your-app-url.vercel.app/apiEndpoints
POST
/api/query
Search your Slack messages using semantic/AI search
Request Body
{
"query": "What did we decide about the pricing strategy?",
"workspaceId": "your-workspace-id",
"channelIds": ["channel-1", "channel-2"], // optional
"fromTs": "2024-01-01T00:00:00Z", // optional
"toTs": "2024-12-31T23:59:59Z", // optional
"limit": 20 // optional, default 20
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Natural language search query |
| workspaceId | string | Yes | Your Slack Memory workspace ID |
| channelIds | string[] | No | Filter by specific channels |
| fromTs | ISO date | No | Start date filter |
| toTs | ISO date | No | End date filter |
| limit | number | No | Max results (default: 20) |
Response
{
"results": [
{
"messageId": "clxyz123...",
"text": "I think we should go with the $29/month starter plan",
"channelName": "product",
"userDisplayName": "John Doe",
"messageDate": "2024-03-15T14:30:00.000Z",
"permalink": "https://slack.com/archives/...",
"similarity": "92%"
}
],
"query": "What did we decide about the pricing strategy?",
"count": 1
}GET
/api/health
Check API status (no authentication required)
Response
{
"status": "ok",
"timestamp": "2024-03-15T14:30:00.000Z"
}Example: cURL
curl -X POST https://your-app.vercel.app/api/query \
-H "Content-Type: application/json" \
-H "X-API-Key: sk_live_your_api_key" \
-d '{
"query": "What are our Q4 goals?",
"workspaceId": "your-workspace-id"
}'Error Codes
| Status | Description |
|---|---|
| 400 | Bad request - missing or invalid parameters |
| 401 | Unauthorized - invalid or missing API key |
| 403 | Forbidden - API key not authorized for workspace |
| 500 | Internal server error |