> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wisepilot.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Log Slack message

> Log a Slack user message and bot response for visibility in the agency panel.
Called by the Slack bot after each user-triggered exchange. If the API key
has an agency scope, messages are associated with that agency and appear
under Agency → Slack.




## OpenAPI

````yaml /openapi.yaml post /slack/messages
openapi: 3.1.0
info:
  title: Content Registry Public API
  version: 1.0.0
  description: >
    AI-powered content management platform API. Provides access to content
    assets,

    generation pipelines, performance metrics, intelligence insights, and
    integrations.


    ## Authentication

    All endpoints require a Bearer token in the `Authorization` header:

    ```

    Authorization: Bearer cr_<40-hex-characters>

    ```

    API keys are created via the admin UI at `/integrations/api-keys`.


    ## Scoping

    Most endpoints require a `website_id`. If your API key has a single website
    scope,

    it is auto-resolved. Otherwise, pass `website_id` as a query or body
    parameter.


    Agency-scoped keys can access any website under their agency via the
    `agency_websites` join.


    ## Rate Limiting

    Per-key hourly rate limiting (default 1,000 req/hr). When exceeded, returns
    `429`

    with a `Retry-After: 3600` header.


    ## Response Envelope

    All responses follow this shape:

    ```json

    { "success": true, "data": { ... }, "meta": { "total": 100, "limit": 50,
    "offset": 0 } }

    ```

    or on error:

    ```json

    { "success": false, "error": "message", "code": "ERROR_CODE" }

    ```


    ## MCP Server

    An MCP (Model Context Protocol) server is available at `/api/v1/mcp` using

    Streamable HTTP transport. It exposes the same 40+ tools as the REST API.
  contact:
    name: Content Registry
  license:
    name: Proprietary
servers:
  - url: https://ai.wisepilot.app/api/v1
    description: Production (WisePilot)
  - url: /api/v1
    description: Relative (same origin)
security:
  - BearerAuth: []
tags:
  - name: Scoping
    description: Website discovery and scope resolution
  - name: Content
    description: Content library — assets, entities, opportunities, search
  - name: Generation
    description: AI-powered content and image generation
  - name: Metrics
    description: Performance analytics across channels
  - name: Intelligence
    description: Revenue intelligence, insights, experiments, learnings
  - name: Integrations
    description: WordPress, GHL, and ad platform connections
  - name: Slack
    description: Slack bot message logging for agency panel
  - name: MCP
    description: Model Context Protocol server endpoint
  - name: Runners
    description: Autonomous skill execution — trigger runs, check status
  - name: Brand
    description: >-
      Visual identity — design tokens, color palettes, image styles, brand
      subjects
  - name: Content Listeners
    description: >-
      External source subscriptions — monitor Reddit, YouTube, RSS, and other
      channels for content opportunities
  - name: Inbox
    description: >-
      Unified action inbox — merged work items and opportunities with AI
      dispatch
  - name: Finance
    description: >-
      Business entity financials — revenue records, cost tracking, MRR, AI
      costs, invoices
  - name: GSC
    description: Google Search Console page and query performance
  - name: GA4
    description: Google Analytics 4 page metrics and tracking events
  - name: Google Ads
    description: Google Ads campaign, keyword, and search term performance
  - name: Meta Ads
    description: Meta Ads campaign performance
  - name: GBP
    description: Google Business Profile — performance, reviews, services, visibility
  - name: Platform Push
    description: Unified multi-platform publish and update actions
  - name: Lifecycle
    description: Asset lifecycle status, advancement, and publish readiness
  - name: Social
    description: Social post creation and scheduling
  - name: Skills
    description: AI skill library — browse and execute skills
  - name: SEO Research
    description: Ahrefs-powered keyword research and SERP analysis
  - name: GHL
    description: GoHighLevel contacts, agents, and knowledge bases
  - name: Chat
    description: Workspace chat sessions and conversation history
  - name: Recommend
    description: AI-prioritized recommended next actions
  - name: Sync
    description: Force refresh of integration data
  - name: Export
    description: Bulk data export — brand knowledge packs
  - name: Entities
    description: Messaging entities — hooks, angles, offers, stories
paths:
  /slack/messages:
    post:
      tags:
        - Slack
      summary: Log Slack message
      description: >
        Log a Slack user message and bot response for visibility in the agency
        panel.

        Called by the Slack bot after each user-triggered exchange. If the API
        key

        has an agency scope, messages are associated with that agency and appear

        under Agency → Slack.
      operationId: logSlackMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SlackMessageLogRequest'
      responses:
        '200':
          description: Message logged
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SlackMessageLogResponse'
        '400':
          description: Validation error (missing required field)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          description: Failed to store message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SlackMessageLogRequest:
      type: object
      required:
        - slack_user_id
        - channel_id
        - event_type
        - user_text
        - agent_id
      properties:
        slack_user_id:
          type: string
          description: Slack user ID (e.g. U12345)
        channel_id:
          type: string
          description: Slack channel ID
        thread_ts:
          type: string
          nullable: true
          description: Thread timestamp if in a thread
        event_ts:
          type: string
          nullable: true
        event_type:
          type: string
          enum:
            - app_mention
            - dm
            - thread_reply
        channel_type:
          type: string
          nullable: true
          description: e.g. im, channel, group
        user_text:
          type: string
          description: User message (after stripping @mention)
        raw_text:
          type: string
          nullable: true
          description: Original text before stripping
        agent_id:
          type: string
          description: Bot agent identifier (e.g. wgm, fbv)
        response_text:
          type: string
          nullable: true
          description: Bot reply (null if error)
        tools_used:
          type: array
          items:
            type: string
          nullable: true
        is_plan:
          type: boolean
          default: false
        model:
          type: string
          nullable: true
        prompt_tokens:
          type: integer
          nullable: true
        completion_tokens:
          type: integer
          nullable: true
        total_tokens:
          type: integer
          nullable: true
        duration_ms:
          type: integer
          nullable: true
        estimated_cost:
          type: number
          format: double
          nullable: true
        error_message:
          type: string
          nullable: true
          description: Set when processing failed
    SlackMessageLogResponse:
      type: object
      required:
        - ok
        - id
      properties:
        ok:
          type: boolean
          const: true
        id:
          type: string
          format: uuid
          description: Created slack_messages row ID
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
        error:
          type: string
        code:
          type: string
  responses:
    Unauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error: Invalid API key
            code: INVALID_API_KEY
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key prefixed with `cr_` (e.g. `cr_a1b2c3...`)

````