meta { name: Lock Topic type: http seq: 3 } post { url: {{appview_url}}/api/mod/lock } headers { Content-Type: application/json } body:json { { "topicId": "123456", "reason": "Thread has become off-topic" } } assert { res.status: eq 200 res.body.success: eq true res.body.action: eq space.atbb.modAction.lock } docs { Locks a topic to prevent new replies (moderator action). Requires authentication via session cookie and `space.atbb.permission.lockTopics` permission. Body parameters: - topicId: string (required) - Database ID of the topic post to lock (must be numeric) - reason: string (required) - Reason for locking (1-3000 characters, cannot be empty) Returns: { "success": true, "action": "space.atbb.modAction.lock", "topicId": "123456", "postUri": "at://user-did/space.atbb.post/rkey", "uri": "at://forum-did/space.atbb.modAction/rkey", "cid": "bafyrei...", "alreadyActive": false } If topic is already locked, returns 200 with `alreadyActive: true` (idempotent). Writes a modAction record to the Forum DID's PDS with: - action: "space.atbb.modAction.lock" - subject: { post: { uri, cid } } - reason: provided reason - createdBy: moderator's DID Error codes: - 400: Invalid input (missing/invalid topicId, missing/empty reason, malformed JSON, post is a reply not a topic) - 401: Unauthorized (not authenticated) - 403: Forbidden (lacks lockTopics permission) - 404: Post not found - 500: ForumAgent not available (server configuration issue) - 503: ForumAgent not authenticated or unable to reach Forum PDS (retry later) Notes: - Only works on topic posts (root posts), not replies - Returns 400 if post is a reply (rootPostId !== null) - Locks are additive - unlock writes a new reversal action }