Skip to main content

Search Queries

The API provides three types of search functionality:

  1. Search Posts
  2. Search Comments
  3. Search Board Users

Search Posts

Search for posts across a board.

Query Structure

query SearchPosts(
$query: String!
$limit: Int
$offset: Int
$orderBy: PostOrderByInput
$showDeleted: Boolean
) {
searchPosts(
query: $query
limit: $limit
offset: $offset
orderBy: $orderBy
showDeleted: $showDeleted
) {
results {
id
title
pid
trendingScore
upvoteCount
downvoteCount
commentCount
dateDeleted
}
nbHits
}
}

Input Fields

FieldTypeDescription
queryString!Search query string
limitIntMaximum number of results to return (default: 10)
offsetIntNumber of results to skip (default: 0)
orderByPostOrderByInputSort order for results
showDeletedBooleanWhether to include deleted posts (default: false)

PostOrderByInput Enum

ValueDescription
dateUpdatedSort by last update date
trendingScoreSort by trending score
upvoteCountSort by number of upvotes
downvoteCountSort by number of downvotes
commentCountSort by number of comments

Return Type

FieldTypeDescription
results[PostData!]!Array of matching posts
nbHitsInt!Total number of matches found

PostData Type

FieldTypeDescription
idID!Post ID
titleString!Post title
pidString!Post unique identifier
trendingScoreFloat!Post trending score
upvoteCountInt!Number of upvotes
downvoteCountInt!Number of downvotes
commentCountInt!Number of comments
dateDeletedStringDeletion date if post is deleted

Search Comments

Search for comments within a post or across all posts.

Query Structure

query SearchComments(
$query: String!
$postId: ID
$limit: Int
$offset: Int
$showDeleted: Boolean
) {
searchComments(
query: $query
postId: $postId
limit: $limit
offset: $offset
showDeleted: $showDeleted
) {
results {
commentId
commentText
id
title
pid
trendingScore
upvoteCount
downvoteCount
commentCount
}
nbHits
}
}

Input Fields

FieldTypeDescription
queryString!Search query string
postIdIDOptional post ID to limit search scope
limitIntMaximum number of results to return (default: 25)
offsetIntNumber of results to skip (default: 0)
showDeletedBooleanWhether to include deleted comments (default: false)

Return Type

FieldTypeDescription
results[CommentData!]!Array of matching comments
nbHitsInt!Total number of matches found

CommentData Type

FieldTypeDescription
commentIdID!Comment ID
commentTextString!Comment text
idID!Post ID
titleString!Post title
pidString!Post unique identifier
trendingScoreFloat!Post trending score
upvoteCountInt!Number of upvotes
downvoteCountInt!Number of downvotes
commentCountInt!Number of comments

Search Board Users

Search for users within a board.

Query Structure

query SearchBoardUsers(
$query: String!
$limit: Int
$offset: Int
) {
searchBoardUsers(
query: $query
limit: $limit
offset: $offset
) {
results {
bio
email
emailOnMention
image
isSsoUser
name
ssoId
ssoType
}
nbHits
}
}

Input Fields

FieldTypeDescription
queryString!Search query string
limitIntMaximum number of results to return (default: 25)
offsetIntNumber of results to skip (default: 0)

Return Type

FieldTypeDescription
results[BoardTeamUser!]!Array of matching users
nbHitsInt!Total number of matches found

BoardTeamUser Type

FieldTypeDescription
bioStringUser biography
emailStringUser email
emailOnMentionBoolean!Whether user receives email notifications on mentions
imageStringUser profile image URL
isSsoUserBoolean!Whether user is authenticated via SSO
nameString!User name
ssoIdID!SSO identifier
ssoTypeStringType of SSO provider

Error Handling

All search queries require a valid API key and will return appropriate error messages if:

  • The API key is invalid
  • The search query fails to execute
  • Required parameters are missing

Common error scenarios:

{
"errors": [
{
"message": "Invalid API key",
"extensions": {
"code": "UNAUTHENTICATED"
}
}
]
}
{
"errors": [
{
"message": "An error occurred while searching posts",
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
}
}
]
}