Project Documents

Manage project documents. Create new documents, update and delete them. Documents are files attached to the project.

Document Rights System

Documents use a role-based access control system with the following rights:

These rights control who can view, edit, and manage documents based on their role in relation to the project. Rights are stored as an array of strings, allowing documents to have multiple access levels.

Document Categories

Documents must be assigned to a category, which helps organize and classify project files. The category is a required field and cannot be empty.

Integration with Files Service

Documents are stored using the Files service, with the document record containing a URL reference to the actual file. The system maintains links between project documents and their corresponding files.

Audit Trail

All document operations (creation, deletion) are automatically tracked in the DocumentsAudit system, providing a complete history of document activities for compliance and tracking purposes.

Endpoints


get/api/v3/workflow/project/documents

Return a paginated list of workflow/project/documents

Input Schema

object
page?:
object
The page number, default to 1
number?: integer
The number of items per page, default to 1000
size?: integer
The sort order, comma separated list of fields. See sorting section for more details
sort?: string
Set to true to return the total number of items in the collection
count?: boolean
filter?:
object
id?: unknown
project_id?: unknown
name?: unknown
category?: unknown
rights?: unknown
url?: unknown
created_by?: unknown
created_at?: unknown
name__match?: unknown
rights__contains?: unknown
search?: unknown
project_id__in?: unknown
category__in?: unknown
The related resources to include in the response. Allowed resources are:
- `project`
included?:
array
Elements: string
The fields to include in the response.
The key is the resource type and the value is an array of fields.
fields?:
dictionary
Values: array

Typescript

type InputSchema = {
  page?: {
    // The page number, default to 1
    number?: number;
    // The number of items per page, default to 1000
    size?: number;
  };
  // The sort order, comma separated list of fields. See sorting section for more details
  sort?: string;
  // Set to true to return the total number of items in the collection
  count?: boolean;
  filter?: {
    id?: any;
    project_id?: any;
    name?: any;
    category?: any;
    rights?: any;
    url?: any;
    created_by?: any;
    created_at?: any;
    name__match?: any;
    rights__contains?: any;
    search?: any;
    project_id__in?: any;
    category__in?: any;
  };
  // The related resources to include in the response. Allowed resources are:
  // - `project`
  included?: Array<string>;
  // The fields to include in the response.
  // The key is the resource type and the value is an array of fields.
  fields?: { [key: string]: Array<any> };
};

Output Schema

object
data:
array
Elements:
object
type: string
id?: string
attributes?:
object
id?: integer
project_id?: integer
name?: string
category?: string
rights?: array
url?: string
created_by?: integer
created_at?: datetime
relationships?: open struct
included?:
array
Elements: open struct

Typescript

type OutputSchema = {
  data: Array<{
    type: string;
    id?: string;
    attributes?: {
      id?: number;
      project_id?: number;
      name?: string;
      category?: string;
      rights?: Array<any>;
      url?: string;
      created_by?: number;
      created_at?: Date;
    };
    relationships?: Record<string, any>;
  }>;
  included?: Array<Record<string, any>>;
};


post/api/v3/workflow/project/documents

Create a new workflow/project/documents

Input Schema

object
data:
object
type: string
attributes:
object
id?: integer
project_id?: integer
name?: string
category?: string
rights?: array
url?: string
created_by?: integer
created_at?: datetime
relationships?:
object
project:
object
data:
object
type: string
id?: string

Typescript

type InputSchema = {
  data: {
    type: string;
    attributes: {
      id?: number;
      project_id?: number;
      name?: string;
      category?: string;
      rights?: Array<any>;
      url?: string;
      created_by?: number;
      created_at?: Date;
    };
    relationships?: { project: { data: { type: string; id?: string } } };
  };
};


delete/api/v3/workflow/project/documents/:resource_id

Delete the workflow/project/documents

Input Schema

object
resource_id: integer

Typescript

type InputSchema = { resource_id: number };


get/api/v3/workflow/project/documents/:resource_id

Show a specific workflow/project/documents

Input Schema

object
resource_id: integer
included?:
array
Elements: string
fields?:
dictionary
Values: array

Typescript

type InputSchema = {
  resource_id: number;
  included?: Array<string>;
  fields?: { [key: string]: Array<any> };
};

Output Schema

object
data:
object
type: string
id?: string
attributes?:
object
id?: integer
project_id?: integer
name?: string
category?: string
rights?: array
url?: string
created_by?: integer
created_at?: datetime
relationships?: open struct
included?:
array
Elements: open struct

Typescript

type OutputSchema = {
  data: {
    type: string;
    id?: string;
    attributes?: {
      id?: number;
      project_id?: number;
      name?: string;
      category?: string;
      rights?: Array<any>;
      url?: string;
      created_by?: number;
      created_at?: Date;
    };
    relationships?: Record<string, any>;
  };
  included?: Array<Record<string, any>>;
};


patch/api/v3/workflow/project/documents/:resource_id

Update a workflow/project/documents

Input Schema

object
resource_id: integer
data:
object
type: string
attributes:
object
id?: integer
project_id?: integer
name?: string
category?: string
rights?: array
url?: string
created_by?: integer
relationships?:
object
project:
object
data:
object
type: string
id?: string

Typescript

type InputSchema = {
  resource_id: number;
  data: {
    type: string;
    attributes: {
      id?: number;
      project_id?: number;
      name?: string;
      category?: string;
      rights?: Array<any>;
      url?: string;
      created_by?: number;
    };
    relationships?: { project: { data: { type: string; id?: string } } };
  };
};