Skip to content

docs: add Content Agent Slack tags admin endpoint#81

Merged
recoup-coding-agent merged 5 commits intomainfrom
docs/content-agent
Mar 26, 2026
Merged

docs: add Content Agent Slack tags admin endpoint#81
recoup-coding-agent merged 5 commits intomainfrom
docs/content-agent

Conversation

@recoup-coding-agent
Copy link
Copy Markdown
Collaborator

@recoup-coding-agent recoup-coding-agent commented Mar 26, 2026

Summary

  • Add OpenAPI spec for GET /api/admins/content/slack endpoint following existing /api/admins/coding/slack pattern
  • Create MDX page at api-reference/admins/content-slack-tags.mdx
  • Add page to Admins navigation group in docs.json
  • Response schema includes video_links (Content Agent) instead of pull_requests (Coding Agent)

Test plan

  • Verify openapi.json is valid JSON
  • Verify the new page renders correctly in Mintlify preview
  • Verify navigation shows the new page under Admins group

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added Content Agent Slack analytics endpoint for admins with customizable time period filtering.
  • Documentation

    • Added API reference documentation for Content Agent Slack analytics.
    • Updated Coding Agent Slack analytics documentation to include pull request metrics.

Recoup CTO Agent and others added 3 commits March 24, 2026 16:23
- Guide page covering @mention syntax, data flow, setup, and troubleshooting
- OpenAPI spec entries for POST /api/content-agent/{platform} and POST /api/content-agent/callback
- API reference pages for webhook and callback endpoints
- Navigation updated with Agents group in Guides tab and Content Agent group in API reference

Co-Authored-By: Paperclip <noreply@paperclip.ing>
- Link POST /api/content-agent/callback to its API reference page
  in both the data flow section and endpoints table
- Add missing RECOUP_API_KEY to environment variables table

Co-Authored-By: Paperclip <noreply@paperclip.ing>
Add OpenAPI spec and MDX page for GET /api/admins/content/slack,
following the existing coding/slack pattern. Response includes
video_links instead of pull_requests.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 026a24c6-5d77-45c5-890c-aa802416f1d5

📥 Commits

Reviewing files that changed from the base of the PR and between 732eb65 and 4b8f1a8.

📒 Files selected for processing (1)
  • api-reference/openapi.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • api-reference/openapi.json

📝 Walkthrough

Walkthrough

This PR adds documentation for a new admin content agent Slack analytics endpoint, updates the existing coding Slack endpoint schema to include pull request metrics, and extends the navigation structure to accommodate these additions.

Changes

Cohort / File(s) Summary
New API Reference Page
api-reference/admins/content-slack-tags.mdx
Added new MDX documentation page for the "List Content Agent Slack Tags" admin endpoint, linking to the GET /api/admins/content/slack OpenAPI route.
OpenAPI Schema Updates
api-reference/openapi.json
Updated GET /api/admins/coding/slack response to include PR aggregate metrics (total_pull_requests, tags_with_pull_requests) and per-tag pull_requests array with GitHub URLs. Added new GET /api/admins/content/slack endpoint with optional period query parameter, returning status/total/tags structure with per-tag video_links array. Both endpoints now include 401/403/500 error responses.
Navigation Configuration
docs.json
Added new "Agents" tab section with content-agent page. Extended API reference structure with api-reference/admins/content-slack-tags under Admins group and new Content Agent group with webhook and callback documentation pages.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • recoupable/docs#74: Adds documentation for the GET /api/admins/coding/slack endpoint that this PR updates with additional response schema fields.
  • recoupable/docs#75: Modifies the same GET /api/admins/coding/slack endpoint response schema by adding the per-tag pull_requests array.

Poem

🐰 A documentation hop so fine,
New Slack endpoints start to shine,
Content agents join the fun,
API docs—our work is done!
Tags and vids in perfect line. 📚✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the primary change: adding documentation for a new Content Agent Slack tags admin endpoint, which is represented across all three modified files (openapi.json, content-slack-tags.mdx, and docs.json).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/content-agent

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@api-reference/openapi.json`:
- Around line 4633-4673: Update the "responses" -> "200" schema for the Slack
webhook endpoint so it documents both behaviors described in the "description":
keep the existing JSON shape with {"ok": boolean} for normal event processing
and add an alternative shape for Slack's url_verification challenge (e.g.,
{"challenge": string}) using oneOf or by adding an additional content/schema
option; modify the "responses" -> "200" entry referenced in the diff (the
existing "200" response block under "requestBody"/"responses") so the OpenAPI
spec accurately reflects both the event-acknowledgement and the url_verification
response shapes.
- Around line 4764-4767: The OpenAPI file uses a security requirement named
"callbackSecret" for the POST /api/content-agent/callback endpoint but never
declares that scheme; add a corresponding entry named "callbackSecret" under
components.securitySchemes describing the type and details (e.g., apiKey in
header/query or http bearer) to match how the endpoint expects to be
authenticated so the reference is valid; update components.securitySchemes with
a properly named scheme "callbackSecret" and ensure its "name", "in", or
"scheme"/"bearerFormat" fields align with the POST /api/content-agent/callback
implementation.

In `@content-agent.mdx`:
- Line 127: Replace the incorrect troubleshooting row that reads "No GitHub
repository found | Artist missing repo config | Ensure the artist account has a
linked GitHub repo" in content-agent.mdx: remove it or replace it with a
content-agent-specific entry such as "Missing artist assets | Artist has not
uploaded required media or metadata | Ensure the artist has uploaded required
assets (images/video/audio) and that content configuration/metadata is valid" so
the table reflects content-generation errors rather than GitHub-related issues.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3334bf86-1da0-4b16-ac74-7f06fb8cb662

📥 Commits

Reviewing files that changed from the base of the PR and between ded5c83 and 732eb65.

📒 Files selected for processing (6)
  • api-reference/admins/content-slack-tags.mdx
  • api-reference/content-agent/callback.mdx
  • api-reference/content-agent/webhook.mdx
  • api-reference/openapi.json
  • content-agent.mdx
  • docs.json

Comment on lines +4633 to +4673
"description": "Webhook endpoint for the Recoup Content Agent Slack bot. Receives @mention events from Slack and triggers content generation for the mentioned artist. The bot parses the mention text for `<artist_account_id> [template] [batch=N] [lipsync]`, validates the artist, calls POST /api/content/create, and starts a background polling task that reports results back to the Slack thread.\n\nFor Slack, also handles `url_verification` challenges during app setup.",
"parameters": [
{
"name": "platform",
"in": "path",
"description": "Chat platform identifier. Currently supports `slack`.",
"required": true,
"schema": {
"type": "string",
"enum": ["slack"]
}
}
],
"requestBody": {
"description": "Slack Events API payload (app_mention event or url_verification challenge)",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "Slack Events API envelope — the shape depends on the event type"
}
}
}
},
"responses": {
"200": {
"description": "Event processed successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"ok": {
"type": "boolean"
}
}
}
}
}
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Align the webhook 200 response schema with the documented behaviors.

Line 4633 says the endpoint handles Slack url_verification, but Line 4659-Line 4670 only documents { ok: boolean }. Add a second response shape (or oneOf) for the verification flow so the spec matches the description.

📘 Suggested OpenAPI update
           "200": {
-            "description": "Event processed successfully",
+            "description": "Event processed successfully (event callback or url_verification)",
             "content": {
               "application/json": {
                 "schema": {
-                  "type": "object",
-                  "properties": {
-                    "ok": {
-                      "type": "boolean"
-                    }
-                  }
+                  "oneOf": [
+                    {
+                      "type": "object",
+                      "required": ["ok"],
+                      "properties": {
+                        "ok": { "type": "boolean" }
+                      }
+                    },
+                    {
+                      "type": "object",
+                      "required": ["challenge"],
+                      "properties": {
+                        "challenge": { "type": "string" }
+                      }
+                    }
+                  ]
                 }
               }
             }
           },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@api-reference/openapi.json` around lines 4633 - 4673, Update the "responses"
-> "200" schema for the Slack webhook endpoint so it documents both behaviors
described in the "description": keep the existing JSON shape with {"ok":
boolean} for normal event processing and add an alternative shape for Slack's
url_verification challenge (e.g., {"challenge": string}) using oneOf or by
adding an additional content/schema option; modify the "responses" -> "200"
entry referenced in the diff (the existing "200" response block under
"requestBody"/"responses") so the OpenAPI spec accurately reflects both the
event-acknowledgement and the url_verification response shapes.

Comment on lines +4764 to +4767
"security": [
{
"callbackSecret": []
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
python - <<'PY'
import json, sys

with open("api-reference/openapi.json", "r", encoding="utf-8") as f:
    spec = json.load(f)

declared = set(spec.get("components", {}).get("securitySchemes", {}).keys())
missing = []

for path, path_item in spec.get("paths", {}).items():
    for method, op in path_item.items():
        if method.lower() not in {"get", "post", "put", "patch", "delete", "options", "head", "trace"}:
            continue
        for sec in op.get("security", []):
            for scheme_name in sec.keys():
                if scheme_name not in declared:
                    missing.append((path, method.upper(), scheme_name))

if missing:
    print("Missing security scheme declarations:")
    for path, method, name in missing:
        print(f"- {method} {path}: {name}")
    sys.exit(1)

print("All operation security schemes are declared.")
PY

Repository: recoupable/docs

Length of output: 147


Declare callbackSecret under components.securitySchemes.

The OpenAPI specification references callbackSecret in the POST /api/content-agent/callback endpoint security requirement (lines 4764-4767), but this security scheme is not declared in components.securitySchemes. This violates the OpenAPI standard and will fail validation.

🛠️ Suggested fix
   "securitySchemes": {
+    "callbackSecret": {
+      "type": "apiKey",
+      "in": "header",
+      "name": "x-callback-secret",
+      "description": "Shared secret for internal content-agent callback requests."
+    },
     "bearerAuth": {
       "type": "http",
       "scheme": "bearer"
     },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"security": [
{
"callbackSecret": []
}
"securitySchemes": {
"callbackSecret": {
"type": "apiKey",
"in": "header",
"name": "x-callback-secret",
"description": "Shared secret for internal content-agent callback requests."
},
"bearerAuth": {
"type": "http",
"scheme": "bearer"
},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@api-reference/openapi.json` around lines 4764 - 4767, The OpenAPI file uses a
security requirement named "callbackSecret" for the POST
/api/content-agent/callback endpoint but never declares that scheme; add a
corresponding entry named "callbackSecret" under components.securitySchemes
describing the type and details (e.g., apiKey in header/query or http bearer) to
match how the endpoint expects to be authenticated so the reference is valid;
update components.securitySchemes with a properly named scheme "callbackSecret"
and ensure its "name", "in", or "scheme"/"bearerFormat" fields align with the
POST /api/content-agent/callback implementation.

|-------|-------|-----|
| No response from bot | Event subscription URL not configured | Check Slack app Event Subscriptions |
| "Artist not found" | Invalid `artist_account_id` | Verify the UUID exists in the platform |
| "No GitHub repository found" | Artist missing repo config | Ensure the artist account has a linked GitHub repo |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Incorrect troubleshooting entry for Content Agent context.

The error "No GitHub repository found" and the fix "Ensure the artist account has a linked GitHub repo" appear to be copied from coding agent documentation. The Content Agent generates videos for artists and doesn't require GitHub repositories. This troubleshooting entry should either be removed or replaced with a content-generation-specific error (e.g., missing artist assets, invalid content configuration).

🔧 Suggested fix
-| "No GitHub repository found" | Artist missing repo config | Ensure the artist account has a linked GitHub repo |
+| "Artist not ready for content creation" | Missing required artist assets | Verify the artist has profile data, images, and content via [`GET /api/content/validate`](/api-reference/content/validate) |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@content-agent.mdx` at line 127, Replace the incorrect troubleshooting row
that reads "No GitHub repository found | Artist missing repo config | Ensure the
artist account has a linked GitHub repo" in content-agent.mdx: remove it or
replace it with a content-agent-specific entry such as "Missing artist assets |
Artist has not uploaded required media or metadata | Ensure the artist has
uploaded required assets (images/video/audio) and that content
configuration/metadata is valid" so the table reflects content-generation errors
rather than GitHub-related issues.

sweetmantech and others added 2 commits March 26, 2026 12:03
Add total_pull_requests and tags_with_pull_requests fields to match
the actual API response. Update description and examples accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@recoup-coding-agent recoup-coding-agent merged commit 41ba213 into main Mar 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants