/discussion/topicsdiscussionCreate a topic (atomically born with its opening post; community admin only)
Create a record in topics.
Auth: bearerAuth — calls run as the authenticated user.
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).
{
"title": "string",
"body": "string",
"communityId": "string",
"categoryId": "string",
"isPublic": true
}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.
{
"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"
}Error
- erroroptionalobject
{
"error": {
"message": "string",
"code": "string"
}
}Error
- erroroptionalobject
{
"error": {
"message": "string",
"code": "string"
}
}Error
- erroroptionalobject
{
"error": {
"message": "string",
"code": "string"
}
}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
}'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();