--- title: "客服人员 API 指南" slug: "using-the-operator-api" updated: 2026-10-22T14:34:11Z published: 2026-10-22T14:34:11Z canonical: "support.tulip.co/using-the-operator-api" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.tulip.co/llms.txt > Use this file to discover all available pages before exploring further. # 客服人员 API 指南 *了解如何配置操作员 API* Advanced Content This article assumes previous experience with APIs. 向您的网站添加操作员是必要的,以便为运行在 Tulip 中开发的应用程序的用户提供支持。您可以通过以下两种方式创建操作员:* 位于**“设置**”中的[“用户”页面](https://support.tulip.co/docs/adding-users-and-managing-user-roles) ***** 通过 Tulip API 使用外部系统。 以下步骤演示了如何使用 Tulip API 创建操作员。 ## 添加操作员 API 令牌 Feature rename Prior to r383, Service Accounts were called "API Tokens". 在您的 Tulip 实例中,点击右上角的**个人资料图标**,然后选择**“设置”**。 ![Configuring Your Tulip Account Settings_124925135](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Configuring%20Your%20Tulip%20Account%20Settings_124925135.png) 选择**“Tulip API**”,然后点击右上角的**“创建服务账户**”按钮。 ![Create%20API%20token1](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Create%20API%20token1.png) 在“创建”菜单中,为 API 令牌**命名**并选择`users:write`权限范围。点击**“创建”**。 ![Create API Token](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Create%20API%20Token.gif) Note Make sure to save the Service Account information for the **API Key**, **Secret**, and **Authorization Header**. ## 使用 Operator API 下文将详细介绍如何创建操作员。本示例将使用[Postman](https://www.postman.com/)进行创建操作。 首先,将您的 API 端点添加到 POST 请求中。 NOTE If you are using a global API key, you need to specify the workspace. If your API key is workspaced scoped, it is optional. *https://(yourinstancenamehere).tulip.co/api/v3/w/(workspace)/users* ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Using%20the%20Operator%20API_222496924.png) 然后,在“授权”部分,选择**“基本认证**”,并将 API 密钥作为**用户名**,API 密钥密文作为**密码**。 ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Using%20the%20Operator%20API_222497720.png) 在“标头”下,添加**“Auth”标头**。 ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Using%20the%20Operator%20API_222497957.png) 在“请求体”中,将请求格式化为包含 JSON 对象。此请求的通用格式如下: `{"role": "operator","name": "string","badge_id": "string"}` 效果将类似如下: ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Using%20the%20Operator%20API_222499033.png) 点击**“发送”**以执行请求,您将收到 201 响应,表示操作成功。要验证结果,您可以在**“设置”**中查看“用户”列表,确认该用户已成功创建。 ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Using%20the%20Operator%20API_222499593.png) 如果请求失败,请检查密钥和密钥密文是否正确。有关具体响应代码的更多信息,请参阅[《API 入门》](/r230/docs/introduction-to-apis)。 --- 您找到想要的内容了吗? 您也可以访问[community.tulip.co](https://community.tulip.co/?utm_source=intercom&utm_medium=article-link&utm_campaign=all)发布问题,或查看其他人是否遇到过类似问题! **JSON** **JSON (JavaScript Object Notation)** is a light-weight, text-based data format that is used to store and transfer data.