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:
- staff: Access for team members working on the project
- client: Access for client organization members
- lead: Access for project leaders and managers
- financial: Access for financial officers
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
- post /api/v3/workflow/project/documents
- delete /api/v3/workflow/project/documents/:resource_id
- get /api/v3/workflow/project/documents/:resource_id
- patch /api/v3/workflow/project/documents/:resource_id
get/api/v3/workflow/project/documents
Return a paginated list of workflow/project/documents
Input Schema
object
object
object
- `project`
array
The key is the resource type and the value is an array of fields.
dictionary
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
array
object
object
array
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
object
object
object
object
object
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
Typescript
type InputSchema = { resource_id: number };
get/api/v3/workflow/project/documents/:resource_id
Show a specific workflow/project/documents
Input Schema
object
array
dictionary
Typescript
type InputSchema = {
resource_id: number;
included?: Array<string>;
fields?: { [key: string]: Array<any> };
};
Output Schema
object
object
object
array
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
object
object
object
object
object
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 } } };
};
};