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

See permission object, Permission 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
}

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"
}

Last updated

Was this helpful?