# 公司

{% hint style="warning" %}
&#x20;此 API 為 2022-12-28 後版本開放。
{% endhint %}

## 搜尋

```javascript
GET https://{API_DOMAIN}/api/v1/company
```

```javascript
curl -X GET
    -H "Content-Type: application/json"
    '{"name": "vip"}'
    https://{API_HOST}/api/v1/company
```

### Form Data

下表為可使用的過濾條件

<table><thead><tr><th>PARAMETER</th><th>REQUIRED</th><th width="122">DEFAULT</th><th>TYPE</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td>PARAMETER</td><td>REQUIRED</td><td>DEFAULT</td><td>TYPE</td><td>DESCRIPTION</td></tr><tr><td><strong>search</strong></td><td>false</td><td>NULL</td><td>String</td><td>模糊搜尋公司名稱、編號、網域</td></tr><tr><td><strong>name</strong></td><td>false</td><td>NULL</td><td>String</td><td>搜尋公司名稱</td></tr><tr><td><strong>sn</strong></td><td>false</td><td>NULL</td><td>String</td><td>搜尋編號</td></tr></tbody></table>

### Response

| PROPERTY | TYPE             | DESCRIPTION |
| -------- | ---------------- | ----------- |
| **data** | Array of objects | 公司資料陣列      |
| **meta** | Object           | 頁籤資料        |

```json
{
    "data": [
      {
        "id": 1,
        "name": "FIRST LINE",
        "sn": '50889516',
        "domains": [
          "https://www.firstline.cc/"
        ],
        "contacts_count": 1,
        "description": null,
        "creater_id": 1,
        "creater": {...}
      }
    ],
    "links": {...},
    "meta": {...}
}
```

## 取得單筆資料

```javascript
GET https://{API_DOMAIN}/api/v1/company/{{ company }}
```

```javascript
curl -X GET
    -H "Content-Type: application/json"
    https://{API_HOST}/api/v1/company/1
```

### URL Parameters

| PARAMETER | REQUIRED | DEFAULT | TYPE   | DESCRIPTION |
| --------- | -------- | ------- | ------ | ----------- |
| **id**    | true     | NULL    | Number | 客戶標籤系統 ID   |

### Response

| PROPERTY | TYPE   | DESCRIPTION |
| -------- | ------ | ----------- |
| **data** | Object | 公司資料        |

```json
{
    "data": {
      "id": 1,
      "name": "FIRST LINE",
      "sn": '50889516',
      "domains": [
        "https://www.firstline.cc/"
      ],
      "contacts_count": 1,
      "description": null,
      "creater_id": 1,
      "creater": {...}
    }
}
```

## 新增

```javascript
POST https://{API_DOMAIN}/api/v1/company
```

```javascript
    '{"name": "FIRST LINE", "description": "企業級客服系統" }'
    https://{API_HOST}/api/v1/company
```

### Form Data

<table data-header-hidden><thead><tr><th width="201">PARAMETER</th><th>REQUIRED</th><th>DEFAULT</th><th>TYPE</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td>PARAMETER</td><td>REQUIRED</td><td>DEFAULT</td><td>TYPE</td><td>DESCRIPTION</td></tr><tr><td><strong>name</strong></td><td>true</td><td>NULL</td><td>String</td><td>名稱</td></tr><tr><td><strong>description</strong></td><td>false</td><td>NULL</td><td>String</td><td>描述</td></tr><tr><td><strong>sn</strong></td><td>false</td><td>NULL</td><td>String</td><td>統一編號</td></tr><tr><td><strong>domains</strong></td><td>fale</td><td>Null</td><td>Array</td><td>企業網域</td></tr></tbody></table>

### Response

```json
{
    "data": {
      "id": 1,
      "name": "FIRST LINE",
      "sn": '50889516',
      "domains": [
        "https://www.firstline.cc/"
      ],
      "contacts_count": 1,
      "description": null,
      "creater_id": 1,
      "creater": {...}
    }
}
```

## 更新

```javascript
PUT https://{API_DOMAIN}/api/v1/company/{{ company }}
```

```javascript
curl -X PUT
    -H "Content-Type: application/json"
    '{"name": "Acquire Tech" }'
    https://{API_HOST}/api/v1/company/1
```

### URL Parameters

<table data-header-hidden><thead><tr><th width="201">PARAMETER</th><th>REQUIRED</th><th>DEFAULT</th><th>TYPE</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td>PARAMETER</td><td>REQUIRED</td><td>DEFAULT</td><td>TYPE</td><td>DESCRIPTION</td></tr><tr><td><strong>name</strong></td><td>true</td><td>NULL</td><td>String</td><td>名稱</td></tr><tr><td><strong>description</strong></td><td>false</td><td>NULL</td><td>String</td><td>描述</td></tr><tr><td><strong>sn</strong></td><td>false</td><td>NULL</td><td>String</td><td>統一編號</td></tr><tr><td><strong>domains</strong></td><td>fale</td><td>Null</td><td>Array</td><td>企業網域</td></tr></tbody></table>

### Response

```json
{
    "data": {
      "id": 1,
      "name": "FIRST LINE",
      "sn": '50889516',
      "domains": [
        "https://www.firstline.cc/"
      ],
      "contacts_count": 1,
      "description": null,
      "creater_id": 1,
      "creater": {...}
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.firstline.cc/developer/api/company.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
