Templates
Change a template
Change a template.
PATCH
/v1/templates/{id}TL;DR
| Question | Answer |
|---|---|
| What does it do? | Change a template. |
| What does it need? | An API key or an OAuth access token. |
| What does it take? | A JSON body with the fields below, and id in the path. |
| What does it return? | Status 200 with a body of type Template. |
| In the SDK? | flung.templates.update() |
| What can go wrong? | 401 Missing, unknown, revoked or expired API key; 404 No such template in this workspace; 422 The request failed validation; 429 Too many requests for this credential; wait for retry-after seconds. Every failure has the same error shape. |
Example
bash
curl -X PATCH 'https://api.flung.dev/v1/templates/tpl_aaaaaaaaaaaaaaaaaaaaaaaa' \ --header "Authorization: Bearer $FLUNG_API_KEY" \ --header 'Content-Type: application/json' \ --data '{ "content": "Launching today."}'ts
import { Flung } from '@flung.dev/sdk'
const flung = new Flung({ apiKey: process.env.FLUNG_API_KEY! })const result = await flung.templates.update({ id: 'tpl_aaaaaaaaaaaaaaaaaaaaaaaa', content: 'Launching today.',})js
const response = await fetch('https://api.flung.dev/v1/templates/tpl_aaaaaaaaaaaaaaaaaaaaaaaa', { method: 'PATCH', headers: { 'Authorization': `Bearer ${process.env.FLUNG_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ content: 'Launching today.', }),})if (!response.ok) throw new Error((await response.json()).error.message)const result = await response.json()A successful answer looks like this:
json
{ "id": "tpl_aaaaaaaaaaaaaaaaaaaaaaaa", "name": "string", "content": "string", "mediaIds": [ "string" ], "accountIds": [ "string" ], "platformOverrides": {}, "createdAt": "2026-11-01T09:00:00.000Z", "updatedAt": "2026-11-01T09:00:00.000Z"}Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes |
Request body
The body has the type an object, with the fields below.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | no | at least 1 character; at most 100 characters. |
content | string | no | at least 1 character; at most 10000 characters. |
mediaIds | string[] | no | |
accountIds | string[] | no | |
platformOverrides | object | no | |
platformOverrides.x | object | no | |
platformOverrides.x.content | string | no | at least 1 character. |
platformOverrides.x.boardId | string | no | Pinterest only: the board to pin to, instead of the account's default board. at least 1 character; at most 64 characters. |
platformOverrides.x.privacyLevel | "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | no | TikTok only: who sees the video, one of the account's privacyLevels (GET /v1/accounts/{id}/posting-options). Defaults to the most public one allowed. |
platformOverrides.x.allowComments | boolean | no | TikTok only. Default true, unless the creator turned comments off. |
platformOverrides.x.allowDuet | boolean | no | TikTok only. Default true, unless the creator turned duets off. |
platformOverrides.x.allowStitch | boolean | no | TikTok only. Default true, unless the creator turned stitches off. |
platformOverrides.x.promotesOwnBrand | boolean | no | TikTok only: the video promotes the creator's own business. |
platformOverrides.x.brandedContent | boolean | no | TikTok only: a paid partnership promoting a third party. Not allowed with SELF_ONLY. |
platformOverrides.instagram | object | no | |
platformOverrides.instagram.content | string | no | at least 1 character. |
platformOverrides.instagram.boardId | string | no | Pinterest only: the board to pin to, instead of the account's default board. at least 1 character; at most 64 characters. |
platformOverrides.instagram.privacyLevel | "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | no | TikTok only: who sees the video, one of the account's privacyLevels (GET /v1/accounts/{id}/posting-options). Defaults to the most public one allowed. |
platformOverrides.instagram.allowComments | boolean | no | TikTok only. Default true, unless the creator turned comments off. |
platformOverrides.instagram.allowDuet | boolean | no | TikTok only. Default true, unless the creator turned duets off. |
platformOverrides.instagram.allowStitch | boolean | no | TikTok only. Default true, unless the creator turned stitches off. |
platformOverrides.instagram.promotesOwnBrand | boolean | no | TikTok only: the video promotes the creator's own business. |
platformOverrides.instagram.brandedContent | boolean | no | TikTok only: a paid partnership promoting a third party. Not allowed with SELF_ONLY. |
platformOverrides.facebook | object | no | |
platformOverrides.facebook.content | string | no | at least 1 character. |
platformOverrides.facebook.boardId | string | no | Pinterest only: the board to pin to, instead of the account's default board. at least 1 character; at most 64 characters. |
platformOverrides.facebook.privacyLevel | "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | no | TikTok only: who sees the video, one of the account's privacyLevels (GET /v1/accounts/{id}/posting-options). Defaults to the most public one allowed. |
platformOverrides.facebook.allowComments | boolean | no | TikTok only. Default true, unless the creator turned comments off. |
platformOverrides.facebook.allowDuet | boolean | no | TikTok only. Default true, unless the creator turned duets off. |
platformOverrides.facebook.allowStitch | boolean | no | TikTok only. Default true, unless the creator turned stitches off. |
platformOverrides.facebook.promotesOwnBrand | boolean | no | TikTok only: the video promotes the creator's own business. |
platformOverrides.facebook.brandedContent | boolean | no | TikTok only: a paid partnership promoting a third party. Not allowed with SELF_ONLY. |
platformOverrides.threads | object | no | |
platformOverrides.threads.content | string | no | at least 1 character. |
platformOverrides.threads.boardId | string | no | Pinterest only: the board to pin to, instead of the account's default board. at least 1 character; at most 64 characters. |
platformOverrides.threads.privacyLevel | "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | no | TikTok only: who sees the video, one of the account's privacyLevels (GET /v1/accounts/{id}/posting-options). Defaults to the most public one allowed. |
platformOverrides.threads.allowComments | boolean | no | TikTok only. Default true, unless the creator turned comments off. |
platformOverrides.threads.allowDuet | boolean | no | TikTok only. Default true, unless the creator turned duets off. |
platformOverrides.threads.allowStitch | boolean | no | TikTok only. Default true, unless the creator turned stitches off. |
platformOverrides.threads.promotesOwnBrand | boolean | no | TikTok only: the video promotes the creator's own business. |
platformOverrides.threads.brandedContent | boolean | no | TikTok only: a paid partnership promoting a third party. Not allowed with SELF_ONLY. |
platformOverrides.linkedin | object | no | |
platformOverrides.linkedin.content | string | no | at least 1 character. |
platformOverrides.linkedin.boardId | string | no | Pinterest only: the board to pin to, instead of the account's default board. at least 1 character; at most 64 characters. |
platformOverrides.linkedin.privacyLevel | "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | no | TikTok only: who sees the video, one of the account's privacyLevels (GET /v1/accounts/{id}/posting-options). Defaults to the most public one allowed. |
platformOverrides.linkedin.allowComments | boolean | no | TikTok only. Default true, unless the creator turned comments off. |
platformOverrides.linkedin.allowDuet | boolean | no | TikTok only. Default true, unless the creator turned duets off. |
platformOverrides.linkedin.allowStitch | boolean | no | TikTok only. Default true, unless the creator turned stitches off. |
platformOverrides.linkedin.promotesOwnBrand | boolean | no | TikTok only: the video promotes the creator's own business. |
platformOverrides.linkedin.brandedContent | boolean | no | TikTok only: a paid partnership promoting a third party. Not allowed with SELF_ONLY. |
platformOverrides.tiktok | object | no | |
platformOverrides.tiktok.content | string | no | at least 1 character. |
platformOverrides.tiktok.boardId | string | no | Pinterest only: the board to pin to, instead of the account's default board. at least 1 character; at most 64 characters. |
platformOverrides.tiktok.privacyLevel | "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | no | TikTok only: who sees the video, one of the account's privacyLevels (GET /v1/accounts/{id}/posting-options). Defaults to the most public one allowed. |
platformOverrides.tiktok.allowComments | boolean | no | TikTok only. Default true, unless the creator turned comments off. |
platformOverrides.tiktok.allowDuet | boolean | no | TikTok only. Default true, unless the creator turned duets off. |
platformOverrides.tiktok.allowStitch | boolean | no | TikTok only. Default true, unless the creator turned stitches off. |
platformOverrides.tiktok.promotesOwnBrand | boolean | no | TikTok only: the video promotes the creator's own business. |
platformOverrides.tiktok.brandedContent | boolean | no | TikTok only: a paid partnership promoting a third party. Not allowed with SELF_ONLY. |
platformOverrides.youtube | object | no | |
platformOverrides.youtube.content | string | no | at least 1 character. |
platformOverrides.youtube.boardId | string | no | Pinterest only: the board to pin to, instead of the account's default board. at least 1 character; at most 64 characters. |
platformOverrides.youtube.privacyLevel | "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | no | TikTok only: who sees the video, one of the account's privacyLevels (GET /v1/accounts/{id}/posting-options). Defaults to the most public one allowed. |
platformOverrides.youtube.allowComments | boolean | no | TikTok only. Default true, unless the creator turned comments off. |
platformOverrides.youtube.allowDuet | boolean | no | TikTok only. Default true, unless the creator turned duets off. |
platformOverrides.youtube.allowStitch | boolean | no | TikTok only. Default true, unless the creator turned stitches off. |
platformOverrides.youtube.promotesOwnBrand | boolean | no | TikTok only: the video promotes the creator's own business. |
platformOverrides.youtube.brandedContent | boolean | no | TikTok only: a paid partnership promoting a third party. Not allowed with SELF_ONLY. |
platformOverrides.pinterest | object | no | |
platformOverrides.pinterest.content | string | no | at least 1 character. |
platformOverrides.pinterest.boardId | string | no | Pinterest only: the board to pin to, instead of the account's default board. at least 1 character; at most 64 characters. |
platformOverrides.pinterest.privacyLevel | "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | no | TikTok only: who sees the video, one of the account's privacyLevels (GET /v1/accounts/{id}/posting-options). Defaults to the most public one allowed. |
platformOverrides.pinterest.allowComments | boolean | no | TikTok only. Default true, unless the creator turned comments off. |
platformOverrides.pinterest.allowDuet | boolean | no | TikTok only. Default true, unless the creator turned duets off. |
platformOverrides.pinterest.allowStitch | boolean | no | TikTok only. Default true, unless the creator turned stitches off. |
platformOverrides.pinterest.promotesOwnBrand | boolean | no | TikTok only: the video promotes the creator's own business. |
platformOverrides.pinterest.brandedContent | boolean | no | TikTok only: a paid partnership promoting a third party. Not allowed with SELF_ONLY. |
platformOverrides.bluesky | object | no | |
platformOverrides.bluesky.content | string | no | at least 1 character. |
platformOverrides.bluesky.boardId | string | no | Pinterest only: the board to pin to, instead of the account's default board. at least 1 character; at most 64 characters. |
platformOverrides.bluesky.privacyLevel | "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | no | TikTok only: who sees the video, one of the account's privacyLevels (GET /v1/accounts/{id}/posting-options). Defaults to the most public one allowed. |
platformOverrides.bluesky.allowComments | boolean | no | TikTok only. Default true, unless the creator turned comments off. |
platformOverrides.bluesky.allowDuet | boolean | no | TikTok only. Default true, unless the creator turned duets off. |
platformOverrides.bluesky.allowStitch | boolean | no | TikTok only. Default true, unless the creator turned stitches off. |
platformOverrides.bluesky.promotesOwnBrand | boolean | no | TikTok only: the video promotes the creator's own business. |
platformOverrides.bluesky.brandedContent | boolean | no | TikTok only: a paid partnership promoting a third party. Not allowed with SELF_ONLY. |
platformOverrides.mastodon | object | no | |
platformOverrides.mastodon.content | string | no | at least 1 character. |
platformOverrides.mastodon.boardId | string | no | Pinterest only: the board to pin to, instead of the account's default board. at least 1 character; at most 64 characters. |
platformOverrides.mastodon.privacyLevel | "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | no | TikTok only: who sees the video, one of the account's privacyLevels (GET /v1/accounts/{id}/posting-options). Defaults to the most public one allowed. |
platformOverrides.mastodon.allowComments | boolean | no | TikTok only. Default true, unless the creator turned comments off. |
platformOverrides.mastodon.allowDuet | boolean | no | TikTok only. Default true, unless the creator turned duets off. |
platformOverrides.mastodon.allowStitch | boolean | no | TikTok only. Default true, unless the creator turned stitches off. |
platformOverrides.mastodon.promotesOwnBrand | boolean | no | TikTok only: the video promotes the creator's own business. |
platformOverrides.mastodon.brandedContent | boolean | no | TikTok only: a paid partnership promoting a third party. Not allowed with SELF_ONLY. |
platformOverrides.discord | object | no | |
platformOverrides.discord.content | string | no | at least 1 character. |
platformOverrides.discord.boardId | string | no | Pinterest only: the board to pin to, instead of the account's default board. at least 1 character; at most 64 characters. |
platformOverrides.discord.privacyLevel | "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | no | TikTok only: who sees the video, one of the account's privacyLevels (GET /v1/accounts/{id}/posting-options). Defaults to the most public one allowed. |
platformOverrides.discord.allowComments | boolean | no | TikTok only. Default true, unless the creator turned comments off. |
platformOverrides.discord.allowDuet | boolean | no | TikTok only. Default true, unless the creator turned duets off. |
platformOverrides.discord.allowStitch | boolean | no | TikTok only. Default true, unless the creator turned stitches off. |
platformOverrides.discord.promotesOwnBrand | boolean | no | TikTok only: the video promotes the creator's own business. |
platformOverrides.discord.brandedContent | boolean | no | TikTok only: a paid partnership promoting a third party. Not allowed with SELF_ONLY. |
platformOverrides.farcaster | object | no | |
platformOverrides.farcaster.content | string | no | at least 1 character. |
platformOverrides.farcaster.boardId | string | no | Pinterest only: the board to pin to, instead of the account's default board. at least 1 character; at most 64 characters. |
platformOverrides.farcaster.privacyLevel | "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | no | TikTok only: who sees the video, one of the account's privacyLevels (GET /v1/accounts/{id}/posting-options). Defaults to the most public one allowed. |
platformOverrides.farcaster.allowComments | boolean | no | TikTok only. Default true, unless the creator turned comments off. |
platformOverrides.farcaster.allowDuet | boolean | no | TikTok only. Default true, unless the creator turned duets off. |
platformOverrides.farcaster.allowStitch | boolean | no | TikTok only. Default true, unless the creator turned stitches off. |
platformOverrides.farcaster.promotesOwnBrand | boolean | no | TikTok only: the video promotes the creator's own business. |
platformOverrides.farcaster.brandedContent | boolean | no | TikTok only: a paid partnership promoting a third party. Not allowed with SELF_ONLY. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The template. | Template |
| 401 | Missing, unknown, revoked or expired API key. | Error |
| 404 | No such template in this workspace. | Error |
| 422 | The request failed validation. | Error |
| 429 | Too many requests for this credential; wait for retry-after seconds. | Error |
Response body
A 200 answer has the type Template.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
name | string | yes | |
content | string | yes | |
mediaIds | string[] | yes | |
accountIds | string[] | yes | |
platformOverrides | object | yes | |
platformOverrides.x | object | no | |
platformOverrides.x.content | string | no | |
platformOverrides.x.boardId | string | no | |
platformOverrides.instagram | object | no | |
platformOverrides.instagram.content | string | no | |
platformOverrides.instagram.boardId | string | no | |
platformOverrides.facebook | object | no | |
platformOverrides.facebook.content | string | no | |
platformOverrides.facebook.boardId | string | no | |
platformOverrides.threads | object | no | |
platformOverrides.threads.content | string | no | |
platformOverrides.threads.boardId | string | no | |
platformOverrides.linkedin | object | no | |
platformOverrides.linkedin.content | string | no | |
platformOverrides.linkedin.boardId | string | no | |
platformOverrides.tiktok | object | no | |
platformOverrides.tiktok.content | string | no | |
platformOverrides.tiktok.boardId | string | no | |
platformOverrides.youtube | object | no | |
platformOverrides.youtube.content | string | no | |
platformOverrides.youtube.boardId | string | no | |
platformOverrides.pinterest | object | no | |
platformOverrides.pinterest.content | string | no | |
platformOverrides.pinterest.boardId | string | no | |
platformOverrides.bluesky | object | no | |
platformOverrides.bluesky.content | string | no | |
platformOverrides.bluesky.boardId | string | no | |
platformOverrides.mastodon | object | no | |
platformOverrides.mastodon.content | string | no | |
platformOverrides.mastodon.boardId | string | no | |
platformOverrides.discord | object | no | |
platformOverrides.discord.content | string | no | |
platformOverrides.discord.boardId | string | no | |
platformOverrides.farcaster | object | no | |
platformOverrides.farcaster.content | string | no | |
platformOverrides.farcaster.boardId | string | no | |
createdAt | string | yes | |
updatedAt | string | yes |
See also
| Doc | Why |
|---|---|
| API reference | Every endpoint |
| Schemas | Every request and response type |
| Errors | Every error code and what to do about it |