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

Get Template

GET
/api/v1/templates/:template_id
GET
/api/v1/templates/:template_id
$curl https://api.onepin.ai/api/v1/templates/template_id \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json"
1{
2 "data": {
3 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
4 "name": "Social Media Content Planner",
5 "definition": {
6 "graph": {
7 "nodes": [
8 {
9 "id": "1e7f3a2b-4c5d-4f6a-9b7e-123456789abc",
10 "type": "source_script",
11 "position": {
12 "x": 100.5,
13 "y": 200.75
14 },
15 "config": {
16 "script": "fetch_posts.py",
17 "parameters": {
18 "platform": "twitter"
19 }
20 },
21 "config_version": 1
22 }
23 ],
24 "edges": [
25 {
26 "id": "2b7e3f1a-9c8d-4e5f-8a7b-abcdef123456",
27 "source": "1e7f3a2b-4c5d-4f6a-9b7e-123456789abc",
28 "sourcePort": "output",
29 "target": "3c9d4e5f-7a8b-4c6d-9e0f-abcdef654321",
30 "targetPort": "input"
31 }
32 ]
33 },
34 "execution": {
35 "steps": [
36 "1e7f3a2b-4c5d-4f6a-9b7e-123456789abc"
37 ],
38 "params": {
39 "schedule_time": "09:00",
40 "timezone": "UTC"
41 }
42 }
43 },
44 "is_starter": true,
45 "is_public": true,
46 "uses_count": 42,
47 "created_at": "2024-01-15T09:30:00Z",
48 "updated_at": "2024-04-10T14:45:00Z",
49 "description": "A template to plan and schedule social media posts efficiently.",
50 "category": "media",
51 "is_favorite": false,
52 "created_by": "7d9f3a2b-1c2d-4e5f-8a7b-123456789abc"
53 },
54 "meta": {
55 "request_id": "req_9f8e7d6c5b4a3210",
56 "timestamp": "2024-04-27T12:00:00Z"
57 }
58}

Fetch a template by id if visible (own, public, or starter).

Dual-auth: Clerk JWT or op_live_* API key (scope templates:read).

Was this page helpful?
Previous

Delete Template

Next
Built with

Authentication

AuthorizationBearer
Clerk JWT token
OR
AuthorizationBearer

Onepin live API key (op_live_...). Test and public keys are reserved in Phase 1.

Path parameters

template_idstringRequiredformat: "uuid"

Headers

X-Workspace-Idstring or nullOptional

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