DocPouch (1.7.1)

Download OpenAPI specification:

A light-weight, document-based database including user-management. DocPouch is meant for tests, development or internal applications, where security is not a major factor. The database is file and text based and therefore also not layed out for high performance. Instead the main focus of DocPouch is simplicity and a small footprint.

administration

User management endpoints

Authenticate a user

Request Body schema: application/json
required

User credentials for authentication

name
required
string

User name for authentication

password
required
string

Password is used as main authentication element

Responses

Request samples

Content type
application/json
{
  • "name": "Darth Vader",
  • "password": "darths-secret"
}

Response samples

Content type
application/json
{
  • "token": "string",
  • "isAdmin": true,
  • "userName": "string"
}

List user information

Get all user information as admin or your user information as user

Authorizations:
userAuthadminAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update user

Update any user (as admin) or your own user applying the provided attributes

Authorizations:
userAuthadminAuth
path Parameters
userID
required
string

Unique user ID

Request Body schema: application/json
required

Data object containing only the attributes to be updated

name
string

User names can be changed at any time and are not necessarily unique. Users are uniquely identified based on their id.

password
string

Password is used as main authentication element

email
string

User email address

isAdmin
boolean

Flag indicating if the user has administrator privileges

department
string

The department the user is part of

group
string

The group the user is part of

Responses

Request samples

Content type
application/json
{
  • "name": "Darth Vader",
  • "password": "darths-secret",
  • "email": "darth@gmail.com",
  • "isAdmin": false,
  • "department": "Administration",
  • "group": "The Magentas"
}

Create a new user

Authorizations:
adminAuth
Request Body schema: application/json
required

JSON body with all information to create a new user

name
required
string

User names can be changed at any time and are not necessarily unique. Users are uniquely identified based on their id.

password
required
string

Password is used as main authentication element

email
string

User email address

department
required
string

The department the user is part of

group
required
string

The group the user is part of

isAdmin
required
boolean

Flag indicating if the user has administrator privileges

Responses

Request samples

Content type
application/json
{
  • "name": "Darth Vader",
  • "password": "darths-secret",
  • "email": "darth@gmail.com",
  • "department": "Administration",
  • "group": "The Magentas",
  • "isAdmin": false
}

Response samples

Content type
application/json
{
  • "_id": "p3O5LB4T6C4PgkvW",
  • "name": "admin",
  • "email": "admin@example.com",
  • "department": "administration",
  • "group": "auto-created",
  • "isAdmin": true
}

Remove a user and all its documents

Authorizations:
adminAuth
path Parameters
userID
required
string

Unique user ID

Responses

Check for application updates

Check if a newer version of the application is available.

Responses

Response samples

Content type
application/json
{
  • "hasUpdate": true,
  • "currentVersion": "string",
  • "latestVersion": "string"
}

Export the database

Export full data as ZIP/JSON or export a single collection as JSON. Only available to administrators.

Authorizations:
adminAuth
query Parameters
scope
string
Default: "all"
Enum: "all" "users" "documents" "structures"

Which data scope to export

format
string
Default: "zip"
Enum: "zip" "json"

Export format. ZIP is only supported for scope=all.

Responses

Response samples

Content type
No sample

Import the database

Import data from JSON (full or scoped) or ZIP (full only). Only available to administrators.

Authorizations:
adminAuth
Request Body schema: multipart/form-data
required
file
string <binary>

JSON file (scoped or full) or ZIP file (full import)

scope
string
Default: "all"
Enum: "all" "users" "documents" "structures"

Import target scope. ZIP supports only scope=all.

mode
string
Default: "replace"
Enum: "replace" "add" "skip"

Import mode: replace (overwrite same _id), add (new _id for same _id), skip (ignore same _id)

Responses

documents

Document management endpoints

Create a new document

Authorizations:
userAuthadminAuth
Request Body schema: application/json
required

JSON body with all the information to create a new document

title
required
string

The title of the document

description
string

The description of the document

type
required
integer

Type of document - can be used by user for document organization

subType
required
integer

Sub-type of document - can be used by user for document organization

required
Array of objects

The content of the document as an array of field objects

shareWithGroup
required
boolean

If true, the document is shared with all users in the owner's group

shareWithDepartment
required
boolean

If true, the document is shared with all users in the owner's department

public
required
boolean

If true, the document can be read by everybody

Responses

Request samples

Content type
application/json
{
  • "title": "Mission Statement",
  • "description": "A brief description of the document",
  • "type": 17,
  • "subType": 11,
  • "content": [
    ],
  • "shareWithGroup": false,
  • "shareWithDepartment": false,
  • "public": false
}

Response samples

Content type
application/json
{
  • "_id": "3ufDC0Rh5g7arSC9",
  • "owner": "p3O5LB4T6C4PgkvW",
  • "title": "Mission Statement",
  • "description": "A brief description of the document",
  • "type": 17,
  • "subType": 11,
  • "content": [
    ],
  • "shareWithGroup": false,
  • "shareWithDepartment": false,
  • "public": false
}

List documents

List all documents readable by the user. This includes documents owned by the user, shared with the user's group or department, or marked as public. For administrators, all documents are listed.

Authorizations:
userAuthadminAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a document based on a query object.

Fetch documents matching the query criteria that the user has access to. This includes own documents, documents shared with group/department, or public documents. Administrators can fetch any document.

Authorizations:
userAuthadminAuth
Request Body schema: application/json
required

An object describing the query to fetch the documents.

_id
string

Unique ID of document. Only used for queries and deletions

owner
string

The _id of the user who owns this document

type
integer

Type of document - can be used by user for document organization

subType
integer

Sub-type of document - can be used by user for document organization

title
string

The title of the document

description
string

The description of the document

shareWithGroup
boolean

If true, the document is shared with all users in the owner's group

shareWithDepartment
boolean

If true, the document is shared with all users in the owner's department

public
boolean

If true, the document can be read by everybody

Responses

Request samples

Content type
application/json
{
  • "_id": "3ufDC0Rh5g7arSC9",
  • "owner": "p3O5LB4T6C4PgkvW",
  • "type": 17,
  • "subType": 11,
  • "title": "Mission Statement",
  • "description": "A statement describing the corporate mission or how to achieve the corporate vision",
  • "shareWithGroup": false,
  • "shareWithDepartment": false,
  • "public": false
}

Response samples

Content type
application/json
[
  • {
    }
]

Update a document by applying the provided attributes

Users can update their own documents fully. Users with shared access (via group or department) can only update the content field. Only document owners can change sharing settings.

Authorizations:
userAuthadminAuth
path Parameters
documentID
required
string

Unique document ID

Request Body schema: application/json
required

Data object containing only the attributes to be updated

_id
required
string

Unique ID of document. Only used for queries and deletions

owner
required
string

The _id of the user who owns this document

title
required
string

The title of the document

description
string

The description of the document

type
required
integer

Type of document - can be used by user for document organization

subType
required
integer

Sub-type of document - can be used by user for document organization

required
Array of objects

The content of the document as an array of field objects

shareWithGroup
boolean

If true, the document is shared with all users in the owner's group

shareWithDepartment
boolean

If true, the document is shared with all users in the owner's department

public
required
boolean

If true, the document can be read by everybody

Responses

Request samples

Content type
application/json
{
  • "_id": "3ufDC0Rh5g7arSC9",
  • "owner": "p3O5LB4T6C4PgkvW",
  • "title": "Mission Statement",
  • "description": "A brief description of the document",
  • "type": 17,
  • "subType": 11,
  • "content": [
    ],
  • "shareWithGroup": false,
  • "shareWithDepartment": false,
  • "public": false
}

Remove a document

Authorizations:
userAuthadminAuth
path Parameters
documentID
required
string

Unique document ID

Responses

data structures

Data structure management endpoints

Create a new data structure

Authorizations:
adminAuth
Request Body schema: application/json
required

JSON body with all the information to create a new data structure

name
required
string

The name of the structure

description
string

The description of the structure

required
Array of objects (DataField)

Array of fields defining the structure

Responses

Request samples

Content type
application/json
{
  • "name": "City Info",
  • "description": "Data resulting from Vision-Mission-Value-Canvas",
  • "fields": [
    ]
}

Response samples

Content type
application/json
{
  • "_id": "tt5vo04DN3jm8Bqe",
  • "name": "City Info",
  • "description": "Data resulting from Vision-Mission-Value-Canvas",
  • "fields": [
    ]
}

Get all data structures

Fetch all data structures

Authorizations:
userAuthadminAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update the selected data structure applying the provided attributes

Authorizations:
adminAuth
path Parameters
structureID
required
string

Unique structure ID

Request Body schema: application/json
required

Data object containing only the attributes to be updated

_id
string

Unique ID of data structure, is used as type for documents

name
required
string

The name of the structure

description
string

The description of the structure

required
Array of objects (DataField)

Array of fields defining the structure

Responses

Request samples

Content type
application/json
{
  • "_id": "tt5vo04DN3jm8Bqe",
  • "name": "City Info",
  • "description": "Data resulting from Vision-Mission-Value-Canvas",
  • "fields": [
    ]
}

Remove a data structure

Authorizations:
adminAuth
path Parameters
structureID
required
string

Unique structure ID

Responses