---
title: "执行模块 action.sh 并返回输出"
method: POST
path: "/modules/id/{mid}/action"
tags: ["模块"]
---

# 执行模块 action.sh 并返回输出

`POST /modules/id/{mid}/action`

## Path parameters

- `mid` string, required

## Response `200`

输出消息列表

- WsioMessage[]
  - union
    - object
      - `type` 'stdio', required
      - `stdout` string
      - `stderr` string
    - object
      - `type` 'exit', required
      - `code` integer — 进程退出码或安装前置错误的 HTTP 状态码
      - `signal` integer

## Other responses

- `403` — 鉴权失败，或 WebSocket 票证无效
- `404` — 模块不存在
- `410` — 模块系统未安装或模块没有 `action.sh`
- `500` — 后端执行操作失败

---

[API](https://skmtc.net/oom-wg/apis/shirosu-http.md) · [All operations](https://skmtc.net/oom-wg/apis/shirosu-http/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/oom-wg/shirosu-http/versions/3d63f1947f5a/schema)
