Skip to main content
POST

Overview

Approval workflows define multi-step approval processes for different entity types within your company. Each workflow consists of sequential steps where approvers review and take action on submissions.
Only users with Super Admin or HR Manager roles can create approval workflows.

Request Body

string
required
Type of workflow to create. Must be one of:
  • leave - For leave requests
  • memo - For company memos
  • expense - For expense claims
uuid
Company ID for the workflow. If not provided, uses the authenticated user’s company ID.
uuid
Optional department ID to restrict this workflow to a specific department. If null, the workflow applies company-wide.
array
required
Array of approval steps. Each step is processed sequentially.Example structure:
  • step (integer): Step sequence number
  • role_id (uuid): Required role for this approval step
  • approver_id (uuid, optional): Specific approver, or null for any user with the role
boolean
default:"true"
Whether the workflow is active. Inactive workflows are not used for new submissions.

Response

boolean
Indicates if the request was successful
object
The created approval workflow object

Example Request

Workflow Design Best Practices

Currently, approval workflows are sequential - each step must be completed before the next begins. Design your steps accordingly, with the most critical approver first.
  • Department-specific workflows: Use when different departments have different approval requirements
  • Company-wide workflows: Leave departmentId as null to apply the same workflow across all departments
  • Set approver_id to null to allow any user with the specified role to approve
  • Set a specific approver_id to require approval from a particular person

Error Responses

Invalid request body or workflow configuration
Missing or invalid authentication token, or insufficient permissions
Server error while creating the workflow