Templates

Built-in, organisation and MSP-shared templates, and making a flow from one.

MethodPathSummary
GET/api/templatesList templates
POST/api/templatesSave a flow as a template
DELETE/api/templates/:idDelete a template
POST/api/templates/useCreate a flow from a template

#List templates

GET/api/templates
Address
https://<your-org>.brambleit.cloud/flows/api/templates
Requires
Signed-in browser session (the sso_session / session_id cookies from Bramble sign-in).
Licence: Flows.

Response 200

Example request

JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/flows/api/templates', {
  method: 'GET',
  credentials: 'include',
});
const data = await res.json();

#Save a flow as a template

POST/api/templates
Address
https://<your-org>.brambleit.cloud/flows/api/templates
Requires
Signed-in browser session (the sso_session / session_id cookies from Bramble sign-in).
Licence: Flows.

Request body JSON

NameTypeDescription
namestring
descriptionstring
categoryany
shareany
flow_idinteger

Response 200

FieldTypeDescription
idinteger
Example response
JSON
{
  "id": 42
}

Example request

JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/flows/api/templates', {
  method: 'POST',
  credentials: 'include',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({"name":"Example name","description":"string","category":"…","share":"…","flow_id":7}),
});
const data = await res.json();

#Delete a template

DELETE/api/templates/:id
Address
https://<your-org>.brambleit.cloud/flows/api/templates/:id
Requires
Signed-in browser session (the sso_session / session_id cookies from Bramble sign-in).
Licence: Flows.

Path parameters

NameTypeDescription
idrequiredinteger

Response 200

FieldTypeDescription
okboolean
Example response
JSON
{
  "ok": true
}

Example request

JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/flows/api/templates/42', {
  method: 'DELETE',
  credentials: 'include',
});
const data = await res.json();

#Create a flow from a template

POST/api/templates/use
Address
https://<your-org>.brambleit.cloud/flows/api/templates/use
Requires
Signed-in browser session (the sso_session / session_id cookies from Bramble sign-in).
Licence: Flows.

Request body JSON

NameTypeDescription
scopestring
sourceany
idinteger
namestring

Response 200

FieldTypeDescription
idinteger
warningsarray of any
Example response
JSON
{
  "id": 42,
  "warnings": []
}

Errors

StatusMessage
403Only Flows admins can make organisation flows

Example request

JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/flows/api/templates/use', {
  method: 'POST',
  credentials: 'include',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({"scope":"string","source":"…","id":42,"name":"Example name"}),
});
const data = await res.json();