# `compact_workspace_export` — Compact Slack Export or Jira v3 ADF JSON

> Part of [Context Crush — Deterministic LLM Context Compactor](https://context-crush.apikeg.com/llms.txt) (`com.apikeg/context-crush`)

Compacts Slack channel/thread JSON (resolving <@U...> mentions, dropping join/leave noise, grouping thread_ts replies, formatting reactions, stripping Block Kit) or Jira v3 Issue/ADF JSON (rendering headings, tables, code blocks, lists, mentions, comments while dropping avatarUrls and null customfield_* keys).

**Why call instead of DIY:** Turns bloated 100KB+ Jira REST v3 ADF issues and Slack API payloads into crisp 3KB Markdown without losing comments, tables, code blocks, or reactions.

- **REST Endpoint:** `POST https://context-crush.apikeg.com/v1/compact-workspace-export`
- **MCP Server:** `https://context-crush.apikeg.com/mcp` (tool: `compact_workspace_export`)
- **Pricing:** $0.001 base (up to $0.005 max ($0.001 base + $0.0005 per 50KB of input, capped at $0.005 for payloads up to 2MB), x402 variable settlement)
- **Free Dry-Run:** `POST https://context-crush.apikeg.com/v1/compact-workspace-export?dry_run=true`

## Input JSON Schema
```json
{
  "type": "object",
  "properties": {
    "content": {
      "type": "string",
      "minLength": 2,
      "maxLength": 2000000,
      "description": "Raw Slack channel/thread JSON export or Jira Issue / Atlassian Document Format (ADF v3) JSON payload."
    },
    "format": {
      "type": "string",
      "enum": [
        "auto",
        "slack_json",
        "jira_json"
      ],
      "default": "auto",
      "description": "Workspace JSON format; defaults to automatic Slack vs. Jira ADF detection."
    },
    "users": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "maxLength": 120
      },
      "description": "Optional Slack user ID to display handle map (e.g. { \"U01ABC\": \"alice\" }) used to resolve <@U...> mentions."
    },
    "includeReactions": {
      "type": "boolean",
      "default": true,
      "description": "Render concise Slack reaction badges such as '[+3 👍]'."
    }
  },
  "required": [
    "content"
  ],
  "additionalProperties": false
}
```

## Examples
### Compact Slack incident thread with user resolution
```bash
curl -X POST "https://context-crush.apikeg.com/v1/compact-workspace-export" \
  -H "Content-Type: application/json" \
  -d '{"format":"slack_json","users":{"U01ALICE":"alice","U02BOB":"bob"},"includeReactions":true,"content":"[{\"type\":\"message\",\"subtype\":\"channel_join\",\"user\":\"U01ALICE\",\"ts\":\"1731491900.000100\"},{\"type\":\"message\",\"user\":\"U01ALICE\",\"text\":\"Canary deployed — cc <@U02BOB>\",\"ts\":\"1731492000.000200\",\"reactions\":[{\"name\":\"rocket\",\"count\":3}]}]"}'
```
Expected output: Clean Markdown timeline with @bob resolved, channel_join noise dropped, and [+3 🚀] badge.
