Start free
Docs · Snippets

API reference

Snippets

Read as Markdown

On this page
  1. List snippets
  2. Save a snippet
  3. Edit a snippet
  4. Delete a snippet

Base URL https://api.beplan.io/v1. Authentication, envelopes, pagination, idempotency and rate limits: conventions. OpenAPI document: openapi.json.

All 4 Snippets operations

List snippets

GET /organizations/{organizationId}/workspaces/{workspaceId}/snippets
Beta Reads only snippets.list
Scope
organization:read
Role permission
Any of: Create posts (post:create), Edit posts (post:update)
Effect
Changes nothing.
Stability
Beta. May still change before it is marked stable. Since 2026-11-20.

Lists the workspace's snippets, newest first: reusable pieces of text (a signature, a call to action, a set of hashtags) each saved for one editor input (field: title, caption, hashtags or a platform option's key) and some or all platforms. Use one by copying its content into a post's matching field. Needs a role that creates or edits posts in the workspace. Not paginated (a workspace keeps a few dozen).

Parameters

Name In Type Description
organizationId required path string 1–128 characters
workspaceId required path string (uuid)

Responses

200 OK

object · ListSnippetsResponse

  • dataarray of objectrequired
    6fields in each item
    • idstringrequired
      The snippet's id (a UUID).
    • namestringrequired
    • fieldstringrequired
      The editor input it belongs to: title, caption, hashtags or a platform option's key.
    • contentstringrequired
      The text inserted, as saved.
    • platformsarray of stringrequired
      Platforms it is offered for (instagram, x…); empty: every platform.
    • createdAtstring (date-time)required
      When it was saved, ISO 8601 UTC.

Errors answer { error: { code, message, details, requestId } } with status 400, 401, 403, 404, 429, 500.

Error codes

Status Code Message
403 MISSING_PERMISSION You don't have permission to do this.
404 ORGANIZATION_NOT_FOUND This organization doesn't exist or you're not a member of it.
404 WORKSPACE_NOT_FOUND This workspace doesn't exist or you don't have access to it.
10 more that every operation can answer (tokens, scopes, limits)
400 VALIDATION_FAILED Some of the information sent is invalid.
401 APP_SUSPENDED This app has been suspended by Beplan and can't access your account.
401 TOKEN_EXPIRED This token has expired. Create a new one or sign in again.
401 TOKEN_REVOKED This token was revoked. Connect again to get a new one.
401 UNAUTHENTICATED Your session has expired. Please sign in again.
403 INSUFFICIENT_SCOPE This token doesn't have the access this needs. Connect again and allow it.
403 INTEGRATION_BLOCKED_BY_ORGANIZATION This organization doesn't allow this integration. Ask an admin of the organization.
403 INTEGRATION_PENDING_APPROVAL An admin of this organization needs to approve this connection first.
429 RATE_LIMITED Too many requests. Wait a moment and try again.
500 INTERNAL_ERROR Something went wrong on our side. Please try again.

Example

One caption snippet

curl
curl -X GET "https://api.beplan.io/v1/organizations/Yx0k2N7mQf3bA9cRz1LwP/workspaces/3f6c2a8e-91b4-4d7e-a2c5-7e0b9d1f4a62/snippets" \
  -H "Authorization: Bearer beplan_pat_…"
TypeScript
const response = await fetch("https://api.beplan.io/v1/organizations/Yx0k2N7mQf3bA9cRz1LwP/workspaces/3f6c2a8e-91b4-4d7e-a2c5-7e0b9d1f4a62/snippets", {
  method: "GET",
  headers: {
    Authorization: "Bearer beplan_pat_…",
  },
});
if (!response.ok) throw new Error((await response.json()).error.code);
const { data } = await response.json();
Python
import requests

response = requests.get(
    "https://api.beplan.io/v1/organizations/Yx0k2N7mQf3bA9cRz1LwP/workspaces/3f6c2a8e-91b4-4d7e-a2c5-7e0b9d1f4a62/snippets",
    headers={"Authorization": "Bearer beplan_pat_…"},
)
response.raise_for_status()
data = response.json()["data"]
Response 200
{
  "data": [
    {
      "id": "8e3b1f6a-2c7d-4a9e-b5f0-1d6c3a8e7b24",
      "name": "Signature",
      "field": "caption",
      "content": "Posted with Beplan",
      "platforms": [],
      "createdAt": "2026-11-18T09:30:00.000Z"
    }
  ]
}

Save a snippet

POST /organizations/{organizationId}/workspaces/{workspaceId}/snippets
Beta Changes data snippets.create
Scope
workspaces:write
Role permission
Any of: Create posts (post:create), Edit posts (post:update)
Effect
Changes data in Beplan.
Idempotency
Send an Idempotency-Key to retry safely: the same key with the same body within 24 hours returns the stored response.
Stability
Beta. May still change before it is marked stable. Since 2026-11-19.

Saves a reusable piece of text in the workspace, for one editor input (title, caption, hashtags, or a platform option's key) and some or all platforms. Anyone who can create or edit posts in the workspace can save one. Answers 201 with the snippet.

Parameters

Name In Type Description
organizationId required path string 1–128 characters
workspaceId required path string (uuid)

Request body JSON, required

object · CreateSnippetBody

  • namestringrequired
    1–255 characters
  • fieldstringrequired
    The editor input the snippet is offered in: title, caption or hashtags, or the key of a platform option (youtube_tags, tiktok_firstComment…: the keys of a post's additionalParams). Fixed once saved.
    1–120 characters · matches ^[A-Za-z][A-Za-z0-9_.]*$
  • contentstringrequired
    1–63206 characters
  • platformsarray of stringoptional
    One of: x, instagram, facebook, tiktok, linkedin, threads, pinterest, youtube, discord, bluesky
    at most 10 items

Responses

201 Created

object · CreateSnippetResponse

  • dataobject · Snippetrequired
    6fields
    • idstringrequired
      The snippet's id (a UUID).
    • namestringrequired
    • fieldstringrequired
      The editor input it belongs to: title, caption, hashtags or a platform option's key.
    • contentstringrequired
      The text inserted, as saved.
    • platformsarray of stringrequired
      Platforms it is offered for (instagram, x…); empty: every platform.
    • createdAtstring (date-time)required
      When it was saved, ISO 8601 UTC.

Errors answer { error: { code, message, details, requestId } } with status 400, 401, 403, 404, 409, 413, 415, 429, 500.

Error codes

Status Code Message
400 VALIDATION_FAILED Some of the information sent is invalid.
403 MISSING_PERMISSION You don't have permission to do this.
404 ORGANIZATION_NOT_FOUND This organization doesn't exist or you're not a member of it.
404 WORKSPACE_NOT_FOUND This workspace doesn't exist or you don't have access to it.
13 more that every operation can answer (tokens, scopes, limits)
401 APP_SUSPENDED This app has been suspended by Beplan and can't access your account.
401 TOKEN_EXPIRED This token has expired. Create a new one or sign in again.
401 TOKEN_REVOKED This token was revoked. Connect again to get a new one.
401 UNAUTHENTICATED Your session has expired. Please sign in again.
403 INSUFFICIENT_SCOPE This token doesn't have the access this needs. Connect again and allow it.
403 INTEGRATION_BLOCKED_BY_ORGANIZATION This organization doesn't allow this integration. Ask an admin of the organization.
403 INTEGRATION_PENDING_APPROVAL An admin of this organization needs to approve this connection first.
409 CONFLICT This changed in the meantime. Refresh and try again.
409 IDEMPOTENCY_KEY_REUSED This Idempotency-Key was already used for a different request. Send a new key.
413 PAYLOAD_TOO_LARGE This request is too large to be sent with an Idempotency-Key. Send a smaller body or no key.
415 UNSUPPORTED_MEDIA_TYPE This API reads JSON bodies only. Send the body as JSON with `Content-Type: application/json`.
429 RATE_LIMITED Too many requests. Wait a moment and try again.
500 INTERNAL_ERROR Something went wrong on our side. Please try again.

Example

A caption signature for every platform

curl
curl -X POST "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/snippets" \
  -H "Authorization: Bearer beplan_pat_…" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Signature",
  "field": "caption",
  "content": "Posted with Beplan"
}'
TypeScript
const response = await fetch("https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/snippets", {
  method: "POST",
  headers: {
    Authorization: "Bearer beplan_pat_…",
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "Signature",
    "field": "caption",
    "content": "Posted with Beplan"
  }),
});
if (!response.ok) throw new Error((await response.json()).error.code);
const { data } = await response.json();
Python
import uuid

import requests

response = requests.post(
    "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/snippets",
    headers={"Authorization": "Bearer beplan_pat_…", "Idempotency-Key": str(uuid.uuid4())},
    json={
        "name": "Signature",
        "field": "caption",
        "content": "Posted with Beplan",
    },
)
response.raise_for_status()
data = response.json()["data"]
Response 201
{
  "data": {
    "id": "8e3b1f6a-2c7d-4a9e-b5f0-1d6c3a8e7b24",
    "name": "Signature",
    "field": "caption",
    "content": "Posted with Beplan",
    "platforms": [],
    "createdAt": "2026-11-18T09:30:00.000Z"
  }
}

Edit a snippet

PATCH /organizations/{organizationId}/workspaces/{workspaceId}/snippets/{snippetId}
Beta Changes data snippets.update
Scope
workspaces:write
Role permission
Any of: Create posts (post:create), Edit posts (post:update)
Effect
Changes data in Beplan.
Stability
Beta. May still change before it is marked stable. Since 2026-11-20.

Renames a snippet or changes its text or platforms; send at least one of name, content, platforms (platforms replaces the list, [] means every platform). The input it belongs to (field) can't change: save a new snippet instead. Ids come from GET …/snippets. Answers with the snippet.

Parameters

Name In Type Description
organizationId required path string 1–128 characters
workspaceId required path string (uuid)
snippetId required path string (uuid)

Request body JSON, required

object · UpdateSnippetBody

  • namestringoptional
    1–255 characters
  • contentstringoptional
    1–63206 characters
  • platformsarray of stringoptional
    One of: x, instagram, facebook, tiktok, linkedin, threads, pinterest, youtube, discord, bluesky
    at most 10 items

Responses

200 OK

object · UpdateSnippetResponse

  • dataobject · Snippetrequired
    6fields
    • idstringrequired
      The snippet's id (a UUID).
    • namestringrequired
    • fieldstringrequired
      The editor input it belongs to: title, caption, hashtags or a platform option's key.
    • contentstringrequired
      The text inserted, as saved.
    • platformsarray of stringrequired
      Platforms it is offered for (instagram, x…); empty: every platform.
    • createdAtstring (date-time)required
      When it was saved, ISO 8601 UTC.

Errors answer { error: { code, message, details, requestId } } with status 400, 401, 403, 404, 413, 415, 429, 500.

Error codes

Status Code Message
400 VALIDATION_FAILED Some of the information sent is invalid.
403 MISSING_PERMISSION You don't have permission to do this.
404 ORGANIZATION_NOT_FOUND This organization doesn't exist or you're not a member of it.
404 SNIPPET_NOT_FOUND This snippet doesn't exist in this workspace.
404 WORKSPACE_NOT_FOUND This workspace doesn't exist or you don't have access to it.
11 more that every operation can answer (tokens, scopes, limits)
401 APP_SUSPENDED This app has been suspended by Beplan and can't access your account.
401 TOKEN_EXPIRED This token has expired. Create a new one or sign in again.
401 TOKEN_REVOKED This token was revoked. Connect again to get a new one.
401 UNAUTHENTICATED Your session has expired. Please sign in again.
403 INSUFFICIENT_SCOPE This token doesn't have the access this needs. Connect again and allow it.
403 INTEGRATION_BLOCKED_BY_ORGANIZATION This organization doesn't allow this integration. Ask an admin of the organization.
403 INTEGRATION_PENDING_APPROVAL An admin of this organization needs to approve this connection first.
413 PAYLOAD_TOO_LARGE This request is too large to be sent with an Idempotency-Key. Send a smaller body or no key.
415 UNSUPPORTED_MEDIA_TYPE This API reads JSON bodies only. Send the body as JSON with `Content-Type: application/json`.
429 RATE_LIMITED Too many requests. Wait a moment and try again.
500 INTERNAL_ERROR Something went wrong on our side. Please try again.

Example

New text, Instagram and TikTok only

curl
curl -X PATCH "https://api.beplan.io/v1/organizations/Yx0k2N7mQf3bA9cRz1LwP/workspaces/3f6c2a8e-91b4-4d7e-a2c5-7e0b9d1f4a62/snippets/8e3b1f6a-2c7d-4a9e-b5f0-1d6c3a8e7b24" \
  -H "Authorization: Bearer beplan_pat_…" \
  -H "Content-Type: application/json" \
  -d '{
  "content": "Made with Beplan",
  "platforms": [
    "instagram",
    "tiktok"
  ]
}'
TypeScript
const response = await fetch("https://api.beplan.io/v1/organizations/Yx0k2N7mQf3bA9cRz1LwP/workspaces/3f6c2a8e-91b4-4d7e-a2c5-7e0b9d1f4a62/snippets/8e3b1f6a-2c7d-4a9e-b5f0-1d6c3a8e7b24", {
  method: "PATCH",
  headers: {
    Authorization: "Bearer beplan_pat_…",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "content": "Made with Beplan",
    "platforms": [
      "instagram",
      "tiktok"
    ]
  }),
});
if (!response.ok) throw new Error((await response.json()).error.code);
const { data } = await response.json();
Python
import requests

response = requests.patch(
    "https://api.beplan.io/v1/organizations/Yx0k2N7mQf3bA9cRz1LwP/workspaces/3f6c2a8e-91b4-4d7e-a2c5-7e0b9d1f4a62/snippets/8e3b1f6a-2c7d-4a9e-b5f0-1d6c3a8e7b24",
    headers={"Authorization": "Bearer beplan_pat_…"},
    json={
        "content": "Made with Beplan",
        "platforms": [
            "instagram",
            "tiktok",
        ],
    },
)
response.raise_for_status()
data = response.json()["data"]
Response 200
{
  "data": {
    "id": "8e3b1f6a-2c7d-4a9e-b5f0-1d6c3a8e7b24",
    "name": "Signature",
    "field": "caption",
    "content": "Made with Beplan",
    "platforms": [
      "instagram",
      "tiktok"
    ],
    "createdAt": "2026-11-18T09:30:00.000Z"
  }
}

Delete a snippet

DELETE /organizations/{organizationId}/workspaces/{workspaceId}/snippets/{snippetId}
Beta Deletes snippets.delete
Scope
workspaces:write
Role permission
Any of: Create posts (post:create), Edit posts (post:update)
Effect
Deletes data or cannot be undone.
Stability
Beta. May still change before it is marked stable. Since 2026-11-20.

Deletes a snippet for good. Posts that already used its text keep it (a snippet is copied, not linked). Answers 204 with no body.

Parameters

Name In Type Description
organizationId required path string 1–128 characters
workspaceId required path string (uuid)
snippetId required path string (uuid)

Responses

204 No content

No content.

Errors answer { error: { code, message, details, requestId } } with status 400, 401, 403, 404, 429, 500.

Error codes

Status Code Message
403 MISSING_PERMISSION You don't have permission to do this.
404 ORGANIZATION_NOT_FOUND This organization doesn't exist or you're not a member of it.
404 SNIPPET_NOT_FOUND This snippet doesn't exist in this workspace.
404 WORKSPACE_NOT_FOUND This workspace doesn't exist or you don't have access to it.
10 more that every operation can answer (tokens, scopes, limits)
400 VALIDATION_FAILED Some of the information sent is invalid.
401 APP_SUSPENDED This app has been suspended by Beplan and can't access your account.
401 TOKEN_EXPIRED This token has expired. Create a new one or sign in again.
401 TOKEN_REVOKED This token was revoked. Connect again to get a new one.
401 UNAUTHENTICATED Your session has expired. Please sign in again.
403 INSUFFICIENT_SCOPE This token doesn't have the access this needs. Connect again and allow it.
403 INTEGRATION_BLOCKED_BY_ORGANIZATION This organization doesn't allow this integration. Ask an admin of the organization.
403 INTEGRATION_PENDING_APPROVAL An admin of this organization needs to approve this connection first.
429 RATE_LIMITED Too many requests. Wait a moment and try again.
500 INTERNAL_ERROR Something went wrong on our side. Please try again.

Example

Delete one

curl
curl -X DELETE "https://api.beplan.io/v1/organizations/Yx0k2N7mQf3bA9cRz1LwP/workspaces/3f6c2a8e-91b4-4d7e-a2c5-7e0b9d1f4a62/snippets/8e3b1f6a-2c7d-4a9e-b5f0-1d6c3a8e7b24" \
  -H "Authorization: Bearer beplan_pat_…"
TypeScript
const response = await fetch("https://api.beplan.io/v1/organizations/Yx0k2N7mQf3bA9cRz1LwP/workspaces/3f6c2a8e-91b4-4d7e-a2c5-7e0b9d1f4a62/snippets/8e3b1f6a-2c7d-4a9e-b5f0-1d6c3a8e7b24", {
  method: "DELETE",
  headers: {
    Authorization: "Bearer beplan_pat_…",
  },
});
if (!response.ok) throw new Error((await response.json()).error.code);
Python
import requests

response = requests.delete(
    "https://api.beplan.io/v1/organizations/Yx0k2N7mQf3bA9cRz1LwP/workspaces/3f6c2a8e-91b4-4d7e-a2c5-7e0b9d1f4a62/snippets/8e3b1f6a-2c7d-4a9e-b5f0-1d6c3a8e7b24",
    headers={"Authorization": "Bearer beplan_pat_…"},
)
response.raise_for_status()

Answers 204 with no content.