SlackMemory
/Documentation

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_here

Or use Bearer token format:

Authorization: Bearer sk_live_your_api_key_here

Base URL

https://your-app-url.vercel.app/api

Endpoints

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

ParameterTypeRequiredDescription
querystringYesNatural language search query
workspaceIdstringYesYour Slack Memory workspace ID
channelIdsstring[]NoFilter by specific channels
fromTsISO dateNoStart date filter
toTsISO dateNoEnd date filter
limitnumberNoMax 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

StatusDescription
400Bad request - missing or invalid parameters
401Unauthorized - invalid or missing API key
403Forbidden - API key not authorized for workspace
500Internal server error