Stencil Documentation
  • General
  • API
    • Authentication
    • Pagination
    • Status Code and Throttling
    • Endpoints
      • Account
      • Projects
      • Templates
      • Images
      • Collections
      • PDFs
      • Airtable
      • Editor Session
  • Using Stencil
    • Template Editor
    • Template Editor (Legacy)
      • Charts
      • Limited Markdown Supports
      • Anchoring Element
      • Using Custom Font
      • Circular Text Positioning
    • White Label for Business
      • Setting Up Your First Client
      • DNS Setup with Cloudflare
  • Guides
    • Airtable Integration
      • Basic
    • Integromat Integration
      • Connection
      • Instant Trigger
    • Zapier Integration
      • Authentication
      • Trigger - New Image
      • Action - Create Image
    • Secure Signed Image
      • Basic
    • Query String Integration
      • Basic
      • Cache
    • Forms Integration
    • Case Studies
      • Generate Instagram Post from WooCommerce
      • Generate Open Graph Image for WordPress
      • Generate Personalized SendGrid Email Campaigns
      • Sending Charts to Twitter
      • Generate Instagram Post from Shopify
      • Automating Webflow Open Graph Image
      • Generate certificate of accomplishment
      • Automate Candidate's Certificate Generation
  • LINKS
    • Back to Stencil
    • Got bug?
    • Need feature?
    • Blog
Powered by GitBook
On this page
  • Create a new session
  • Request Body
  • Get a session
  • Response body

Was this helpful?

  1. API
  2. Endpoints

Editor Session

Create a shareable link for editing template without logging in.

Create a new session

POST https://api.usestencil.com/v1/editor/sessions

Request Body

Name
Type
Description

name

Required

string

Name of the session

expires

Required

integer

Time till expire. In seconds.

template_id

Required

uuid

The template to give access to

permissions

Optional

object

Permission object

Name
Type
Description

layers

Required

object

layer object

Layer object

Name
Type
Description

actions

Optional

array of string

Set the default actions for all layers. Value can be combination of "create", "edit", and "delete"

fields

Optional

array of field object

Override default action for specific layer. See field object.

Field object

Name
Type
Description

name

Required

string

Name of the layer

actions

Required

array of string

Value can be combination of "create", "edit", and "delete"

Permission actions

Action can be combination of "create", "edit", and "delete" .

Action
Effect

create

When specified, user can create a new layer or duplicate an existing layer.

edit

When specified, user is allowed to make changes to the layer.

delete

When specified, user is allowed to delete the layer.

When you override the field, the permission set by the default permission is ignored.

Request body examples

{
    "name": "Session 1",
    "template_id": "<template_id>",
    "expires": 60000
}
{
    "name": "Session 1",
    "template_id": "<template_id>",
    "expires": 60000,
    "permissions": {
        "layers" {
            "actions": ["edit"],
            "fields": [
                {
                    "name": "image",
                    "actions": ["edit", "delete"]
                },
                {
                    "name": "description_text",
                    "actions": ["edit"]
                }               
            ]
        }
    }
}

Get a session

GET https://api.usestencil.com/v1/editor/sessions/:session_id

Response body

{
  "permissions": null,
  "token": "QFhV6HN7hv3nqPcnGhp2xo",
  "session_id": "daf35835-fd26-4503-8027-1bb59417be91",
  "expired_at": "2025-05-18T03:31:34Z",
  "session_url": "http://app.usestencil.com/editor/templates/f636ffa7-8761-4877-960b-cf5b97a41c6b/sessions/daf35835-fd26-4503-8027-1bb59417be91?token=QFhV6HN7hv3nqPcnGhp2xo"
}
{
  "permissions": {
    "layers": {
      "fields": [
        {
          "name": "field",
          "actions": [
            "create",
            "edit"
          ]
        }
      ],
      "actions": [
        "create",
        "edit",
        "delete"
      ]
    }
  },
  "token": "QFhV6HN7hv3nqPcnGhp2xo",
  "session_id": "daf35835-fd26-4503-8027-1bb59417be91",
  "expired_at": "2025-05-18T03:31:34Z",
  "session_url": "http://app.usestencil.com/editor/templates/f636ffa7-8761-4877-960b-cf5b97a41c6b/sessions/daf35835-fd26-4503-8027-1bb59417be91?token=QFhV6HN7hv3nqPcnGhp2xo"
}
PreviousAirtableNextTemplate Editor

Last updated 15 days ago

Was this helpful?

See permission object,

Permission object