Skip to content
gist.link ↗

createPost

Mutation Teams API — POST https://teams.api.gist.link/graphql

Post a message to a channel. Any team member.

teams:mutation:createPost

The calling IAM key must hold this permission (or a wildcard that covers it: teams:mutation:* or teams:*) and the access token must have been minted with audience=teams. See Permissions.

type Mutation {
createPost(channelId: Int!, input: CreatePostInput!): Post!
}
Argument Type Required Description
channelId Int! Yes —
input CreatePostInput! Yes —

Post! — see the Teams types reference.

Terminal window
curl https://teams.api.gist.link/graphql \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d @- <<'JSON'
{
"query": "mutation CreatePost($channelId: Int!, $input: CreatePostInput!) { createPost(channelId: $channelId, input: $input) { id channel_id body pinned edited_at created_at comment_count } }",
"variables": {
"channelId": 10,
"input": {
"body": "example"
}
}
}
JSON