Skip to main content

Post Queries

Get Post

Retrieve a specific post by its ID.

Query Structure

query GetPost(
$id: String!
$assignCursor: String
$assignLimit: Int
$commentCursor: String
$voteLimit: String
$voteCursor: Int
) {
post(id: $id) {
id
pid
title
excerpt
dateCreated
dateCompleted
isLocked
isPinned
isSample
isSubscribed
upvoteCount
downvoteCount
commentCount
moderationStatus
moderatedBy
moderator {
id
name
}
board {
id
name
}
properties {
id
parent
type
values
}
assignments(cursor: $assignCursor, limit: $assignLimit$) {
nodes {
user {
ssoId
name
}
assignedBy {
ssoId
name
}
}
hasMore
cursor
}
comments(cursor: $commentCursor) {
nodes {
id
text
}
hasMore
cursor
chunkSize
}
votes(cursor: $voteCursor, limit: $voteLimit) {
nodes {
id
type
}
hasMore
cursor
}
}
}

Input Fields

FieldTypeDescription
idString!Post ID

Get Posts

Retrieve a list of posts from a board with filtering and sorting options.

Query Structure

query GetPosts(
$cursor: String
$filters: [PostFilter!]
$limit: Int
$sort: PostSortOrder
) {
posts(
cursor: $cursor
filters: $filters
limit: $limit
sort: $sort
) {
nodes {
id
title
excerpt
upvoteCount
downvoteCount
commentCount
dateCreated
isLocked
isPinned
}
hasMore
cursor
}
}

Input Fields

FieldTypeDescription
cursorStringPagination cursor
filters[PostFilter!]List of filters to apply
limitIntNumber of posts to return
sortPostSortOrderSort order for the posts

PostFilter Input

FieldTypeDescription
typePostFilterType!Type of filter (FIELD or STATUS)
labelStringLabel for the filter
isStringMatcher for exact value
emptyStringMatcher for empty value

PostSortOrder Enum

ValueDescription
TRENDINGSort by trending score
TOPSort by top score
NEWESTSort by creation date (newest first)
COMPLETEDSort by completion date

Return Type

The Post type includes the following fields:

FieldTypeDescription
idString!Post ID
boardBoard!Board to which the post belongs
commentsPostCommentsPayload!Comments of the post
commentCountInt!Comments count of the post
dateCompletedDateTimeDate this post was marked completed
dateCreatedDateTime!Date this post was created
downvoteCountInt!Count of downvotes of the post
excerptStringSummary of the post (usually first comment)
isLockedBoolean!Post is locked or not
isDownvotedBoolean!Post is downvoted or not
isUpvotedBoolean!Post is upvoted or not
isSampleBoolean!Post is sample or not
isSubscribedBoolean!Post is subscribed or not (by the current user)
isPinnedBoolean!Post is pinned or not
mergedIntoPostStringPost ID of the post this post was merged into
moderationStatusPostModerationStatusModeration status of the post
moderatedByStringUserID who moderated the post
moderatorUserUser who moderated the post
pidString!Unique identifier of the post (usually a number specific to the board)
properties[PostProperty!]!Post properties (Refers to the custom fields created)
titleString!Title of the post
statusIdString!Status of post (if custom status is created) and null defaults are being used
upvoteCountInt!Count of upvotes of the post
votesVotesPayloadVotes of the post
assignmentsAssignmentsPayload!List of users assigned to the post

PostModerationStatus Enum

ValueDescription
APPROVEDPost has been approved
REJECTEDPost has been rejected
FLAGGEDPost has been flagged for review
PENDINGPost is pending moderation

AssignmentsPayload

FieldTypeDescription
nodes[Assign!]!List of assignments
hasMoreBoolean!Whether there are more assignments
cursorStringCursor for pagination

Assign Type

FieldTypeDescription
userUser!The user who is assigned
assignedByUser!The user who made the assignment

Example

query {
posts(
sort: NEWEST
limit: 10
filters: [
{ type: STATUS, is: "OPEN" }
]
) {
nodes {
id
title
excerpt
upvoteCount
commentCount
dateCreated
}
hasMore
cursor
}
}

Example Response:

{
"data": {
"posts": {
"nodes": [
{
"id": "post_123",
"title": "Add dark mode support",
"excerpt": "It would be great to have dark mode...",
"upvoteCount": 15,
"commentCount": 3,
"dateCreated": "2024-01-01T12:00:00Z"
}
],
"hasMore": true,
"cursor": "cursor_xyz"
}
}
}

Authentication

All post queries require authentication. You must include your API key and SSO information in the HTTP headers:

{
"apikey": "YOUR_API_KEY",
"ssotype": "YOUR_SSO_TYPE",
"ssoid": "YOUR_SSO_ID"
}

Error Handling

The queries may return errors in the following cases:

  • Invalid API key
  • Missing SSO type in headers
  • Missing SSO ID in headers
  • Invalid Post ID
  • Post not found
  • Post belongs to a different board

Example error response:

{
"errors": [
{
"message": "Invalid Post ID.",
"path": ["post"]
}
]
}