approval (v4)

Manage Lark approval workflows and process approval requests programmatically

approval (v4) for Happycapy Skills:

Streamline Lark Approval Workflows

What Is This

The approval (v4) skill, identified as lark-approval, is a command-line integration for the Happycapy Skills platform that lets you manage Lark (Feishu) approval workflows programmatically. This skill exposes a suite of commands for interacting with approval requests, tasks, and workflows on the Lark platform, leveraging the official Feishu Approval API. With this tool, you can query, process, update, and automate approval instances and tasks directly from your CLI environment, making it a powerful asset for teams that rely on structured approval processes.

Skill Highlights:

  • Skill ID: lark-approval
  • Category: design
  • Source: GitHub - lark-approval
  • Dependencies: Requires lark-cli
  • API Coverage: Approval instances and tasks management (read, approve, reject, transfer, cc, cancel, query)

Why Use It

Traditional approval flows within Lark often require manual navigation through the UI, which can be slow and error-prone, especially for organizations with complex or high-volume approval needs. The approval (v4) skill addresses these challenges by enabling:

  • Automation: Integrate approval handling into scripts, CI/CD pipelines, or custom workflow automation.
  • Bulk Operations: Query and process multiple approval tasks efficiently.
  • Consistency: Reduce human error by standardizing how approvals are processed.
  • Integration: Seamlessly connect approval operations with other CLI-managed processes, extending the power of Lark approvals into broader organizational workflows.
  • Auditability: Programmatic handling of approvals ensures changes are logged and traceable.

How to Use It

Prerequisites

Before using this skill, you must read and configure authentication and permissions as described in the lark-shared/SKILL.md file. Properly setting up credentials and scopes is mandatory for secure and successful API access.

Installation Requirement:
Ensure lark-cli is installed and configured on your system.

Core Concepts

The skill organizes actions around two primary resources:

  • instances: Represent approval request objects in Lark.
  • tasks: Represent actionable approval steps assigned to a user.

Command Structure

  • View parameter schema:
    Before calling any API, inspect the schema for required fields:
    lark-cli schema approval.<resource>.<method>
  • Call the API:
    Use the following syntax to execute API calls:
    lark-cli approval <resource> <method> [flags]

Important: Always run the schema command before using an API method to understand required parameters. Do not guess field names or formats.

Example Usage

1. Retrieve Approval Instance Details

lark-cli schema approval.instances.get
lark-cli approval instances get --params '{"instance_id": "your-instance-id"}'

2. Cancel an Approval Instance

lark-cli schema approval.instances.cancel
lark-cli approval instances cancel --data '{"instance_id": "your-instance-id"}'

3. CC (Carbon Copy) an Approval Instance

lark-cli schema approval.instances.cc
lark-cli approval instances cc --data '{"instance_id": "your-instance-id", "user_id_list": ["user1", "user2"]}'

4. Approve a Task

lark-cli schema approval.tasks.approve
lark-cli approval tasks approve --data '{"task_id": "your-task-id"}'

5. Reject a Task

lark-cli schema approval.tasks.reject
lark-cli approval tasks reject --data '{"task_id": "your-task-id"}'

6. Transfer a Task

lark-cli schema approval.tasks.transfer
lark-cli approval tasks transfer --data '{"task_id": "your-task-id", "new_user_id": "user3"}'

7. Query Tasks Assigned to a User

lark-cli schema approval.tasks.query
lark-cli approval tasks query --params '{"user_id": "your-user-id"}'

Permission Scopes

Every method requires the appropriate API scope. Below is a mapping for reference:

MethodRequired Scope
instances.getapproval:instance:read
instances.cancelapproval:instance:write
instances.ccapproval:instance:write
tasks.approveapproval:task:write
tasks.rejectapproval:task:write
tasks.transferapproval:task:write
tasks.queryapproval:task:read

Ensure your authentication setup grants the necessary permissions for the operations you intend to perform.

When to Use It

This skill is ideal when you need to:

  • Automate repetitive approval operations: Integrate with deployment, onboarding, or offboarding scripts.
  • Build custom interfaces or bots: Use as a backend for approval dashboards or notification bots.
  • Handle approvals at scale: Process or monitor hundreds of tasks or instances programmatically.
  • Enforce compliance: Ensure all approval actions follow standardized, auditable procedures.

Typical scenarios include HR onboarding flows, procurement approvals, access control requests, or any workflow where structured, auditable approvals are indispensable.

Important Notes

  • Authentication: You must review and implement authentication and permission handling as outlined in the shared configuration. Omitting this step will result in failed API calls.
  • Schema Awareness: Always check the schema before making API requests. Lark API fields and formats may change, and using outdated or incorrect parameters can cause failures.
  • Error Handling: Integrate error checking and logging in your scripts to handle API errors gracefully.
  • Scope Management: Only request and use the scopes your workflow actually needs to maintain security best practices.
  • Maintenance: Monitor the GitHub repository for updates or changes to command syntax or API behavior.

By leveraging the approval (v4) skill, you can bring robust, automated approval management into your CLI-driven workflows, enhancing efficiency and reliability across your organization’s critical business processes.