Overview
POST/discussion/topicsdiscussion

Create a topic (atomically born with its opening post; community admin only)

Create a record in topics.

Auth: bearerAuth — calls run as the authenticated user.

Request body

application/json · optional

  • titlestring
  • bodystring

    Opening-post markdown; stored as a content.markdown body document.

  • communityIdstring

    Community instance to create under; the caller must be its admin (else 403).

  • categoryIdoptionalstring

    Optional category to file the topic under; must belong to the same community (else 400).

  • isPublicoptionalboolean

    Whether anonymous callers can read the topic via /public/discussion (default true).

Example
{
  "title": "string",
  "body": "string",
  "communityId": "string",
  "categoryId": "string",
  "isPublic": true
}
Responses
201

The created topic

  • idstring
  • communityIdstring

    The community instance this topic belongs to.

  • customerIdoptionalstring

    Author (server-stamped principal). Omitted on the public surface.

  • titlestring
  • categoryIdoptionalstring?
  • isPinnedboolean
  • isLockedboolean
  • isPublicboolean
  • replyCountinteger
  • answeredPostIdoptionalstring?
  • lastActivityAtstring
  • createdAtstring
  • updatedAtstring
  • excerptoptionalstring?

    LIST routes only: the opening post’s leading prose, flattened from markdown server-side (≤240 chars; null when its body doc was soft-deleted). Absent on single-topic reads and create/update responses.

  • authorNameoptionalstring?

    Authed COMMUNITY list route only: the author’s display name. Never on the public surface or the flat /discussion/topics list.

  • authorSlugoptionalstring?

    Authed COMMUNITY list route only: the author’s public handle. Never on the public surface or the flat /discussion/topics list.

  • authorAvatarUrloptionalstring?

    Authed COMMUNITY list route only: the author’s avatar URL. Never on the public surface or the flat /discussion/topics list.

Example
{
  "id": "string",
  "communityId": "string",
  "customerId": "string",
  "title": "string",
  "categoryId": "string",
  "isPinned": true,
  "isLocked": true,
  "isPublic": true,
  "replyCount": 0,
  "answeredPostId": "string",
  "lastActivityAt": "string",
  "createdAt": "string",
  "updatedAt": "string",
  "excerpt": "string",
  "authorName": "string",
  "authorSlug": "string",
  "authorAvatarUrl": "string"
}
400

Error

  • erroroptionalobject
Example
{
  "error": {
    "message": "string",
    "code": "string"
  }
}
401

Error

  • erroroptionalobject
Example
{
  "error": {
    "message": "string",
    "code": "string"
  }
}
403

Error

  • erroroptionalobject
Example
{
  "error": {
    "message": "string",
    "code": "string"
  }
}
Code examples
cURL
curl -X POST "https://api.agenticdeveloperhub.com/discussion/topics" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "string",
  "body": "string",
  "communityId": "string",
  "categoryId": "string",
  "isPublic": true
}'
JavaScript
const res = await fetch("https://api.agenticdeveloperhub.com/discussion/topics", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json"
  },
  body: "{\n  \"title\": \"string\",\n  \"body\": \"string\",\n  \"communityId\": \"string\",\n  \"categoryId\": \"string\",\n  \"isPublic\": true\n}",
});
const data = await res.json();