Documents

Documents and procedures with full version history. Library documents can be copied into an organisation.

MethodPathSummary
GET/api/documentsLibrary documents
GET/api/documents/:idGet a document
POST/api/documentsAdd a library document
PUT/api/documents/:idSave a document
DELETE/api/documents/:idArchive a document
GET/api/documents/:id/versionsA document's versions
GET/api/documents/:id/versions/:vidGet a document version
POST/api/documents/:id/versions/:vid/restoreRestore a document version
POST/api/documents/:id/copyCopy a library document (e.g

#Library documents

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

Response 200

FieldTypeDescription
documentsarray of any
Example response
JSON
{
  "documents": []
}

Example request

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

#Get a document

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

Path parameters

NameTypeDescription
idrequiredinteger

Response 200

FieldTypeDescription
documentany
versionsinteger
Example response
JSON
{
  "document": null,
  "versions": 1
}

Example request

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

#Add a library document

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

Example request

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

#Save a document

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

Path parameters

NameTypeDescription
idrequiredinteger

Request body JSON

NameTypeDescription
base_updated_atstring (date-time)The updated_at you started editing from. If it has changed, you get 409.

Response 200

FieldTypeDescription
okboolean
updated_atstring (date-time)
Example response
JSON
{
  "ok": true,
  "updated_at": "2026-11-12T09:30:00.000Z"
}

Example request

JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/atlas/api/documents/42', {
  method: 'PUT',
  credentials: 'include',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({"base_updated_at":"2026-11-12T09:30:00.000Z"}),
});
const data = await res.json();

#Archive a document

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

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('/atlas/api/documents/42', {
  method: 'DELETE',
  credentials: 'include',
});
const data = await res.json();

#A document's versions

GET/api/documents/:id/versions
Address
https://<your-org>.brambleit.cloud/atlas/api/documents/:id/versions
Requires
Signed-in browser session (the sso_session / session_id cookies from Bramble sign-in).
Licence: Atlas.

Path parameters

NameTypeDescription
idrequiredinteger

Response 200

FieldTypeDescription
versionsarray of object
versions[].idinteger, or null
versions[].titlestring
versions[].saved_namestring, or null
versions[].saved_atstring (date-time), or null
Example response
JSON
{
  "versions": [
    {
      "id": 42,
      "title": "Example title",
      "saved_name": "Example saved name",
      "saved_at": "2026-11-12T09:30:00.000Z"
    }
  ]
}

Example request

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

#Get a document version

GET/api/documents/:id/versions/:vid
Address
https://<your-org>.brambleit.cloud/atlas/api/documents/:id/versions/:vid
Requires
Signed-in browser session (the sso_session / session_id cookies from Bramble sign-in).
Licence: Atlas.

Path parameters

NameTypeDescription
idrequiredinteger
vidrequiredinteger

Response 200

FieldTypeDescription
versionobject
version.idinteger, or null
version.document_idinteger
version.titlestring
version.bodystring, or null
version.saved_byinteger, or null
version.saved_namestring, or null
version.saved_atstring (date-time), or null
Example response
JSON
{
  "version": {
    "id": 42,
    "document_id": 7,
    "title": "Example title",
    "body": "<p>…</p>",
    "saved_by": 1,
    "saved_name": "Example saved name",
    "saved_at": "2026-11-12T09:30:00.000Z"
  }
}

Errors

StatusMessage
404Version not found

Example request

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

#Restore a document version

POST/api/documents/:id/versions/:vid/restore
Address
https://<your-org>.brambleit.cloud/atlas/api/documents/:id/versions/:vid/restore
Requires
Signed-in browser session (the sso_session / session_id cookies from Bramble sign-in).
Licence: Atlas.

Path parameters

NameTypeDescription
idrequiredinteger
vidrequiredinteger

Response 200

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

Errors

StatusMessage
404Version not found

Example request

JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/atlas/api/documents/42/versions/1/restore', {
  method: 'POST',
  credentials: 'include',
});
const data = await res.json();

#Copy a library document (e.g

POST/api/documents/:id/copy

Copy a library document (e.g. an SOP template) into an organisation.

Address
https://<your-org>.brambleit.cloud/atlas/api/documents/:id/copy
Requires
Signed-in browser session (the sso_session / session_id cookies from Bramble sign-in).
Licence: Atlas.

Path parameters

NameTypeDescription
idrequiredinteger

Request body JSON

NameTypeDescription
organy

Response 200

FieldTypeDescription
documentobject
document.idinteger
Example response
JSON
{
  "document": {
    "id": 42
  }
}

Example request

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