For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Get Started
    • Introduction
    • Quickstart
    • Authentication
  • API Reference
      • GETList Templates
      • POSTCreate Template
      • GETGet Template
      • DELDelete Template
      • PATCHUpdate Template
      • POSTClone Template
      • POSTFavorite Template
      • DELUnfavorite Template
  • Python SDK
    • Install
    • Usage
    • Errors
  • CLI
    • Overview
LogoLogo
API Referencetemplates

Favorite Template

POST
/api/v1/templates/:template_id/favorite
POST
/api/v1/templates/:template_id/favorite
$curl -X POST https://api.onepin.ai/api/v1/templates/template_id/favorite \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{}'
1{
2 "data": {
3 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
4 "name": "Social Media Post Template",
5 "definition": {
6 "graph": {
7 "nodes": [
8 {
9 "id": "1c9d4f2a-8b3e-4f7a-9f2d-3a2b1c4d5e6f",
10 "type": "source_script",
11 "position": {
12 "x": 100.5,
13 "y": 200.75
14 },
15 "config": {
16 "scriptLanguage": "javascript",
17 "scriptContent": "return input.text.toUpperCase();"
18 },
19 "config_version": 1
20 }
21 ],
22 "edges": [
23 {
24 "id": "2b7e4d3c-9a1f-4e6b-8c2d-7f3a1b5c6d7e",
25 "source": "1c9d4f2a-8b3e-4f7a-9f2d-3a2b1c4d5e6f",
26 "sourcePort": "output",
27 "target": "3d8f5e6a-7b2c-4d9f-8a1e-5c3b7d9f0a2b",
28 "targetPort": "input"
29 }
30 ]
31 },
32 "execution": {
33 "steps": [
34 "1c9d4f2a-8b3e-4f7a-9f2d-3a2b1c4d5e6f"
35 ],
36 "params": {
37 "maxLength": 280,
38 "hashtags": [
39 "#marketing",
40 "#socialmedia"
41 ]
42 }
43 }
44 },
45 "is_starter": true,
46 "is_public": true,
47 "uses_count": 152,
48 "created_at": "2024-01-15T09:30:00Z",
49 "updated_at": "2024-04-10T14:45:00Z",
50 "description": "A template designed for creating engaging social media posts quickly.",
51 "category": "media",
52 "is_favorite": true,
53 "created_by": "7e57d004-2b97-0e7a-b45f-5387367791cd"
54 },
55 "meta": {
56 "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
57 "timestamp": "2024-04-27T12:00:00Z"
58 }
59}
Mark a visible template as a favorite for the current user. Authenticated but not workspace-scoped — favorites are cross-workspace by design for public/starter templates and for the caller's own private templates when they still belong to that template's workspace. Returns 404 when the template does not exist or is not visible to the caller. This POST intentionally enumerates success/failure for the toggle UX, while DELETE stays non-enumerating.
Was this page helpful?
Previous

Unfavorite Template

Next
Built with

Mark a visible template as a favorite for the current user.

Authenticated but not workspace-scoped — favorites are cross-workspace by design for public/starter templates and for the caller’s own private templates when they still belong to that template’s workspace.

Returns 404 when the template does not exist or is not visible to the caller. This POST intentionally enumerates success/failure for the toggle UX, while DELETE stays non-enumerating.

Authentication

AuthorizationBearer
Clerk JWT token

Path parameters

template_idstringRequiredformat: "uuid"

Response

Successful Response
dataobject

Response shape. workspace_id is intentionally omitted so the gallery endpoint (which returns rows from any workspace) does not leak tenant ownership IDs across tenants. created_by is retained as author provenance for public/starter rows.

definition is the serialized WorkflowDefinition JSONB (same shape as Workflow.definition) — a template is a reusable workflow snapshot.

metaobject

Errors

422
Unprocessable Entity Error