SynqDocs
Management APIOwn bots

Set the brand's own Discord app

A Discord app of your own serves the brand alone, in place of the org's: the servers and groups it adds with `own_bot: true` (`POST …/discord-servers/install`), in place of Synq's: its install screen, its name and picture. Checked with Discord first: the token must be the bot of the app `application_id` names, and `public_key` that app's key (400 at the field with the fix; 503 when Discord doesn't answer). Its token and client secret are sealed, never shown again. Then set the answer's `setup.interactions_endpoint_url` as the app's Interactions Endpoint URL and add `setup.redirect_uri` on its OAuth2 page. Sending the same app again replaces its credentials; another app can't replace one that still serves servers, and one app is one place's alone, the org's or one brand's (409). Needs `org.integrations.edit` in the brand and a plan with `integration.own_bots` (Scale and up). Recorded as `own_bot.set`.

PUT/v1/orgs/{org}/brands/{brand}/own-bots/discord

A Discord app of your own serves the brand alone, in place of the org's: the servers and groups it adds with own_bot: true (POST …/discord-servers/install), in place of Synq's: its install screen, its name and picture. Checked with Discord first: the token must be the bot of the app application_id names, and public_key that app's key (400 at the field with the fix; 503 when Discord doesn't answer). Its token and client secret are sealed, never shown again. Then set the answer's setup.interactions_endpoint_url as the app's Interactions Endpoint URL and add setup.redirect_uri on its OAuth2 page. Sending the same app again replaces its credentials; another app can't replace one that still serves servers, and one app is one place's alone, the org's or one brand's (409). Needs org.integrations.edit in the brand and a plan with integration.own_bots (Scale and up). Recorded as own_bot.set.

Authorization

bearer
AuthorizationBearer <token>

An org API key (sk_live_…, sk_test_…), or an access token from the Synq issuer (the synq brand, on the accounts host) for this API.

In: header

Path Parameters

org*string

The org's id

Match^org_[0-9a-hjkmnp-tv-z]{26}$
brand*string

The brand's id

Match^brd_[0-9a-hjkmnp-tv-z]{26}$

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X PUT "https://api.synq.build/v1/orgs/org_01h455vb4pex5vsknk084sn02q/brands/brd_01h455vb4pex5vsknk084sn02q/own-bots/discord" \  -H "Authorization: Bearer $SYNQ_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "application_id": "1203847562019384756",    "public_key": "string",    "client_secret": "string",    "token": "string"  }'
{  "id": "bot_01h455vb4pex5vsknk084sn02q",  "platform": "discord",  "brand_id": "brd_01h455vb4pex5vsknk084sn02q",  "external_id": "1203847562019384756",  "name": "Mollyverse Bot",  "username": "MollyverseBot",  "serves": 0,  "sign_in_brands": [    "string"  ],  "setup": {    "interactions_endpoint_url": "https://app.acme.example",    "redirect_uri": "https://app.acme.example",    "webhook_url": "https://app.acme.example",    "trusted_origins": [      "https://acme.auth.synq.build",      "https://login.acme.example"    ],    "allowed_urls": [      "https://acme.auth.synq.build/federation/telegram/callback",      "https://login.acme.example/federation/telegram/callback"    ]  },  "created_at": "2026-10-21T12:00:00.000Z",  "updated_at": "2026-10-21T12:00:00.000Z"}

Read the org's own Discord app and Telegram bot, and its brands' GET

What the org set: each bot's ids and names, how many servers or groups it serves, and what to set in Discord's portal, for the org's own (which serve every brand without its own) and each brand's. Never a token or client secret. Needs `org.integrations.view` across the org.

Set the brand's own Telegram bot PUT

A Telegram bot of your own serves the brand alone, in place of the org's: the servers and groups it adds with `own_bot: true` (`POST …/telegram-groups/connect`), in place of Synq's: its name and picture in the group and in what it writes to people. Checked with Telegram first (getMe; 400 at `token` with the fix, 503 when Telegram doesn't answer), its token sealed and never shown again, and its webhook pointed at Synq with a secret of its own. To be a group's guard bot, turn on join request queries for it in @BotFather. Sending the same bot again replaces its token; another bot can't replace one that still serves groups, and one bot is one place's alone, the org's or one brand's (409). Set once, for groups and sign-in alike: with `client_secret`, the bot is the place's Telegram sign-in app too, which also needs `org.connections.edit` in the brand, a plan with `auth.byo_connections` and, for a person, a sign-in from the last 5 minutes (403), and is refused as that route refuses a change of app (409 `members_would_be_stranded`, 422 `connection_rejected`), with nothing kept. Needs `org.integrations.edit` in the brand and a plan with `integration.own_bots` (Scale and up). Recorded as `own_bot.set`, and with `client_secret` as the sign-in app's own change too.