Connections

Stored credentials steps use (mailboxes, HTTP auth, chat webhooks, FTP…), tested before saving.

MethodPathSummary
GET/api/connection-typesKinds of connection
GET/api/connections?type=a,b ?flow=<id> → only ones that flow could use
GET/api/connections/:idEditing form: the non-secret fields, and which secrets are set
POST/api/connectionsCreate a connection
PUT/api/connections/:idUpdate a connection
DELETE/api/connections/:idDelete a connection
GET/api/connections/:id/foldersA mailbox connection's folders (for the IMAP trigger's folder pickers), if the flow (?flow=) may use the connection
POST/api/connections/testTest a connection: a saved one (:id, optionally with changed fields) or an unsaved one (body.type + body.data)

#Kinds of connection

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

Response 200

FieldTypeDescription
typesarray of object
types[].typestring
types[].labelstring
types[].iconany
types[].helpany
types[].useany
types[].fieldsarray of any
Example response
JSON
{
  "types": [
    {
      "type": "string",
      "label": "Example label",
      "icon": null,
      "help": null,
      "use": null,
      "fields": []
    }
  ]
}

Example request

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

#?type=a,b ?flow=<id> → only ones that flow could use

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

Query parameters

NameTypeDescription
flownumber
typestring

Response 200

FieldTypeDescription
connectionsarray of object
connections[].can_editboolean
Example response
JSON
{
  "connections": [
    {
      "…credentials.summary(r, u": "…",
      "can_edit": true
    }
  ]
}

Errors

StatusMessage
404Flow not found

Example request

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

#Editing form: the non-secret fields, and which secrets are set

GET/api/connections/:id
Address
https://<your-org>.brambleit.cloud/flows/api/connections/: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
dataarray of any
secrets_setany
used_byany
Example response
JSON
{
  "…credentials.summary(row,": "…",
  "data": [],
  "secrets_set": null,
  "used_by": null
}

Errors

StatusMessage
403Only the owner can edit this connection

Example request

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

#Create a connection

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

Request body JSON

NameTypeDescription
typestringThe kind of connection.
namestringIts name.
scopeanypersonal or tenant.
dataanyIts settings and secrets.

Response 201

Example request

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

#Update a connection

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

Path parameters

NameTypeDescription
idrequiredinteger

Request body JSON

NameTypeDescription
namestring
dataany

Response 200

Errors

StatusMessage
403Only the owner can edit this connection

Example request

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

#Delete a connection

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

Path parameters

NameTypeDescription
idrequiredinteger

Query parameters

NameTypeDescription
forcestring1 to delete it even though flows use it.

Response 200

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

Errors

StatusMessage
403Only the owner can delete this connection
409Used by …. Those steps will stop working.

Example request

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

#A mailbox connection's folders (for the IMAP trigger's folder pickers), if the flow (?flow=) may use the connection

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

Path parameters

NameTypeDescription
idrequiredinteger

Query parameters

NameTypeDescription
flownumber

Response 200

FieldTypeDescription
foldersarray of any
Example response
JSON
{
  "folders": []
}

Errors

StatusMessage
404Flow not found
400Couldn't list the folders: …

Example request

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

#Test a connection: a saved one (:id, optionally with changed fields) or an unsaved one (body.type + body.data)

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

Request body JSON

NameTypeDescription
typestring
idinteger
dataany

Response 200

Example response
JSON
true

Errors

StatusMessage
404Connection not found

Example request

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