Create a api key
POST
/v1/api-keyscurl -X POST 'https://api.embodiflow.io/v1/api-keys' \
-H 'Authorization: Bearer $EMBODIFLOW_PAT' \
-H 'Content-Type: application/json' \
-d '{
"expiresAt": "2026-01-01T00:00:00Z",
"name": "string",
"permissions": "project:read",
"scopeAllProjects": true,
"projectIds": [
"00000000-0000-0000-0000-000000000000"
]
}'认证
每个请求都需要携带个人访问令牌(PAT)。
- Authorization: Bearer PAT
请求体
Content-Typeapplication/json
- expiresAtstring (date-time) | null
- namestring必填
- permissionsarray<string>
Required at the service layer; empty or omitted is VALIDATION_ERROR.
- scopeAllProjectsboolean
Required with projectIds: true for every project, false for projectIds only.
- projectIdsarray<string (uuid)>
Required (non-empty) when scopeAllProjects is false.
响应
Success
- dataobject必填
- apiKeyobject必填
- tokenstring必填
- metaobject必填
- requestIdstring必填
响应示例
{
"data": {
"apiKey": {
"id": "string",
"tenantId": "string",
"membershipId": "string",
"name": "string",
"tokenPrefix": "string",
"tokenLastFour": "string",
"status": "string",
"expiresAt": "string",
"lastUsedAt": "string",
"revokedAt": "string",
"createdAt": "string",
"permissions": "project:read",
"scopeAllProjects": false,
"projectIds": [
"string"
],
"owner": {
"userId": "string",
"email": "string",
"displayName": "string"
}
},
"token": "string"
},
"meta": {
"requestId": "string"
}
}服务器https://api.embodiflow.io/v1https://api.embodiflow.dev/v1