更新项目

OpenAPI 契约

方法
PATCH
路径
/api/v1/projects/{id}
认证
jwtBearer (bearer) OR automationKey (bearer)
响应状态
200 400 401 403 404 409 429 500
请求与响应 Schema
JSON
{
  "requestBody": {
    "application/json": {
      "$ref": "#/components/schemas/UpdateProjectRequest"
    }
  },
  "responses": {
    "200": {
      "description": "Project updated",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/ProjectResponse"
        }
      }
    },
    "400": {
      "description": "Invalid request",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/RequestError"
        }
      }
    },
    "401": {
      "description": "Authentication required or invalid",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/SecurityError"
        }
      }
    },
    "403": {
      "description": "Authenticated but not permitted",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/SecurityError"
        }
      }
    },
    "404": {
      "description": "Requested project or build was not found",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    },
    "409": {
      "description": "Request conflicts with current project state",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    },
    "429": {
      "description": "HTTP rate limit or API-key NCU usage limit exceeded",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/RateLimitError"
        }
      }
    },
    "500": {
      "description": "Unexpected server error",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  }
}

PATCH /api/v1/projects/{id} 接受 JWT 或带 project:write 的 nfy_ 密钥;调用方还必须对项目拥有有效 project:configure capability。省略字段保持不变。非 null 的 name、description、defaultPlatforms 和 defaultFeatures 会替换已保存值,并受与创建相同的最大长度限制。变更后的名称必须在 workspace 内忽略大小写保持唯一,否则返回冲突。请谨慎设置默认值:空或空白默认值在构建解析时视为缺失。

defaultModuleConfiguration 保存完整的后端配置,包括目标、LTO、NOL 声明和 Structural 设置,并使用与构建相同的配置解析器校验和规范化。保存完整配置时使用此字段;NOL 对话框或分析助手中的草稿不会自动保存项目默认值。64 位 Structural seed 使用十进制字符串。

同时提供两种格式时,显式的 defaultModuleConfiguration 为准,并同步更新旧字段。后续仅提交 defaultPlatforms 或 defaultFeatures 的更新会将这些修改应用到已保存的配置,同时保留后端及无关的 NOL 声明、Structural 选项。

http
PATCH /api/v1/projects/{id}
Authorization: Bearer <access token>
Content-Type: application/json

{"defaultFeatures":"native-llvm-direct-call"}