> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.omicx.one/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.omicx.one/_mcp/server.

# Quy trình

GET https://api.omicx.one/workflows

**Scope yêu cầu:** `customer:read`. Toàn bộ quy trình đang bật của tenant, mọi loại đối tượng — `id` trả về chính là giá trị dùng cho `workflowId`; `id` của một trạng thái (status) là giá trị dùng cho `statusId`. `id` trạng thái chỉ duy nhất **trong phạm vi một quy trình** — 2 quy trình khác nhau có thể dùng trùng `id` trạng thái.

Reference: https://developers.omicx.one/customer-config/values/list-workflows

## Request

### Headers

- `X-Api-Key` (string, required)

## Response

### 200

Danh sách quy trình.

- `items` (list of WorkflowListItemsItems, optional)

## Errors

### 401 Unauthorized Error

`API_KEY_REQUIRED` hoặc `API_KEY_INVALID`.

- `error` (ErrorResponseError, optional)

### 403 Forbidden Error

`INSUFFICIENT_SCOPE`.

- `error` (ErrorResponseError, optional)

### 429 Too Many Requests Error

`RATE_LIMIT_EXCEEDED`.

- `error` (ErrorResponseError, optional)

### 502 Bad Gateway Error

`CUSTOMER_SERVICE_UNAVAILABLE` — upstream timeout/lỗi 5xx, kèm `Retry-After: 5`.

- `error` (ErrorResponseError, optional)

## Types

### WorkflowListItemsItems

- `id` (string, optional)
- `name` (string, optional)
- `description` (string, optional, nullable)
- `entityType` (enum, optional)
  - Allowed values: `DEAL`, `CUSTOMER`, `LEAD`, `TASK`, `APPOINTMENT`, `COMPANY`
- `categoryType` (enum, optional, nullable) — Mã danh mục quy trình.
  - Allowed values: `subscriber`, `lead`, `qualified_lead`, `opportunity`, `official`, `evangelist`, `other`
- `operationalStatus` (enum, optional) — Luôn là `enabled` — chỉ các quy trình đang bật mới được liệt kê.
  - Allowed values: `enabled`
- `isDefault` (boolean, optional)
- `statuses` (list of WorkflowListItemsItemsStatusesItems, optional)

### ErrorResponseError

- `code` (string, optional) — Nhóm lỗi (dạng máy đọc được), ổn định theo từng HTTP status.
- `subCode` (string, optional, nullable) — Mã cụ thể, ổn định — dùng để phân nhánh xử lý / dịch i18n. Hãy xử lý logic dựa trên `subCode`, không dựa vào chuỗi `message`.
- `message` (string, optional) — Mô tả cho con người đọc (dùng để debug), không nên dịch trực tiếp.
- `timestamp` (long, optional) — Epoch millis.
- `path` (string, optional) — Đường dẫn request đầy đủ.
- `traceId` (string, optional, nullable) — Mã tương quan request, có khi lỗi đi qua bộ xử lý lỗi chung.
- `details` (list of ErrorResponseErrorDetailsItems, optional, nullable) — Chỉ xuất hiện khi `code` là `VALIDATION_ERROR` — danh sách lỗi theo từng trường.

### WorkflowListItemsItemsStatusesItems

- `id` (string, optional)
- `name` (string, optional)
- `color` (string, optional)
- `zone` (enum, optional, nullable) — Cột trên board tương ứng với trạng thái này (trạng thái con kế thừa zone từ trạng thái gốc của nhánh). Viết hoa — trước ngày 2026-10-09 là chữ thường (`main_flow`...).
  - Allowed values: `MAIN_FLOW`, `SUCCESS`, `FAILED`, `CLOSED`
- `parentId` (string, optional, nullable)
- `sortOrder` (integer, optional)

### ErrorResponseErrorDetailsItems

- `field` (string, optional)
- `message` (string, optional)
- `rejectedValue` (any, optional, nullable)

## Examples

**Response**

```json
{
  "items": [
    {
      "id": "string",
      "name": "string",
      "description": "string",
      "entityType": "DEAL",
      "categoryType": "subscriber",
      "operationalStatus": "enabled",
      "isDefault": true,
      "statuses": [
        {
          "id": "string",
          "name": "string",
          "color": "string",
          "zone": "MAIN_FLOW",
          "parentId": "string",
          "sortOrder": 1
        }
      ]
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.omicx.one/workflows"

headers = {"X-Api-Key": "omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.omicx.one/workflows';
const options = {method: 'GET', headers: {'X-Api-Key': 'omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.omicx.one/workflows"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-Api-Key", "omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.omicx.one/workflows")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = 'omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.omicx.one/workflows")
  .header("X-Api-Key", "omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.omicx.one/workflows', [
  'headers' => [
    'X-Api-Key' => 'omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.omicx.one/workflows");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Api-Key", "omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-Api-Key": "omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.omicx.one/workflows")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```