# 文件說明

MantaGO API 技術文件

MantaGO API 技術文件，可以綁定會員推播等功能，如果有使用上的問題，可聯絡<eslitec@eslitec.com>。

Postman連結：<https://documenter.getpostman.com/view/39154303/2sAYkKKJfg>


# 會員API

會員API可以依據客戶本身會員平台的帳號，並藉由API綁定/解綁企業會員帳號在MantaGO平台中。


# 帳號綁定

## Bind customer

> Bind a customer to the current session or context

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"Core","description":"Core OpenAPI functionality for customer management and broadcasting"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"CustomerBindRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"clientId":{"type":"string","description":"The client ID (platform UUID) to bind/unbind"},"customerId":{"type":"string","description":"The customer ID to bind/unbind"}},"required":["secret","clientId","customerId"]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"GetOpenApiError":{"description":"OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/bind/customer":{"post":{"tags":["Core"],"summary":"Bind customer","description":"Bind a customer to the current session or context","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerBindRequest"}}}},"responses":{"200":{"description":"Customer bound successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"$ref":"#/components/responses/GetOpenApiError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 解除帳號綁定

## Unbind customer

> Unbind a customer from the current session or context

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"Core","description":"Core OpenAPI functionality for customer management and broadcasting"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"CustomerBindRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"clientId":{"type":"string","description":"The client ID (platform UUID) to bind/unbind"},"customerId":{"type":"string","description":"The customer ID to bind/unbind"}},"required":["secret","clientId","customerId"]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"GetOpenApiError":{"description":"OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/unbind/customer":{"post":{"tags":["Core"],"summary":"Unbind customer","description":"Unbind a customer from the current session or context","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerBindRequest"}}}},"responses":{"200":{"description":"Customer unbound successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"$ref":"#/components/responses/GetOpenApiError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 會員列表

用來取得所屬於某機器人的會員資料，並可依據參數，獲得特定之會員資料

## Get client list

> Retrieve a list of clients with pagination support

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"Core","description":"Core OpenAPI functionality for customer management and broadcasting"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"SecretRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"}},"required":["secret"]},"ClientListResponse":{"allOf":[{"$ref":"#/components/schemas/BasicSuccessResponse"},{"type":"object","properties":{"clientList":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#/components/schemas/Client"}},"next":{"type":"string","description":"Next page token for pagination"}}}}}]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"Client":{"type":"object","properties":{"clientId":{"type":"string","description":"Platform-specific client ID"},"clientName":{"type":"string","description":"Client display name"},"clientHeadshot":{"type":"string","format":"uri","description":"Client avatar URL"},"platform":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"],"description":"Platform type"},"remark":{"type":"string","description":"Admin remarks about the client"},"isBlock":{"type":"boolean","description":"Whether the client is blocked"},"customerId":{"type":"string","description":"Internal customer ID"},"userName":{"type":"string","description":"User's questionnaire name"},"userEmail":{"type":"string","format":"email","description":"User's questionnaire email"},"userPhone":{"type":"string","description":"User's questionnaire phone"},"userBirthday":{"type":"string","format":"date","description":"User's questionnaire birthday"},"userAddress":{"type":"string","description":"User's questionnaire address"},"createdAt":{"type":"string","format":"date-time","description":"Client creation timestamp"},"updatedAt":{"type":"string","format":"date-time","description":"Client last update timestamp"},"lastInteractAt":{"type":"string","format":"date-time","description":"Last interaction timestamp"},"autoTags":{"type":"array","items":{"$ref":"#/components/schemas/TagInfo"},"description":"Auto tags assigned to client"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/TagInfo"},"description":"Client tags assigned to client"},"tourTags":{"type":"array","items":{"$ref":"#/components/schemas/TagInfo"},"description":"Tour management tags assigned to client"},"personalTags":{"type":"array","items":{"$ref":"#/components/schemas/TagInfo"},"description":"Personal tags assigned to client"}}},"TagInfo":{"type":"object","properties":{"name":{"type":"string","description":"Tag name"},"createdAt":{"type":"string","format":"date-time","description":"Tag creation timestamp"}}},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/clients":{"post":{"tags":["Core"],"summary":"Get client list","description":"Retrieve a list of clients with pagination support","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"},{"name":"customerId","in":"query","required":false,"schema":{"type":"string"},"description":"Filter by customer ID"},{"name":"platform","in":"query","required":false,"schema":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"]},"description":"Filter by platform"},{"name":"name","in":"query","required":false,"schema":{"type":"string"},"description":"Filter by client name"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":10},"description":"Maximum number of clients to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0},"description":"Number of clients to skip"},{"name":"startAt","in":"query","required":false,"schema":{"type":"integer"},"description":"Start timestamp (1657867028700) for filtering clients"},{"name":"endAt","in":"query","required":false,"schema":{"type":"integer"},"description":"End timestamp (1657867028700) for filtering clients"},{"name":"next","in":"query","required":false,"schema":{"type":"string"},"description":"Pagination token for next page"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretRequest"}}}},"responses":{"200":{"description":"Client list retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientListResponse"}}}},"400":{"description":"Invalid date parameter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 會員資料

用會員的經過加密的 MantaGo ID，來取得所屬於某機器人的特定會員之資料

## Get specific client

> Retrieve detailed information about a specific client.\
> \
> Conditional validation rules:\
> \- If clientId (path parameter) is provided, platformClientId and platform are optional\
> \- If clientId (path parameter) is empty, both platformClientId and platform are required<br>

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"Core","description":"Core OpenAPI functionality for customer management and broadcasting"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"SecretRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"}},"required":["secret"]},"ClientResponse":{"allOf":[{"$ref":"#/components/schemas/BasicSuccessResponse"},{"type":"object","properties":{"client":{"$ref":"#/components/schemas/Client"}}}]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"Client":{"type":"object","properties":{"clientId":{"type":"string","description":"Platform-specific client ID"},"clientName":{"type":"string","description":"Client display name"},"clientHeadshot":{"type":"string","format":"uri","description":"Client avatar URL"},"platform":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"],"description":"Platform type"},"remark":{"type":"string","description":"Admin remarks about the client"},"isBlock":{"type":"boolean","description":"Whether the client is blocked"},"customerId":{"type":"string","description":"Internal customer ID"},"userName":{"type":"string","description":"User's questionnaire name"},"userEmail":{"type":"string","format":"email","description":"User's questionnaire email"},"userPhone":{"type":"string","description":"User's questionnaire phone"},"userBirthday":{"type":"string","format":"date","description":"User's questionnaire birthday"},"userAddress":{"type":"string","description":"User's questionnaire address"},"createdAt":{"type":"string","format":"date-time","description":"Client creation timestamp"},"updatedAt":{"type":"string","format":"date-time","description":"Client last update timestamp"},"lastInteractAt":{"type":"string","format":"date-time","description":"Last interaction timestamp"},"autoTags":{"type":"array","items":{"$ref":"#/components/schemas/TagInfo"},"description":"Auto tags assigned to client"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/TagInfo"},"description":"Client tags assigned to client"},"tourTags":{"type":"array","items":{"$ref":"#/components/schemas/TagInfo"},"description":"Tour management tags assigned to client"},"personalTags":{"type":"array","items":{"$ref":"#/components/schemas/TagInfo"},"description":"Personal tags assigned to client"}}},"TagInfo":{"type":"object","properties":{"name":{"type":"string","description":"Tag name"},"createdAt":{"type":"string","format":"date-time","description":"Tag creation timestamp"}}},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/client/{clientId}":{"post":{"tags":["Core"],"summary":"Get specific client","description":"Retrieve detailed information about a specific client.\n\nConditional validation rules:\n- If clientId (path parameter) is provided, platformClientId and platform are optional\n- If clientId (path parameter) is empty, both platformClientId and platform are required\n","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"},{"name":"clientId","in":"path","required":true,"schema":{"type":"string"},"description":"The ID of the client to retrieve"},{"name":"platformClientId","in":"query","required":false,"schema":{"type":"string"},"description":"Platform-specific client ID (required if clientId is empty)"},{"name":"platform","in":"query","required":false,"schema":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"]},"description":"Platform type (required if clientId is empty)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretRequest"}}}},"responses":{"200":{"description":"Client information retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 取得會員點數

## Get client points

> Retrieve the total available points for multiple clients.\
> \
> Conditional validation rules:\
> \- Can provide 'clientIds' for encoded client IDs\
> \- Can provide both 'platform' and 'platformClientIds' for platform-specific client lookup\
> \- At least one of clientIds or (platform + platformClientIds) must be provided<br>

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"Client Points & Gifts","description":"Client points and gifts management"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"ClientPointsRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"clientIds":{"type":"array","items":{"type":"string"},"maxItems":100,"description":"Array of encoded client IDs (maximum 100 items)"},"platform":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"],"description":"Platform type (required if platformClientIds provided)"},"platformClientIds":{"type":"array","items":{"type":"string"},"maxItems":100,"description":"Array of platform-specific client IDs (maximum 100 items, required if platform provided)"}},"required":["secret"],"description":"Client identification rules:\n- Can provide 'clientIds' for encoded client IDs\n- Can provide both 'platform' and 'platformClientIds' for platform-specific client lookup\n- At least one of clientIds or (platform + platformClientIds) must be provided\n"},"ClientPointsResponse":{"allOf":[{"$ref":"#/components/schemas/BasicSuccessResponse"},{"type":"object","properties":{"points":{"type":"array","items":{"$ref":"#/components/schemas/ClientPointInfo"},"description":"Array of client points information"}}}]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ClientPointInfo":{"type":"object","properties":{"platform":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"],"description":"Platform type"},"clientId":{"type":"string","description":"Encoded client ID (present when queried by clientIds)"},"platformClientId":{"type":"string","description":"Platform-specific client ID (present when queried by platformClientIds)"},"points":{"type":"integer","description":"Total available client points"}},"required":["platform","points"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/client/point":{"post":{"tags":["Client Points & Gifts"],"summary":"Get client points","description":"Retrieve the total available points for multiple clients.\n\nConditional validation rules:\n- Can provide 'clientIds' for encoded client IDs\n- Can provide both 'platform' and 'platformClientIds' for platform-specific client lookup\n- At least one of clientIds or (platform + platformClientIds) must be provided\n","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientPointsRequest"}}}},"responses":{"200":{"description":"Client points retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientPointsResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 清空會員點數

## Clear client points

> Clear all points for multiple clients. This operation will delete all client point records for the specified clients.\
> \
> Conditional validation rules:\
> \- Can provide 'clientIds' for encoded client IDs\
> \- Can provide both 'platform' and 'platformClientIds' for platform-specific client lookup\
> \- At least one of clientIds or (platform + platformClientIds) must be provided<br>

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"Client Points & Gifts","description":"Client points and gifts management"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"ClientPointsRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"clientIds":{"type":"array","items":{"type":"string"},"maxItems":100,"description":"Array of encoded client IDs (maximum 100 items)"},"platform":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"],"description":"Platform type (required if platformClientIds provided)"},"platformClientIds":{"type":"array","items":{"type":"string"},"maxItems":100,"description":"Array of platform-specific client IDs (maximum 100 items, required if platform provided)"}},"required":["secret"],"description":"Client identification rules:\n- Can provide 'clientIds' for encoded client IDs\n- Can provide both 'platform' and 'platformClientIds' for platform-specific client lookup\n- At least one of clientIds or (platform + platformClientIds) must be provided\n"},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/client/point":{"delete":{"tags":["Client Points & Gifts"],"summary":"Clear client points","description":"Clear all points for multiple clients. This operation will delete all client point records for the specified clients.\n\nConditional validation rules:\n- Can provide 'clientIds' for encoded client IDs\n- Can provide both 'platform' and 'platformClientIds' for platform-specific client lookup\n- At least one of clientIds or (platform + platformClientIds) must be provided\n","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientPointsRequest"}}}},"responses":{"200":{"description":"Client points cleared successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 取得會員獎項

## Get client gifts

> Retrieve all gifts (virtual, physical, and tickets) for a specific client.\
> \
> Gift types:\
> \- \*\*Virtual Gifts\*\*: Virtual type gifts\
> \- \*\*Physical Gifts\*\*: Physical type gifts\
> \- \*\*Tickets\*\*: Coupons (default gift) that are unused\
> \
> Conditional validation rules:\
> \- Either provide 'clientId' OR both 'platform' and 'platformClientId'<br>

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"Client Points & Gifts","description":"Client points and gifts management"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"ClientIdentificationRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"clientId":{"type":"string","description":"The client ID (required if platform + platformClientId not provided)"},"platform":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"],"description":"Platform type (required if platformClientId provided)"},"platformClientId":{"type":"string","description":"Platform-specific client ID (required if clientId not provided)"}},"required":["secret"],"description":"Client identification rules:\n- Either provide 'clientId' OR both 'platform' and 'platformClientId'\n"},"ClientGiftsResponse":{"allOf":[{"$ref":"#/components/schemas/BasicSuccessResponse"},{"type":"object","properties":{"tickets":{"type":"array","description":"Ticket gifts (default type unused coupons)","items":{"$ref":"#/components/schemas/TicketGift"}},"physicalGifts":{"type":"array","description":"Physical type gifts","items":{"$ref":"#/components/schemas/GiftItem"}},"virtualGifts":{"type":"array","description":"Virtual gifts (non-default virtual gifts)","items":{"$ref":"#/components/schemas/GiftItem"}}}}]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"TicketGift":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","description":"Ticket creation timestamp"}},"required":["createdAt"]},"GiftItem":{"type":"object","properties":{"name":{"type":"string","description":"Gift name"},"resource":{"type":"string","description":"Gift resource type","enum":["lotteryGame","rewardsCard","unknown"]},"createdAt":{"type":"string","format":"date-time","description":"Gift creation timestamp"},"isExpired":{"type":"boolean","description":"Whether the virtual gift is expired (outside valid time range)"},"startTime":{"type":"string","format":"date-time","description":"Gift valid start time (only present when isExpired is true)"},"endTime":{"type":"string","format":"date-time","description":"Gift valid end time (only present when isExpired is true)"}},"required":["name","resource","createdAt","isExpired"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/client/gift":{"post":{"tags":["Client Points & Gifts"],"summary":"Get client gifts","description":"Retrieve all gifts (virtual, physical, and tickets) for a specific client.\n\nGift types:\n- **Virtual Gifts**: Virtual type gifts\n- **Physical Gifts**: Physical type gifts\n- **Tickets**: Coupons (default gift) that are unused\n\nConditional validation rules:\n- Either provide 'clientId' OR both 'platform' and 'platformClientId'\n","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"},{"name":"platformClientId","in":"query","required":false,"schema":{"type":"string"},"description":"Platform-specific client ID (required if clientId not provided in body)"},{"name":"platform","in":"query","required":false,"schema":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"]},"description":"Platform type (required if platformClientId provided)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientIdentificationRequest"}}}},"responses":{"200":{"description":"Client gifts retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientGiftsResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 取得會員分析數據

## Get client analysis

> Retrieve client analysis data including followers, blocks, message numbers, and tag coverage rates.\
> \
> Platform filtering:\
> \- If platform is not specified, returns data for all platforms\
> \- If platform is specified, returns data only for that platform\
> \
> Supported platforms: line, facebook, instagram, liveChat, whatsapp

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"Core","description":"Core OpenAPI functionality for customer management and broadcasting"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"ClientAnalysisRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"platform":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"],"description":"Platform type for filtering (optional, if not provided returns all platforms)"}},"required":["secret"]},"ClientAnalysisResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"clientAnalysis":{"type":"object","description":"Client analysis data. Fields returned depend on the platform parameter:\n- If platform is not specified or 'all': Returns data for all platforms plus totals\n- If platform is specified: Returns data only for that platform","properties":{"lineFollowers":{"type":"integer","description":"Number of LINE followers (returned when platform is 'line' or not specified)"},"lineBlocks":{"type":"integer","description":"Number of LINE blocks (returned when platform is 'line' or not specified)"},"lineGenders":{"type":"array","description":"LINE gender demographics data (returned when platform is 'line' or not specified)","items":{"type":"object","properties":{"name":{"type":"string","description":"Gender name in Chinese"},"percentage":{"type":"number","format":"float","description":"Percentage of users in this gender category"}}}},"lineAges":{"type":"array","description":"LINE age demographics data (returned when platform is 'line' or not specified)","items":{"type":"object","properties":{"name":{"type":"string","description":"Age range in Chinese"},"percentage":{"type":"number","format":"float","description":"Percentage of users in this age range"}}}},"lineAreas":{"type":"array","description":"LINE area demographics data (returned when platform is 'line' or not specified)","items":{"type":"object","properties":{"name":{"type":"string","description":"Area name in Chinese"},"percentage":{"type":"number","format":"float","description":"Percentage of users in this area"}}}},"lineAppTypes":{"type":"array","description":"LINE app types data (returned when platform is 'line' or not specified)","items":{"type":"object","properties":{"name":{"type":"string","description":"App type name in Chinese"},"percentage":{"type":"number","format":"float","description":"Percentage of users using this app type"}}}},"lineMessageNumbers":{"type":"integer","description":"Number of LINE messages (returned when platform is 'line' or not specified)"},"lineIsIntegration":{"type":"boolean","description":"LINE integration status (returned when platform is 'line' or not specified)"},"lineTagCoverRate":{"type":"number","format":"float","description":"LINE tag coverage rate (returned when platform is 'line' or not specified)"},"fbFollowers":{"type":"integer","description":"Number of Facebook followers (returned when platform is 'facebook' or not specified)"},"fbBlocks":{"type":"integer","description":"Number of Facebook blocks (returned when platform is 'facebook' or not specified)"},"fbMessageNumbers":{"type":"integer","description":"Number of Facebook messages (returned when platform is 'facebook' or not specified)"},"fbIsIntegration":{"type":"boolean","description":"Facebook integration status (returned when platform is 'facebook' or not specified)"},"fbTagCoverRate":{"type":"number","format":"float","description":"Facebook tag coverage rate (returned when platform is 'facebook' or not specified)"},"igFollowers":{"type":"integer","description":"Number of Instagram followers (returned when platform is 'instagram' or not specified)"},"igMessageNumbers":{"type":"integer","description":"Number of Instagram messages (returned when platform is 'instagram' or not specified)"},"igIsIntegration":{"type":"boolean","description":"Instagram integration status (returned when platform is 'instagram' or not specified)"},"igTagCoverRate":{"type":"number","format":"float","description":"Instagram tag coverage rate (returned when platform is 'instagram' or not specified)"},"liveChatFollowers":{"type":"integer","description":"Number of LiveChat followers (returned when platform is 'liveChat' or not specified)"},"liveChatMessageNumbers":{"type":"integer","description":"Number of LiveChat messages (returned when platform is 'liveChat' or not specified)"},"liveChatIsIntegration":{"type":"boolean","description":"LiveChat integration status (returned when platform is 'liveChat' or not specified)"},"liveChatTagCoverRate":{"type":"number","format":"float","description":"LiveChat tag coverage rate (returned when platform is 'liveChat' or not specified)"},"whatsappFollowers":{"type":"integer","description":"Number of WhatsApp followers (returned when platform is 'whatsapp' or not specified)"},"whatsappMessageNumbers":{"type":"integer","description":"Number of WhatsApp messages (returned when platform is 'whatsapp' or not specified)"},"whatsappIsIntegration":{"type":"boolean","description":"WhatsApp integration status (returned when platform is 'whatsapp' or not specified)"},"whatsappTagCoverRate":{"type":"number","format":"float","description":"WhatsApp tag coverage rate (returned when platform is 'whatsapp' or not specified)"},"botTotallFollowers":{"type":"integer","description":"Total followers across all platforms (only returned when platform is not specified)"},"botTotallBlocks":{"type":"integer","description":"Total blocks across all platforms (only returned when platform is not specified)"},"botTotallMessages":{"type":"integer","description":"Total messages across all platforms (only returned when platform is not specified)"}}}}},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"GetOpenApiError":{"description":"OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/clients/analysis":{"post":{"tags":["Core"],"summary":"Get client analysis","description":"Retrieve client analysis data including followers, blocks, message numbers, and tag coverage rates.\n\nPlatform filtering:\n- If platform is not specified, returns data for all platforms\n- If platform is specified, returns data only for that platform\n\nSupported platforms: line, facebook, instagram, liveChat, whatsapp","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientAnalysisRequest"}}}},"responses":{"200":{"description":"Client analysis data retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientAnalysisResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"$ref":"#/components/responses/GetOpenApiError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 取得會員分析圖表

## Get client statistics

> Retrieve time-series client statistics data with date and count information.\
> \
> Default time range: Last 7 days if startTime and endTime are not provided\
> \
> \*\*Time range limitations:\*\*\
> \- Maximum time range is limited to 1 year (365 days)\
> \- If the time range exceeds 1 year, the system will automatically adjust the startTime to be 365 days before the endTime\
> \- The endTime will remain unchanged to preserve the user's specified end date\
> \
> Platform filtering:\
> \- If platform is not specified, returns data for all platforms\
> \- If platform is specified, returns data only for that platform\
> \
> Supported platforms: line, facebook, instagram, liveChat, whatsapp\
> \
> Response format: Arrays of objects with date and count properties

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"Core","description":"Core OpenAPI functionality for customer management and broadcasting"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"ClientStatisticsRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"platform":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"],"description":"Platform type for filtering (optional, if not provided returns all platforms)"},"startTime":{"type":"string","format":"date","description":"Start date for statistics range (optional, defaults to 7 days ago if not provided). Note - If the time range exceeds 365 days, startTime will be automatically adjusted to be 365 days before endTime."},"endTime":{"type":"string","format":"date","description":"End date for statistics range (optional, defaults to today if not provided). This date will be preserved even if the time range exceeds 365 days."},"type":{"type":"string","default":"follower","description":"Statistics type","enum":["follower","block","newFollower","interactionFollower"]}},"required":["secret","type"]},"ClientStatisticsResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"clientStatistics":{"type":"object","description":"Time-series client statistics data. Fields returned depend on platform and type parameters:\n- Platform: Determines which platform statistics are included (all platforms if not specified)\n- Type: Filters to specific statistic types (follower, block, newFollower, interactionFollower)\n\nEach array contains objects with date and count properties for the specified time range.","properties":{"lineFollowers":{"type":"array","description":"Daily LINE follower counts (returned when platform='line' or not specified, and type='follower' or not specified)","items":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"Date in YYYY-MM-DD format"},"count":{"type":"integer","description":"Follower count for this date"}}}},"lineNewFollowers":{"type":"array","description":"Daily LINE new follower counts (returned when platform='line' or not specified, and type='newFollower' or not specified)","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}},"lineBlocks":{"type":"array","description":"Daily LINE block counts (returned when platform='line' or not specified, and type='block')","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}},"lineInteractionFollowers":{"type":"array","description":"Daily LINE interaction follower counts (returned when platform='line' or not specified, and type='interactionFollower')","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}},"fbFollowers":{"type":"array","description":"Daily Facebook follower counts (returned when platform='facebook' or not specified, and type='follower' or not specified)","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}},"fbNewFollowers":{"type":"array","description":"Daily Facebook new follower counts (returned when platform='facebook' or not specified, and type='newFollower' or not specified)","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}},"fbBlocks":{"type":"array","description":"Daily Facebook block counts (returned when platform='facebook' or not specified, and type='block')","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}},"fbInteractionFollowers":{"type":"array","description":"Daily Facebook interaction follower counts (returned when platform='facebook' or not specified, and type='interactionFollower')","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}},"igFollowers":{"type":"array","description":"Daily Instagram follower counts (returned when platform='instagram' or not specified, and type='follower' or not specified)","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}},"igNewFollowers":{"type":"array","description":"Daily Instagram new follower counts (returned when platform='instagram' or not specified, and type='newFollower' or not specified)","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}},"igInteractionFollowers":{"type":"array","description":"Daily Instagram interaction follower counts (returned when platform='instagram' or not specified, and type='interactionFollower')","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}},"liveChatFollowers":{"type":"array","description":"Daily LiveChat follower counts (returned when platform='liveChat' or not specified, and type='follower' or not specified)","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}},"liveChatNewFollowers":{"type":"array","description":"Daily LiveChat new follower counts (returned when platform='liveChat' or not specified, and type='newFollower' or not specified)","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}},"liveChatInteractionFollowers":{"type":"array","description":"Daily LiveChat interaction follower counts (returned when platform='liveChat' or not specified, and type='interactionFollower')","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}},"whatsappFollowers":{"type":"array","description":"Daily WhatsApp follower counts (returned when platform='whatsapp' or not specified, and type='follower' or not specified)","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}},"whatsappNewFollowers":{"type":"array","description":"Daily WhatsApp new follower counts (returned when platform='whatsapp' or not specified, and type='newFollower' or not specified)","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}},"whatsappInteractionFollowers":{"type":"array","description":"Daily WhatsApp interaction follower counts (returned when platform='whatsapp' or not specified, and type='interactionFollower')","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}},"totalFollowers":{"type":"array","description":"Daily total follower counts across all platforms (only returned when platform is not specified and type='follower' or not specified)","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}},"totalNewFollowers":{"type":"array","description":"Daily total new follower counts across all platforms (only returned when platform is not specified and type='newFollower' or not specified)","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}},"totalBlocks":{"type":"array","description":"Daily total block counts across all platforms (only returned when platform is not specified and type='block')","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}},"totalInteractionFollowers":{"type":"array","description":"Daily total interaction follower counts across all platforms (only returned when platform is not specified and type='interactionFollower')","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}}}}}}}},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"GetOpenApiError":{"description":"OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/clients/statistics":{"post":{"tags":["Core"],"summary":"Get client statistics","description":"Retrieve time-series client statistics data with date and count information.\n\nDefault time range: Last 7 days if startTime and endTime are not provided\n\n**Time range limitations:**\n- Maximum time range is limited to 1 year (365 days)\n- If the time range exceeds 1 year, the system will automatically adjust the startTime to be 365 days before the endTime\n- The endTime will remain unchanged to preserve the user's specified end date\n\nPlatform filtering:\n- If platform is not specified, returns data for all platforms\n- If platform is specified, returns data only for that platform\n\nSupported platforms: line, facebook, instagram, liveChat, whatsapp\n\nResponse format: Arrays of objects with date and count properties","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientStatisticsRequest"}}}},"responses":{"200":{"description":"Client statistics data retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientStatisticsResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"$ref":"#/components/responses/GetOpenApiError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 用戶推播

用戶推播有兩種方式可以使用，依據使用環境來選擇適用的推播

## Send broadcast message

> Send broadcast messages to customers

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"Core","description":"Core OpenAPI functionality for customer management and broadcasting"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"BroadcastRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"intentId":{"type":"string","description":"Intent identifier for the broadcast (required if message is empty)"},"message":{"type":"string","description":"Message content to broadcast (required if intentId is empty)"},"clientIds":{"type":"array","items":{"type":"string"},"description":"Array of platform UUIDs to send the broadcast to"},"platform":{"type":"string","enum":["line","facebook","instagram","whatsapp"],"description":"Platform to send the broadcast on (required)"},"fbTag":{"type":"string","description":"Facebook tag for the broadcast (required when platform is 'facebook')"},"name":{"type":"string","description":"Name of this broadcast"}},"required":["secret","platform","name"],"description":"Additional validation rules:\n- Either intentId or message must be provided (cannot both be empty)\n- fbTag is required when platform is 'facebook'\n"},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/broadcast":{"post":{"tags":["Core"],"summary":"Send broadcast message","description":"Send broadcast messages to customers","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastRequest"}}}},"responses":{"200":{"description":"Broadcast sent successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"description":"Permission or broadcast creation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 設定webview網址

根據傳入的參數來設定用戶機器人的webview網址

## Set customer webview URL

> Configure the webview URL for customer interactions

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"Core","description":"Core OpenAPI functionality for customer management and broadcasting"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"WebviewRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"url":{"type":"string","format":"uri","description":"The webview URL to set"},"platform":{"type":"string","enum":["line","facebook"],"description":"Platform for the webview (line or facebook)"},"type":{"type":"string","description":"webview type include full, tall and compact"}},"required":["secret","url","platform"]},"SuccessResponse":{"allOf":[{"$ref":"#/components/schemas/BasicSuccessResponse"},{"type":"object","properties":{"customerWebviewUrl":{"type":"string","format":"uri"}}}]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"GetOpenApiError":{"description":"OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/set/webview":{"post":{"tags":["Core"],"summary":"Set customer webview URL","description":"Configure the webview URL for customer interactions","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebviewRequest"}}}},"responses":{"200":{"description":"Webview URL set successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"$ref":"#/components/responses/GetOpenApiError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 設定回呼網址

根據傳入的參數來設定用戶機器人的回呼網址

## Set customer callback URL

> Configure the callback URL for customer notifications

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"Core","description":"Core OpenAPI functionality for customer management and broadcasting"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"CallbackRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"callback":{"type":"string","format":"uri","description":"The callback URL to set"}},"required":["secret","callback"]},"CallbackResponse":{"allOf":[{"$ref":"#/components/schemas/BasicSuccessResponse"},{"type":"object","properties":{"customerCallbackUrl":{"type":"string","format":"uri"}}}]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"GetOpenApiError":{"description":"OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/set/callback":{"post":{"tags":["Core"],"summary":"Set customer callback URL","description":"Configure the callback URL for customer notifications","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"},{"name":"customerCallbackUrl","in":"query","required":true,"schema":{"type":"string","format":"uri"},"description":"The callback URL to set for the customer"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallbackRequest"}}}},"responses":{"200":{"description":"Callback URL set successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallbackResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"$ref":"#/components/responses/GetOpenApiError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# Open API Token與Secret Key換發

## Get OpenAPI token

> Generate or retrieve OpenAPI authentication token and secret

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"Core","description":"Core OpenAPI functionality for customer management and broadcasting"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"SecretRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"}},"required":["secret"]},"TokenResponse":{"allOf":[{"$ref":"#/components/schemas/BasicSuccessResponse"},{"type":"object","properties":{"apiToken":{"type":"string","description":"API authentication token"},"apiSecret":{"type":"string","description":"API secret key"}}}]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/token":{"post":{"tags":["Core"],"summary":"Get OpenAPI token","description":"Generate or retrieve OpenAPI authentication token and secret","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretRequest"}}}},"responses":{"200":{"description":"OpenAPI token information retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 自動標籤


# 建立自動標籤

## Create auto tag

> Create a new auto tag for automatic client categorization

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"AutoTags","description":"Automated tagging system for clients"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"CreateAutoTagRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"name":{"type":"string","description":"The name of the auto tag"}},"required":["secret","name"]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"GetOpenApiError":{"description":"OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/autoTag":{"post":{"tags":["AutoTags"],"summary":"Create auto tag","description":"Create a new auto tag for automatic client categorization","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAutoTagRequest"}}}},"responses":{"200":{"description":"Auto tag created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"$ref":"#/components/responses/GetOpenApiError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 列出自動標籤

## List auto tags

> Retrieve a list of all auto tags with pagination and status information

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"AutoTags","description":"Automated tagging system for clients"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"SecretRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"}},"required":["secret"]},"AutoTagListResponse":{"allOf":[{"$ref":"#/components/schemas/BasicSuccessResponse"},{"type":"object","properties":{"autoTagList":{"type":"array","items":{"$ref":"#/components/schemas/AutoTag"}},"pagination":{"$ref":"#/components/schemas/Pagination"},"isAllActiveConfidence":{"type":"boolean","description":"Whether all auto tags have active confidence"},"isAllActiveLifeCycle":{"type":"boolean","description":"Whether all auto tags have active lifecycle"}}}]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"AutoTag":{"type":"object","properties":{"id":{"type":"string","description":"Auto tag unique identifier"},"name":{"type":"string","description":"Auto tag name"},"confidence":{"type":"number","format":"float","description":"Confidence level for auto tagging"},"lifeCycle":{"type":"string","description":"Lifecycle stage of the auto tag"},"isActive":{"type":"boolean","description":"Whether the auto tag is active"}}},"Pagination":{"type":"object","properties":{"totalPages":{"type":"integer","description":"Total number of pages"},"currentPage":{"type":"integer","description":"Current page number"},"hasPre":{"type":"boolean","description":"Whether there is a previous page"},"hasNext":{"type":"boolean","description":"Whether there is a next page"}}},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"GetOpenApiError":{"description":"OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/autoTags/list":{"post":{"tags":["AutoTags"],"summary":"List auto tags","description":"Retrieve a list of all auto tags with pagination and status information","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1},"description":"Page number for pagination"},{"name":"perpage","in":"query","required":false,"schema":{"type":"integer","default":10},"description":"Number of items per page"},{"name":"search","in":"query","required":false,"schema":{"type":"string","default":""},"description":"Search term for filtering results"},{"name":"sorting","in":"query","required":false,"schema":{"type":"string","enum":["ASC","DESC"],"default":"ASC"},"description":"Sort order (ASC or DESC)"},{"name":"sortingType","in":"query","required":false,"schema":{"type":"string","enum":["updateAt","clientCount"],"default":"updateAt"},"description":"Field to sort by (updateAt, clientCount, createdAt, name)"},{"name":"platform","in":"query","required":false,"schema":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"]},"description":"Platform filter (line, facebook, instagram, liveChat, whatsapp)"},{"name":"startTime","in":"query","required":false,"schema":{"type":"string","default":""},"description":"Start time for date range filter"},{"name":"endTime","in":"query","required":false,"schema":{"type":"string","default":""},"description":"End time for date range filter"},{"name":"isCountByPlatform","in":"query","required":false,"schema":{"type":"boolean","default":true},"description":"Whether to count by platform"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretRequest"}}}},"responses":{"200":{"description":"Auto tags list retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTagListResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"$ref":"#/components/responses/GetOpenApiError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 取得自動標籤

## Get specific auto tag

> Retrieve detailed information about a specific auto tag

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"AutoTags","description":"Automated tagging system for clients"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"SecretRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"}},"required":["secret"]},"AutoTagResponse":{"allOf":[{"$ref":"#/components/schemas/BasicSuccessResponse"},{"type":"object","properties":{"autoTag":{"$ref":"#/components/schemas/AutoTag"}}}]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"AutoTag":{"type":"object","properties":{"id":{"type":"string","description":"Auto tag unique identifier"},"name":{"type":"string","description":"Auto tag name"},"confidence":{"type":"number","format":"float","description":"Confidence level for auto tagging"},"lifeCycle":{"type":"string","description":"Lifecycle stage of the auto tag"},"isActive":{"type":"boolean","description":"Whether the auto tag is active"}}},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/autoTag/get/{autoTagId}":{"post":{"tags":["AutoTags"],"summary":"Get specific auto tag","description":"Retrieve detailed information about a specific auto tag","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"},{"name":"autoTagId","in":"path","required":true,"schema":{"type":"string"},"description":"The ID of the auto tag to retrieve"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretRequest"}}}},"responses":{"200":{"description":"Auto tag information retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTagResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"description":"Auto tag or OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 編輯自動標籤名稱

## Update auto tag

> Update auto tag name and properties

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"AutoTags","description":"Automated tagging system for clients"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"UpdateAutoTagRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"name":{"type":"string","description":"The new name for the auto tag"}},"required":["secret","name"]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"GetOpenApiError":{"description":"OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/autoTag/update/{autoTagId}":{"post":{"tags":["AutoTags"],"summary":"Update auto tag","description":"Update auto tag name and properties","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"},{"name":"autoTagId","in":"path","required":true,"schema":{"type":"string"},"description":"The ID of the auto tag to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAutoTagRequest"}}}},"responses":{"200":{"description":"Auto tag updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"$ref":"#/components/responses/GetOpenApiError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 編輯單一自動標籤的生命週期

## Update auto tag lifecycle

> Update lifecycle settings for a specific auto tag

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"AutoTags","description":"Automated tagging system for clients"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"UpdateAutoTagLifeCycleRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"isActive":{"type":"boolean","description":"Whether lifecycle feature should be active"},"lifeCycle":{"type":"integer","minimum":1,"description":"Lifecycle duration/threshold value (must be > 0 for feature to be active)"}},"required":["secret","isActive","lifeCycle"]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"GetOpenApiError":{"description":"OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/autoTag/lifeCycle/update/{autoTagId}":{"post":{"tags":["AutoTags"],"summary":"Update auto tag lifecycle","description":"Update lifecycle settings for a specific auto tag","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"},{"name":"autoTagId","in":"path","required":true,"schema":{"type":"string"},"description":"The ID of the auto tag to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAutoTagLifeCycleRequest"}}}},"responses":{"200":{"description":"Auto tag lifecycle updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"$ref":"#/components/responses/GetOpenApiError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 編輯單一自動標籤的信心指數

## Toggle auto tag confidence

> Toggle confidence status for a specific auto tag (enable/disable)

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"AutoTags","description":"Automated tagging system for clients"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"SecretRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"}},"required":["secret"]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"GetOpenApiError":{"description":"OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/autoTag/confidence/update/{autoTagId}":{"post":{"tags":["AutoTags"],"summary":"Toggle auto tag confidence","description":"Toggle confidence status for a specific auto tag (enable/disable)","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"},{"name":"autoTagId","in":"path","required":true,"schema":{"type":"string"},"description":"The ID of the auto tag to toggle"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretRequest"}}}},"responses":{"200":{"description":"Auto tag confidence updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"$ref":"#/components/responses/GetOpenApiError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 編輯所有自動標籤的生命週期

## Update all auto tags lifecycle

> Update lifecycle status for all auto tags (enable/disable)

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"AutoTags","description":"Automated tagging system for clients"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"UpdateAllAutoTagLifeCycleRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"isActive":{"type":"boolean","description":"Set lifecycle status for all auto tags"}},"required":["secret","isActive"]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"GetOpenApiError":{"description":"OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/autoTags/lifeCycle/updateAll":{"post":{"tags":["AutoTags"],"summary":"Update all auto tags lifecycle","description":"Update lifecycle status for all auto tags (enable/disable)","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAllAutoTagLifeCycleRequest"}}}},"responses":{"200":{"description":"All auto tags lifecycle updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"$ref":"#/components/responses/GetOpenApiError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 編輯所有自動標籤的信心指數

## Update all auto tags confidence

> Update confidence status for all auto tags (enable/disable)

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"AutoTags","description":"Automated tagging system for clients"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"UpdateAllAutoTagConfidenceRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"isActive":{"type":"boolean","description":"Set confidence status for all auto tags"}},"required":["secret","isActive"]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"GetOpenApiError":{"description":"OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/autoTags/confidence/updateAll":{"post":{"tags":["AutoTags"],"summary":"Update all auto tags confidence","description":"Update confidence status for all auto tags (enable/disable)","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAllAutoTagConfidenceRequest"}}}},"responses":{"200":{"description":"All auto tags confidence updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"$ref":"#/components/responses/GetOpenApiError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 刪除自動標籤


# 給使用者貼上指定標籤

## Create auto tag mapping

> Create a mapping between auto tags and clients

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"AutoTags","description":"Automated tagging system for clients"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"AutoTagMappingRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"autoTagId":{"type":"string","description":"The auto tag ID"},"clientId":{"type":"string","description":"The client ID (required if platform + platformClientId not provided)"},"platform":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"],"description":"Platform type (required if platformClientId provided)"},"platformClientId":{"type":"string","description":"Platform-specific client ID (required if clientId not provided)"}},"required":["secret","autoTagId"],"description":"Client identification rules:\n- Either provide 'clientId' OR both 'platform' and 'platformClientId'\n"},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"GetOpenApiError":{"description":"OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/autoTagMapping":{"post":{"tags":["AutoTags"],"summary":"Create auto tag mapping","description":"Create a mapping between auto tags and clients","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTagMappingRequest"}}}},"responses":{"200":{"description":"Auto tag mapping created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"$ref":"#/components/responses/GetOpenApiError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 給使用者刪除指定標籤

## Delete auto tag mapping

> Remove an auto tag mapping and update client count

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"AutoTags","description":"Automated tagging system for clients"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"AutoTagMappingRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"autoTagId":{"type":"string","description":"The auto tag ID"},"clientId":{"type":"string","description":"The client ID (required if platform + platformClientId not provided)"},"platform":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"],"description":"Platform type (required if platformClientId provided)"},"platformClientId":{"type":"string","description":"Platform-specific client ID (required if clientId not provided)"}},"required":["secret","autoTagId"],"description":"Client identification rules:\n- Either provide 'clientId' OR both 'platform' and 'platformClientId'\n"},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"GetOpenApiError":{"description":"OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/autoTagMapping/delete":{"post":{"tags":["AutoTags"],"summary":"Delete auto tag mapping","description":"Remove an auto tag mapping and update client count","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTagMappingRequest"}}}},"responses":{"200":{"description":"Auto tag mapping deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"$ref":"#/components/responses/GetOpenApiError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 手動標籤


# 建立手動標籤

## Create client tag

> Create a new client tag for bot client categorization

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"ClientTags","description":"Client tags management and mapping"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"CreateClientTagRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"name":{"type":"string","description":"The name of the client tag"}},"required":["secret","name"]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/clientTag":{"post":{"tags":["ClientTags"],"summary":"Create client tag","description":"Create a new client tag for bot client categorization","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateClientTagRequest"}}}},"responses":{"200":{"description":"Client tag created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"description":"Permission denied or client tag creation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"OpenAPI configuration not found or tag query failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 列出手動標籤

## List client tags

> Retrieve a list of all client tags with pagination

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"ClientTags","description":"Client tags management and mapping"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"SecretRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"}},"required":["secret"]},"ClientTagListResponse":{"allOf":[{"$ref":"#/components/schemas/BasicSuccessResponse"},{"type":"object","properties":{"clientTagList":{"type":"array","items":{"$ref":"#/components/schemas/ClientTag"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ClientTag":{"type":"object","properties":{"id":{"type":"string","description":"Client tag unique identifier"},"name":{"type":"string","description":"Client tag name"},"botId":{"type":"string","description":"Associated bot ID"}}},"Pagination":{"type":"object","properties":{"totalPages":{"type":"integer","description":"Total number of pages"},"currentPage":{"type":"integer","description":"Current page number"},"hasPre":{"type":"boolean","description":"Whether there is a previous page"},"hasNext":{"type":"boolean","description":"Whether there is a next page"}}},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/clientTags/list":{"post":{"tags":["ClientTags"],"summary":"List client tags","description":"Retrieve a list of all client tags with pagination","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1},"description":"Page number for pagination"},{"name":"perpage","in":"query","required":false,"schema":{"type":"integer","default":10},"description":"Number of items per page"},{"name":"search","in":"query","required":false,"schema":{"type":"string","default":""},"description":"Search term for filtering results"},{"name":"sorting","in":"query","required":false,"schema":{"type":"string","enum":["ASC","DESC"],"default":"ASC"},"description":"Sort order (ASC or DESC)"},{"name":"sortingType","in":"query","required":false,"schema":{"type":"string","enum":["updateAt","clientCount"],"default":"updateAt"},"description":"Field to sort by (updateAt, clientCount, createdAt, name)"},{"name":"platform","in":"query","required":false,"schema":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"]},"description":"Platform filter (line, facebook, instagram, liveChat, whatsapp)"},{"name":"startTime","in":"query","required":false,"schema":{"type":"string","default":""},"description":"Start time for date range filter"},{"name":"endTime","in":"query","required":false,"schema":{"type":"string","default":""},"description":"End time for date range filter"},{"name":"isCountByPlatform","in":"query","required":false,"schema":{"type":"boolean","default":true},"description":"Whether to count by platform"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretRequest"}}}},"responses":{"200":{"description":"Client tags list retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientTagListResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"description":"OpenAPI configuration not found or client tags list retrieval failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 取得手動標籤

## Get specific client tag

> Retrieve detailed information about a specific client tag

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"ClientTags","description":"Client tags management and mapping"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"SecretRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"}},"required":["secret"]},"ClientTagResponse":{"allOf":[{"$ref":"#/components/schemas/BasicSuccessResponse"},{"type":"object","properties":{"clientTag":{"$ref":"#/components/schemas/ClientTag"}}}]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ClientTag":{"type":"object","properties":{"id":{"type":"string","description":"Client tag unique identifier"},"name":{"type":"string","description":"Client tag name"},"botId":{"type":"string","description":"Associated bot ID"}}},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/clientTag/get/{tagId}":{"post":{"tags":["ClientTags"],"summary":"Get specific client tag","description":"Retrieve detailed information about a specific client tag","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"},{"name":"tagId","in":"path","required":true,"schema":{"type":"string"},"description":"The ID of the client tag to retrieve"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretRequest"}}}},"responses":{"200":{"description":"Client tag information retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientTagResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"description":"OpenAPI configuration not found or client tag not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 編輯手動標籤名稱

## Update client tag

> Update client tag name and properties

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"ClientTags","description":"Client tags management and mapping"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"UpdateClientTagRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"name":{"type":"string","description":"The new name for the client tag"}},"required":["secret","name"]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/clientTag/update/{tagId}":{"post":{"tags":["ClientTags"],"summary":"Update client tag","description":"Update client tag name and properties","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"},{"name":"tagId","in":"path","required":true,"schema":{"type":"string"},"description":"The ID of the client tag to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateClientTagRequest"}}}},"responses":{"200":{"description":"Client tag updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"description":"Permission denied or client tag update failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"OpenAPI configuration not found or client tag not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 刪除手動標籤

## Delete client tag

> Remove a client tag from the system

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"ClientTags","description":"Client tags management and mapping"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"SecretRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"}},"required":["secret"]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/clientTag/delete/{tagId}":{"post":{"tags":["ClientTags"],"summary":"Delete client tag","description":"Remove a client tag from the system","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"},{"name":"tagId","in":"path","required":true,"schema":{"type":"string"},"description":"The ID of the client tag to delete"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretRequest"}}}},"responses":{"200":{"description":"Client tag deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"description":"Permission denied or client tag deletion failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"OpenAPI configuration not found or client tag not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 給使用者貼上指定標籤

## Create client tag mapping

> Create a mapping between client tags and clients

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"ClientTags","description":"Client tags management and mapping"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"ClientTagMappingRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"tagId":{"type":"string","description":"The client tag ID"},"clientId":{"type":"string","description":"The client ID (required if platform + platformClientId not provided)"},"platform":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"],"description":"Platform type (required if platformClientId provided)"},"platformClientId":{"type":"string","description":"Platform-specific client ID (required if clientId not provided)"}},"required":["secret","tagId"],"description":"Client identification rules:\n- Either provide 'clientId' OR both 'platform' and 'platformClientId'\n"},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/clientTagMapping":{"post":{"tags":["ClientTags"],"summary":"Create client tag mapping","description":"Create a mapping between client tags and clients","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientTagMappingRequest"}}}},"responses":{"200":{"description":"Client tag mapping created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"description":"Permission denied or client tag mapping creation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"OpenAPI configuration not found, client not found, or missing required fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 給使用者刪除指定標籤

## Delete client tag mapping

> Remove a client tag mapping

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"ClientTags","description":"Client tags management and mapping"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"ClientTagMappingRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"tagId":{"type":"string","description":"The client tag ID"},"clientId":{"type":"string","description":"The client ID (required if platform + platformClientId not provided)"},"platform":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"],"description":"Platform type (required if platformClientId provided)"},"platformClientId":{"type":"string","description":"Platform-specific client ID (required if clientId not provided)"}},"required":["secret","tagId"],"description":"Client identification rules:\n- Either provide 'clientId' OR both 'platform' and 'platformClientId'\n"},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/clientTagMapping/delete":{"post":{"tags":["ClientTags"],"summary":"Delete client tag mapping","description":"Remove a client tag mapping","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientTagMappingRequest"}}}},"responses":{"200":{"description":"Client tag mapping deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"description":"Permission denied, mapping deletion failed, or tag update failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"OpenAPI not found, client not found, mapping not found, or operation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 個性化標籤


# 建立個性化標籤

## Create personal tag

> Create a new personal tag for client categorization

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"PersonalTags","description":"Personal tags management for client categorization"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"CreatePersonalTagRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"name":{"type":"string","description":"The name of the personal tag"}},"required":["secret","name"]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"GetOpenApiError":{"description":"OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/personalTag":{"post":{"tags":["PersonalTags"],"summary":"Create personal tag","description":"Create a new personal tag for client categorization","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePersonalTagRequest"}}}},"responses":{"200":{"description":"Personal tag created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"description":"Permission denied or personal tag creation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"$ref":"#/components/responses/GetOpenApiError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 列出個性化標籤

## List personal tags

> Retrieve a list of all personal tags with pagination

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"PersonalTags","description":"Personal tags management for client categorization"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"SecretRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"}},"required":["secret"]},"PersonalTagListResponse":{"allOf":[{"$ref":"#/components/schemas/BasicSuccessResponse"},{"type":"object","properties":{"listPersonalTags":{"type":"array","items":{"$ref":"#/components/schemas/PersonalTag"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"PersonalTag":{"type":"object","properties":{"id":{"type":"string","description":"Personal tag unique identifier"},"name":{"type":"string","description":"Personal tag name"},"count":{"type":"integer","description":"Number of clients with this tag"}}},"Pagination":{"type":"object","properties":{"totalPages":{"type":"integer","description":"Total number of pages"},"currentPage":{"type":"integer","description":"Current page number"},"hasPre":{"type":"boolean","description":"Whether there is a previous page"},"hasNext":{"type":"boolean","description":"Whether there is a next page"}}},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/personalTags/list":{"post":{"tags":["PersonalTags"],"summary":"List personal tags","description":"Retrieve a list of all personal tags with pagination","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1},"description":"Page number for pagination"},{"name":"perpage","in":"query","required":false,"schema":{"type":"integer","default":10},"description":"Number of items per page"},{"name":"search","in":"query","required":false,"schema":{"type":"string","default":""},"description":"Search term for filtering results"},{"name":"sorting","in":"query","required":false,"schema":{"type":"string","enum":["ASC","DESC"],"default":"ASC"},"description":"Sort order (ASC or DESC)"},{"name":"sortingType","in":"query","required":false,"schema":{"type":"string","enum":["updateAt","clientCount"],"default":"updateAt"},"description":"Field to sort by (updateAt, clientCount, createdAt, name)"},{"name":"platform","in":"query","required":false,"schema":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"]},"description":"Platform filter (line, facebook, instagram, liveChat, whatsapp)"},{"name":"startTime","in":"query","required":false,"schema":{"type":"string","default":""},"description":"Start time for date range filter"},{"name":"endTime","in":"query","required":false,"schema":{"type":"string","default":""},"description":"End time for date range filter"},{"name":"isCountByPlatform","in":"query","required":false,"schema":{"type":"boolean","default":true},"description":"Whether to count by platform"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretRequest"}}}},"responses":{"200":{"description":"Personal tags list retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalTagListResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"description":"Personal tags retrieval failed or OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 取得個性化標籤

## Get specific personal tag

> Retrieve detailed information about a specific personal tag

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"PersonalTags","description":"Personal tags management for client categorization"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"SecretRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"}},"required":["secret"]},"PersonalTagResponse":{"allOf":[{"$ref":"#/components/schemas/BasicSuccessResponse"},{"type":"object","properties":{"personalTag":{"$ref":"#/components/schemas/PersonalTag"}}}]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"PersonalTag":{"type":"object","properties":{"id":{"type":"string","description":"Personal tag unique identifier"},"name":{"type":"string","description":"Personal tag name"},"count":{"type":"integer","description":"Number of clients with this tag"}}},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/personalTag/get/{tagId}":{"post":{"tags":["PersonalTags"],"summary":"Get specific personal tag","description":"Retrieve detailed information about a specific personal tag","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"},{"name":"tagId","in":"path","required":true,"schema":{"type":"string"},"description":"The ID of the personal tag to retrieve"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretRequest"}}}},"responses":{"200":{"description":"Personal tag information retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalTagResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"description":"Personal tag or OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 編輯個性化標籤名稱

## Update personal tag

> Update personal tag name and properties

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"PersonalTags","description":"Personal tags management for client categorization"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"UpdatePersonalTagRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"name":{"type":"string","description":"The new name for the personal tag"}},"required":["secret","name"]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"GetOpenApiError":{"description":"OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/personalTag/update/{tagId}":{"post":{"tags":["PersonalTags"],"summary":"Update personal tag","description":"Update personal tag name and properties","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"},{"name":"tagId","in":"path","required":true,"schema":{"type":"string"},"description":"The ID of the personal tag to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePersonalTagRequest"}}}},"responses":{"200":{"description":"Personal tag updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"description":"Permission denied or personal tag update failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"$ref":"#/components/responses/GetOpenApiError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 刪除個性化標籤

## Delete personal tag

> Remove a personal tag from the system

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"PersonalTags","description":"Personal tags management for client categorization"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"SecretRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"}},"required":["secret"]},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"GetOpenApiError":{"description":"OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/personalTag/delete/{tagId}":{"post":{"tags":["PersonalTags"],"summary":"Delete personal tag","description":"Remove a personal tag from the system","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"},{"name":"tagId","in":"path","required":true,"schema":{"type":"string"},"description":"The ID of the personal tag to delete"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretRequest"}}}},"responses":{"200":{"description":"Personal tag deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"$ref":"#/components/responses/GetOpenApiError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 給使用者貼上指定標籤

## Create personal tag mapping

> Append a personal tag to a client

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"PersonalTags","description":"Personal tags management for client categorization"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"PersonalTagMappingRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"tagId":{"type":"string","description":"The personal tag ID"},"clientId":{"type":"string","description":"The client ID (required if platform + platformClientId not provided)"},"platform":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"],"description":"Platform type (required if platformClientId provided)"},"platformClientId":{"type":"string","description":"Platform-specific client ID (required if clientId not provided)"}},"required":["secret","tagId"],"description":"Client identification rules:\n- Either provide 'clientId' OR both 'platform' and 'platformClientId'\n"},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/personalTagMapping":{"post":{"tags":["PersonalTags"],"summary":"Create personal tag mapping","description":"Append a personal tag to a client","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalTagMappingRequest"}}}},"responses":{"200":{"description":"Personal tag mapping created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"description":"Permission denied or personal tag mapping operation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"OpenAPI configuration or client not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 給使用者刪除指定標籤

## Delete personal tag mapping

> Remove a personal tag from a client

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"PersonalTags","description":"Personal tags management for client categorization"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"PersonalTagMappingRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"},"tagId":{"type":"string","description":"The personal tag ID"},"clientId":{"type":"string","description":"The client ID (required if platform + platformClientId not provided)"},"platform":{"type":"string","enum":["line","facebook","instagram","liveChat","whatsapp"],"description":"Platform type (required if platformClientId provided)"},"platformClientId":{"type":"string","description":"Platform-specific client ID (required if clientId not provided)"}},"required":["secret","tagId"],"description":"Client identification rules:\n- Either provide 'clientId' OR both 'platform' and 'platformClientId'\n"},"BasicSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimitError":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/personalTagMapping/delete":{"post":{"tags":["PersonalTags"],"summary":"Delete personal tag mapping","description":"Remove a personal tag from a client","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalTagMappingRequest"}}}},"responses":{"200":{"description":"Personal tag mapping deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicSuccessResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"description":"Permission denied or personal tag mapping operation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"OpenAPI configuration or client not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 訊息


# 取得訊息分析數據

## Get message analysis

> Retrieve comprehensive bot message analytics and statistics across all platforms.\
> \
> This endpoint provides:\
> \- Line platform statistics (quota, consumption, reply/push/broadcast amounts)\
> \- Multi-platform conversation analytics (average conversation values and times)\
> \- Platform integration status for all platforms\
> \*\*Platforms covered:\*\* Line, Facebook, Instagram, LiveChat, WhatsApp

```json
{"openapi":"3.0.3","info":{"title":"Manta OpenAPI","version":"0.363.10"},"tags":[{"name":"Core","description":"Core OpenAPI functionality for customer management and broadcasting"}],"servers":[{"url":"https://mantago.cc/api","description":"MantaGo Openapi host url"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token for API authentication"}},"schemas":{"MessageAnalysisRequest":{"type":"object","properties":{"secret":{"type":"string","description":"Secret key for API authentication"}},"required":["secret"]},"MessageAnalysisResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"lineQuota":{"type":"integer","description":"Line platform quota limit"},"lineQuotaConsumption":{"type":"integer","description":"Line platform quota consumption"},"lineReplyAmounts":{"type":"integer","description":"Number of Line reply messages"},"linePushAmounts":{"type":"integer","description":"Number of Line push messages"},"lineBroadcastAmounts":{"type":"integer","description":"Number of Line broadcast messages"},"lineProgram":{"type":"string","description":"Line program data","enum":["輕用量","中用量","高用量"]},"lineAverageConversationValue":{"type":"integer","description":"Average conversation value for Line platform"},"lineAverageConversationTime":{"type":"integer","description":"Average conversation time for Line platform (in seconds)"},"fbAverageConversationValue":{"type":"integer","description":"Average conversation value for Facebook platform"},"fbAverageConversationTime":{"type":"integer","description":"Average conversation time for Facebook platform (in seconds)"},"igAverageConversationValue":{"type":"integer","description":"Average conversation value for Instagram platform"},"igAverageConversationTime":{"type":"integer","description":"Average conversation time for Instagram platform (in seconds)"},"liveChatAverageConversationValue":{"type":"integer","description":"Average conversation value for LiveChat platform"},"liveChatAverageConversationTime":{"type":"integer","description":"Average conversation time for LiveChat platform (in seconds)"},"whatsappAverageConversationValue":{"type":"integer","description":"Average conversation value for WhatsApp platform"},"whatsappAverageConversationTime":{"type":"integer","description":"Average conversation time for WhatsApp platform (in seconds)"},"lineIsIntegration":{"type":"boolean","description":"Whether Line platform is integrated"},"fbIsIntegration":{"type":"boolean","description":"Whether Facebook platform is integrated"},"instagramIsIntegration":{"type":"boolean","description":"Whether Instagram platform is integrated"},"liveChatIsIntegration":{"type":"boolean","description":"Whether LiveChat platform is integrated"},"whatsappIsIntegration":{"type":"boolean","description":"Whether WhatsApp platform is integrated"}}},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"errResponse":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"integer"},"botId":{"type":"string"}},"required":["message","code"]}},"required":["success","errResponse"]}},"responses":{"TokenError":{"description":"JWT token is invalid or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PermissionError":{"description":"Permission denied - insufficient access rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"GetOpenApiError":{"description":"OpenAPI configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/openapi/message/analysis":{"post":{"tags":["Core"],"summary":"Get message analysis","description":"Retrieve comprehensive bot message analytics and statistics across all platforms.\n\nThis endpoint provides:\n- Line platform statistics (quota, consumption, reply/push/broadcast amounts)\n- Multi-platform conversation analytics (average conversation values and times)\n- Platform integration status for all platforms\n**Platforms covered:** Line, Facebook, Instagram, LiveChat, WhatsApp","parameters":[{"name":"botId","in":"query","required":true,"schema":{"type":"string"},"description":"The bot ID for the API request"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageAnalysisRequest"}}}},"responses":{"200":{"description":"Get Messages Analysis Successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageAnalysisResponse"}}}},"401":{"$ref":"#/components/responses/TokenError"},"403":{"$ref":"#/components/responses/PermissionError"},"404":{"$ref":"#/components/responses/GetOpenApiError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


# 如何取得Token

必須取得MantaGO Bot API Token，才能使MantaGO Open API生效，並進行API調用

## 如何取得 API Token？

MantaGO 每個 bot 專屬的 `API Token`及`Secret Key`。

方法一：從MantaGO後台

1. 進入 bot 主控台
2. 點選 『設定』
3. 點選 『進階設定』
4. 點選 『API串接設定』
5. 如果API Token跟API Secret為空白，點選刷新
6. 取得此 bot 的 API Token以及Secret Key。

若Token過期(效期30天)，可重新從MantaGO後台獲取，或是拿過期的Token和Secret Key 打API做換發，請參考以下換發文件:&#x20;

{% content-ref url="/pages/Aa1NJieGiNxn5LGBURyS" %}
[Open API Token與Secret Key換發](/open-api-token-yu-secret-key-huan-fa)
{% endcontent-ref %}

{% hint style="info" %}
每個bot僅有一組API Token和Secret Key，請妥善保存
{% endhint %}


# 錯誤代碼

以下列出常見的錯誤代碼與訊息

這個是有錯誤時的JSON Response範例：

```json
{
    "success": false,
    "errResponse": {
        "message": "This is sample message",
        "code": 0000,
        "botId": "MantaGO Bot ID"
    }
}
```

API Response的errResponse可能出現以下錯誤代碼(code)及訊息(message)：

<table><thead><tr><th width="186">錯誤代碼(code)</th><th>錯誤訊息(message)</th><th>發生原因</th></tr></thead><tbody><tr><td>1004</td><td>Token is invalid or expired</td><td>API Token和Secret Key到期</td></tr><tr><td>1002</td><td>permission denied</td><td><ol><li>API Token和Secret Key有誤</li><li>目前方案不支援Open API</li></ol></td></tr><tr><td>5001</td><td>尋找Bot資訊失敗,無此botId</td><td>依據Query parameter的botId找不到指定的機器人</td></tr><tr><td>60001</td><td>Bind customer client failed</td><td>依據Request body的clientId，找不到想綁定Line的會員</td></tr><tr><td>60002</td><td>Unbind customer client failed</td><td>依據Request body的clientId和customerId，找不到被綁定的會員</td></tr><tr><td>11000</td><td>存入integration info 失敗</td><td>設定Line webview網址失敗</td></tr><tr><td>11001</td><td>尋找Integration資訊失敗,無此IntegrationId</td><td>依據Query parameter的botId和platform找不到對應平台的綁定資料</td></tr><tr><td>37011</td><td>Get client failed</td><td>依據API所帶的Query parameter和Request Parameter的組合找不到指定的會員</td></tr><tr><td>36000</td><td>Create broadcast failed</td><td><ol><li>訊息傳送失敗</li><li>機器人尚未發布</li></ol></td></tr><tr><td>110000</td><td>Get correct request variables failed</td><td>Request Body缺少必要的變數</td></tr><tr><td>120000</td><td>Get open api failed</td><td>曾經換發過API Token和Secret Key，但使用到舊的API Token和Secret Key</td></tr><tr><td>120001</td><td>Update open api failed</td><td>更新webview網址失敗</td></tr></tbody></table>


# 購物車下單後推播訊息

以用戶將購物車內的商品做下單結帳後，並推送訊息給用戶之情境，並以Node.js程式碼為例

## 目錄

1. [情境概述](#qing-jing-gai-shu)
2. [取得MantaGO Bot的ID](#qu-de-mantago-bot-de-id)
3. [拿（更新）Token和Secret Key ](#na-geng-xin-token-he-secret-key)
4. [推播訊息](#tui-bo-xun-xi)
   1. [推送給Line用戶](#tui-song-te-ding-dui-hua-mo-zu-gei-te-ding-line-yong-hu)
   2. [推送給Facebook用戶](#tui-song-wen-zi-gei-te-ding-facebook-yong-hu)

***

## 情境概述

用戶將購物車的商品做下單、並且結帳成功後，傳送後續的訊息給用戶，例如：提醒用戶結帳成功，可以至購物記錄查看商品的最新進度。

***

## 取得MantaGO Bot的ID

MantaGO Bot的ID在後續的API使用，都需要在request query或body之中，作為的botId的value進行帶入。

1. 例如，有下面幾個機器人：

<figure><img src="https://1263535189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzlSl7l5NrH7Ldt8hfGq%2Fuploads%2FMy8eCC5wwsWc1NRMMwT9%2F%E5%9C%96%E7%89%87.png?alt=media&amp;token=37fccc97-a99c-4899-8bd4-8c027c3a2d5e" alt=""><figcaption></figcaption></figure>

2. 要拿皮卡丘的機器人的Bot ID，點進去皮卡丘的機器人：

<figure><img src="https://1263535189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzlSl7l5NrH7Ldt8hfGq%2Fuploads%2F4uzdP3rG7B9mh0dut3zo%2F%E5%9C%96%E7%89%87.png?alt=media&amp;token=169ec021-60d2-4f9b-b430-9e56aa782355" alt=""><figcaption></figcaption></figure>

3. 取得網址：`https://mantago.cc/chatbot/lNbWoobyg`。
4. 擷取網址內容的`/chatbot/`後的文字：`lNbWoobyg`，這個`lNbWoobyg`就是為皮卡丘的機器人的Bot ID。

***

## 拿（更新）Token和Secret Key

參考 [如何取得Token](/chang-jian-wen-ti/ru-he-qu-de-token)的方法來取得打API用的Token和Secret Key。

如果API用的Token和Secret Key過期了，會得到以下錯誤：

```javascript
{
    "success": false,
    "errResponse": {
        "message": "Token is invalid or expired",
        "code": 1004,
        "botId": "MantaGO Bot ID"
    }
}
```

可以打換發API Token和Secret Key的API來取得新的API Token和Secret Key。

這裡提供換發API Token和Secret Key的程式碼範例：

```javascript
const axios = require('axios');

const secret = "API Secret Key"
const token = "API Token"
const botId = "MantaGO Bot ID"

const data = { "secret": secret };

const config = {
  method: 'post',
  url: 'https://mantago.cc/api/openapi/token?botId=botId',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': `Bearer ${token}`,
  },
  data : data
};

async function makeRequest() {
  try {
    const response = await axios.request(config);
    console.log(response.data);
  }
  catch (error) {
    console.log(error);
  }
}

makeRequest();

```

***

## 推播訊息

有了MantaGO Bot的ID以及有效的API Token和Secret Key，就可以進行推播。

從 [Broken mention](broken://pages/IAmujyCdqC2sGC36DJ67)的內容，在推播訊息的時候，有以下兩種選擇：

* 推送內容：文字或是特定對話模組。
* 平台用戶：以下將以Line和Facebook為例。

以下提供 『推送對話模組給特定Line用戶』 和 『推送文字給特定Facebook用戶』 兩種範例。

### 推送對話模組給特定Line用戶

傳送對話模組：

<figure><img src="https://1263535189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzlSl7l5NrH7Ldt8hfGq%2Fuploads%2FF4PhUDmLxMnSju95KemW%2F%E5%9C%96%E7%89%87.png?alt=media&amp;token=632a033e-3c93-46b2-a769-d1399a1e9f76" alt=""><figcaption></figcaption></figure>

1. 進入對話模組取得這個對話模組的ID、拿網址：`https://mantago.cc/intent/YqaQwqdnj/rb2kYmMdW`、擷取最後一個『 / 』之後的文字，此對話模組的ID便是`rb2kYmMdW`。
2. 去打推播的API；推播訊息的程式碼範例：

```javascript
const axios = require('axios');

const secret = "API Secret Key"
const token = "API Token"
const botId = "MantaGO Bot ID"
const lineUUidList = [
    "Line user uuid"
  ]

const data = {
  "intentId": "rb2kYmMdW",
  "botId": botId,
  "clientIds": lineUUidList,
  "platform": "line",
  "secret": secret
};

const config = {
  method: 'post',
  url: 'https://mantago.cc/api/openapi/broadcast',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': `Bearer ${token}`,
    },
  data : data
};

async function makeRequest() {
  try {
    const response = await axios.request(config);
    console.log(response.data);
  }
  catch (error) {
    console.log(error);
  }
}

makeRequest();

```

3. 推送成功的API Response：

```
{
    "success": true,
    "message": "Send customer broadcast successfully"
}
```

4. 訊息：

<figure><img src="https://1263535189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzlSl7l5NrH7Ldt8hfGq%2Fuploads%2F5xWYgv1MwHk22NRZKk2I%2F%E5%9C%96%E7%89%87.png?alt=media&amp;token=c427c12d-1fe6-4f83-a88c-5cfc0c86ead8" alt=""><figcaption></figcaption></figure>

### 推送文字給特定Facebook用戶

推送文字內容 ：『親愛的顧客您好，你已成功下單，可以至消費紀錄查看商品的最新進度』。

1. 去打API，推播訊息的程式碼範例：

```javascript
const axios = require('axios');

const secret = "API Secret Key"
const token = "API Token"
const botId = "MantaGO Bot ID"
const facebookUUidList = [
    "Facebook user uuid"
  ]

const data = {
  "message": "親愛的顧客您好，你已成功下單，可以至消費紀錄查看商品的最新進度",
  "botId": botId,
  "clientIds": facebookUUidList,
  "platform": "facebook",
  "fbTag": "POST_PURCHASE_UPDATE",
  "secret": secret
};

const config = {
  method: 'post',
  url: 'https://mantago.cc/api/openapi/broadcast',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': `Bearer ${token}`,
    },
  data : data
};

async function makeRequest() {
  try {
    const response = await axios.request(config);
    console.log(response.data);
  }
  catch (error) {
    console.log(error);
  }
}

makeRequest();

```

2. 推送成功的API Response：

```
{
    "success": true,
    "message": "Send customer broadcast successfully"
}
```

3. 訊息：

<figure><img src="https://1263535189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzlSl7l5NrH7Ldt8hfGq%2Fuploads%2FOvLL9OOKXxmEv9526TSG%2F%E5%9C%96%E7%89%87.png?alt=media&amp;token=6d38ee9d-fd51-4502-85f9-75d099510560" alt=""><figcaption></figcaption></figure>


