Create a workflow definition
POST
/v1/workflow-definitionscurl -X POST 'https://api.embodiflow.io/v1/workflow-definitions' \
-H 'Authorization: Bearer $EMBODIFLOW_PAT' \
-H 'Content-Type: application/json' \
-d '{
"spec": {},
"layout": {},
"description": "string",
"projectId": "00000000-0000-0000-0000-000000000000"
}'认证
每个请求都需要携带个人访问令牌(PAT)。
- Authorization: Bearer PAT
请求头参数
- Idempotency-Keystring
Optional idempotency key, at most 255 characters (UUIDv4 recommended). A repeated key returns the first response byte-for-byte, including a 5xx. The same key with a different body, or a second in-flight request, returns 409 IDEMPOTENCY_CONFLICT. Keys are unique per tenant and retained for 24 hours.
请求体
Content-Typeapplication/json
- specobject必填
- layoutobject
- descriptionstring
- projectIdstring (uuid)
响应
Success
- dataobject必填
- idstring必填
- codestring必填
- namestring必填
- descriptionstring | null必填
- reusableone of必填
- ownerstring必填可选值tenantplatform
- purposestring | null必填
- latestRevisionnumber | null必填
- specHashstring | null必填
- publishedAtstring | null必填
- rowVersionnumber必填
- revisionobject必填
响应示例
{
"data": {
"id": "string",
"code": "string",
"name": "string",
"description": "string",
"reusable": false,
"owner": "tenant",
"purpose": "string",
"latestRevision": 0,
"specHash": "string",
"publishedAt": "string",
"rowVersion": 0,
"revision": {
"id": "string",
"revision": 0,
"spec": {},
"specHash": "string",
"purpose": "string",
"layout": {},
"publishedAt": "string",
"rowVersion": 0,
"issues": [
{
"code": "string",
"severity": "string",
"stepId": "string",
"path": "string",
"message": "string",
"requirement": "string"
}
]
}
}
}服务器https://api.embodiflow.io/v1https://api.embodiflow.dev/v1