Skip to content

Trigger a channel tool

POST /public/v1/integration-trigger/{id}

Runs one of a channel’s provider-specific helpers. These are the lookups the composer uses to fill in a dropdown: the subreddits you can post to, the Pinterest boards you own, the Discord channels a bot can see.

You need them because several providers require a value in settings that only the platform knows. This is how you fetch the valid options rather than guessing.

Also available as sharek integrations:trigger (CLI) and triggerTool (MCP).

Parameter Required Description
id Yes The integration id from list channels.
Field Required Description
methodName Yes The tool to run. Discover the valid names from the tools array of channel settings.
data No Arguments for the tool, shaped by that tool’s dataSchema. Defaults to {}.
Terminal window
curl -X POST https://dash.sharek.app/api/public/v1/integration-trigger/channel-id \
-H "Authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"methodName": "subreddits",
"data": { "word": "marketing" }
}'

The provider’s own return value, wrapped:

{ "output": [ { "id": "...", "name": "..." } ] }

The shape inside output is whatever that tool returns, so read the dataSchema from channel settings rather than assuming a common format.

Response Meaning
404 {"msg": "Integration not found"} No such channel in your organization.
404 {"msg": "Integration provider not found"} The channel exists but its provider is no longer offered.
404 {"msg": "Tool not found"} The provider has no tool by that methodName. Names are case-sensitive.
401 {"msg": "Channel disconnected due to expired token"} The channel’s token expired and could not be refreshed, so Sharek disconnected the channel. Reconnect it in the app.
500 {"msg": "Unexpected error"} The tool failed for another reason, such as an error from the platform.

If the channel’s access token has expired, Sharek refreshes it and retries the tool automatically, so a stale token is not something you need to handle. If the refresh itself fails, the channel is disconnected and marked as needing attention in the app, and the call answers 401.