---
title: "CreateExperiment"
method: POST
path: "/di/v2/experiment"
tags: ["Experiment"]
---

# CreateExperiment

`POST /di/v2/experiment`

## Request

- Base URL: `https://di.prophecis.com`
- URL: `https://di.prophecis.com/di/v2/experiment`
- Auth: one of:
  - API key in header `Authorization`
  - API key in header `X-Watson-Authorization-Token`
  - API key in query parameter `watson-token`
- TypeScript: <https://skmtc.dev/webankfintech/apis/prophecis-rest-service-v2/docs/di/v2/experiment/post.ts> (a function with typed inputs; its response is checked against the schema)

创建一个新实验

## Request body

- CreateExperimentRequest
  - `name` string, required: 创建实验的名称
  - `group_id` string: 创建实验所属的项目组ID(理论上传group_id就够了，但是group的相关接口暂时不支持byId查询，所以暂时需要传group_id和group_name)
  - `group_name` string: 创建实验所属的项目组名字(理论上传group_id就够了，但是group的相关接口暂时不支持byId查询，所以暂时需要传group_id和group_name)
  - `description` string: 创建实验的描述
  - `tags` string[]: 创建实验的标签
  - `source_system` 'MLSS' | 'DSS' | 'WTSS': 表示实验在哪个系统创建的, 默认为"MLSS"；可选的枚举值为 "WTSS" "DSS" "MLSS"
  - `cluster_type` 'BDAP' | 'BDP': 实验所属的集群类型，默认为"BDAP"；可选枚举值为 "BDAP" "BDP"
  - `dss_info` DSSInfo
    - `flow_name` string
    - `flow_version` string
    - `flow_id` number
    - `project_name` string
    - `project_id` number
    - `workspace_name` string: workspace name,choose next value, "bdapWorkspace" "bdapWorkspace0x"
    - `workspace_id` integer: workspace id
  - `flow_json` string: 创建的实验的工作流
  - `flow_json_upload_id` string: 创建的实验的工作流上传的id（来自UploadExperimentFlowJson接口的返回）

## Response `200`

OK

- CreateExperimentResponse
  - `id` string, required: 返回创建的实验的id

## Other responses

- `401`: Unauthorized
- `404`: The Models cannot be found

---

[API](https://skmtc.dev/webankfintech/apis/prophecis-rest-service-v2.md) - [All operations](https://skmtc.dev/webankfintech/apis/prophecis-rest-service-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/webankfintech/apis/prophecis-rest-service-v2/revisions/ea40aedea89c?raw)
