Skip to main content

Post Mutations

Create Post

Create a new post in a board.

Mutation Structure

mutation CreatePost(
$title: String!
$comment: String!
$files: [String]
$properties: [PostPropertyInput]
) {
createPost(
title: $title
comment: $comment
files: $files
properties: $properties
) {
id
title
comments {
nodes {
id
text
}
}
properties {
id
parent
values
}
}
}

Input Fields

FieldTypeDescription
titleString!Title of the post
commentString!First comment for the post
files[String]Array of file IDs to attach
properties[PostPropertyInput]Array of custom field values

PostPropertyInput

FieldTypeDescription
parentString!ID of the field (field node)
values[String]!Values of the field (fieldValue node)

Update Post

Update an existing post's properties.

Mutation Structure

mutation UpdatePost(
$id: String!
$title: String
$isLocked: Boolean
$isPinned: Boolean
) {
updatePost(
id: $id
title: $title
isLocked: $isLocked
isPinned: $isPinned
) {
node {
id
title
isLocked
isPinned
}
comment {
id
text
}
}
}

Input Fields

FieldTypeDescription
idString!Post ID
titleStringNew title for the post
isLockedBooleanWhether the post should be locked
isPinnedBooleanWhether the post should be pinned

Delete Post

Delete an existing post.

Mutation Structure

mutation DeletePost($postId: String!) {
deletePost(postId: $postId) {
id
title
}
}

Input Fields

FieldTypeDescription
postIdString!ID of the post to delete

Change Post Status

Change the status of a post.

Mutation Structure

mutation ChangePostStatus(
$postId: String!
$statusType: StatusType!
$statusId: String
) {
changePostStatus(
postId: $postId
statusType: $statusType
statusId: $statusId
) {
id
statusId
}
}

Input Fields

FieldTypeDescription
postIdString!Post ID
statusTypeStatusType!Type of status to set
statusIdStringID of custom status (required if StatusType is CUSTOM)

Change Post Moderation Status

Change the moderation status of a post.

Mutation Structure

mutation ChangePostModerationStatus(
$id: String!
$moderationStatus: PostModerationStatus!
$commentId: String
) {
changePostModerationStatus(
id: $id
moderationStatus: $moderationStatus
commentId: $commentId
) {
id
moderationStatus
moderatedBy
}
}

Input Fields

FieldTypeDescription
idString!Post ID
moderationStatusPostModerationStatus!New moderation status
commentIdStringOptional comment ID related to moderation

Merge Posts

Merge one post into another.

Mutation Structure

mutation MergePosts($sourceId: String!, $targetId: String!) {
mergePost(sourceId: $sourceId, targetId: $targetId) {
node {
id
title
}
comment {
id
text
}
}
}

Input Fields

FieldTypeDescription
sourceIdString!ID of the post to merge from
targetIdString!ID of the post to merge into

Subscribe to Post

Subscribe or unsubscribe from a post.

Mutation Structure

mutation SubscribeToPost(
$postId: String!
$type: SubscribeToPostType!
) {
subscribeToPost(postId: $postId, type: $type)
}

Input Fields

FieldTypeDescription
postIdString!Post ID
typeSubscribeToPostType!SUBSCRIBE or CANCEL

Vote on Post

Vote on a post.

Mutation Structure

mutation VotePost($postId: String!, $type: VoteType!) {
votePost(postId: $postId, type: $type) {
id
upvoteCount
downvoteCount
}
}

Input Fields

FieldTypeDescription
postIdString!Post ID
typeVoteType!UP, DOWN, or CANCEL

Vote on Post on Behalf of User

Vote on a post on behalf of another user.

Mutation Structure

mutation VotePostOnBehalfUser(
$postId: String!
$type: VoteType!
$ssoId: String
$name: String
) {
votePostOnBehalfUser(
postId: $postId
type: $type
ssoId: $ssoId
name: $name
) {
id
upvoteCount
downvoteCount
}
}

Input Fields

FieldTypeDescription
postIdString!Post ID
typeVoteType!UP, DOWN, or CANCEL
ssoIdStringSSO ID of the user to vote on behalf of
nameStringName of the user

Assign User to Post

Assign a user to a post.

Mutation Structure

mutation AssignPost($postId: ID!, $ssoId: String!) {
assignPost(postId: $postId, ssoId: $ssoId) {
user {
ssoId
name
}
assignedBy {
id
name
}
}
}

Input Fields

FieldTypeDescription
postIdID!ID of the post to assign the user to
ssoIdString!SSO ID of the user to assign

Return Type

Returns an Assign object containing:

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

Unassign User from Post

Remove a user's assignment from a post.

Mutation Structure

mutation UnassignPost($postId: ID!, $ssoId: String!) {
unassignPost(postId: $postId, ssoId: $ssoId)
}

Input Fields

FieldTypeDescription
postIdID!ID of the post to unassign the user from
ssoIdString!SSO ID of the user to unassign

Return Type

Returns a boolean indicating success (true) or failure (false).

Authentication

All post mutations require authentication with write access. 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 mutations may return errors in the following cases:

  • Invalid API key
  • Missing write access
  • Missing SSO type in headers
  • Missing SSO ID in headers
  • Invalid Post ID
  • Post not found
  • Post belongs to a different board
  • Invalid status type or missing required status ID
  • Invalid moderation status
  • Invalid vote type
  • User not found
  • Field not found (for custom properties)

Example error response:

{
"errors": [
{
"message": "Write access required",
"path": ["createPost"]
}
]
}