WATI-AIGC-PLATFORM is the API documentation for the AIGC products within WATI.

An external proxy service responsible for authenticating interfaces and forwarding requests to the appropriate services. Language: GOLANG
A user management service responsible for managing users, handling user login authentication, and managing user credit functionalities. Language: GOLANG
A content management service tasked with managing both public and user resources, including generating/deleting videos, retrieving portrait lists, and more. Language: GOLANG
Responsible for invoking various models to generate videos or audio. It does not expose an API; instead, it receives requests via PUBSUB. Language: PYTHON
Responsible for collecting metrics and uploading them to BigQuery. It does not has a HTTP interface, only GRPC. Language: GOLANG
{"code": 1, "message": "verbose error message"}
code field are as follows:| Code | Abbreviation | HTTP Status Code | Explanation |
|---|---|---|---|
| 0 | OK | 200 | Success |
| 3 | INVALID_ARGUMENT | 400 | Invalid parameter |
| 5 | NOT_FOUND | 404 | Resource not found |
| 6 | ALREADY_EXISTS | 409 | Resource already exists |
| 7 | PERMISSION_DENIED | 403 | Unauthorized access |
| 8 | RESOURCE_EXHAUSTED | 429 | Too many simultaneous calls by the user |
| 9 | FAILED_PRECONDITION | 402 | Insufficient user balance |
| 12 | UNIMPLEMENTED | 501 | Not implemented |
| 13 | INTERNAL | 500 | Internal server error |
| 16 | UNAUTHENTICATED | 401 | User not authenticated/authorization failed |
Authentication is divided into API_KEY and TOKEN.
When accessing resources, the user should include the TOKEN/API_KEY in the HTTP Authorization header in the following format:
Authorization: Bearer [TOKEN/API_KEY]
For internal
| tenant_id required | string |
{- "subscription": {
- "plan": "FREE",
- "period": "NOT_DEFINE",
- "status": "NO_SUBSCRIPTION",
- "start_at": "2019-08-24T14:15:22Z",
- "end_at": "2019-08-24T14:15:22Z"
}
}| tenant_id required | string now only can change free-trial end time UTC |
| new_end_at | string <date-time> |
{- "new_end_at": "2019-08-24T14:15:22Z"
}{- "subscription": {
- "plan": "FREE",
- "period": "NOT_DEFINE",
- "status": "NO_SUBSCRIPTION",
- "start_at": "2019-08-24T14:15:22Z",
- "end_at": "2019-08-24T14:15:22Z"
}
}| token | string |
| new_password | string |
| password_confirm | string |
{- "token": "string",
- "new_password": "string",
- "password_confirm": "string"
}{ }string | |
| code | string |
| token | string |
{- "email": "string",
- "code": "string",
- "token": "string"
}{- "redirect_url": "string",
- "is_valid": true,
- "email": "string",
- "new_token": "string"
}string (invite code) | |
| password | string |
| tenant_id | string |
| invite_token | string |
| from_link | string |
| country | string |
{- "email": "string",
- "password": "string",
- "tenant_id": "string",
- "invite_token": "string",
- "from_link": "string",
- "country": "string"
}{- "token": "string"
}Register Verify
string | |
| code | string |
| token | string |
| from_link | string |
| country | string |
{- "email": "string",
- "code": "string",
- "token": "string",
- "from_link": "string",
- "country": "string"
}{- "token": "string",
- "is_initialized": true
}Session API for Dify OAuth service
string | |
| access_token | string |
| refresh_token | string |
| from_link | string |
| country | string |
| provider | string |
| extra | string |
{- "email": "string",
- "access_token": "string",
- "refresh_token": "string",
- "from_link": "string",
- "country": "string",
- "provider": "string",
- "extra": "string"
}{- "redirect_url": "string",
- "error_code": "SC_OK",
- "is_new_user": true
}| period | string Default: "NOT_DEFINE" Enum: "NOT_DEFINE" "MONTHLY" "YEARLY" |
| plan | string Default: "FREE" Enum: "FREE" "PRO" "BUSINESS" "CUSTOM" "NEW_USER_TRIAL" "BYOA_USER_TRIAL" |
{- "variants": [
- {
- "id": "string",
- "description": "string",
- "period": "NOT_DEFINE",
- "plan": "FREE",
- "price": 0.1,
- "currency": "string"
}
]
}Array of objects (account_service_innerAddonsPurchaseRequestPurchase) |
{- "purchases": [
- {
- "category": "USAGE_UNKNOWN",
- "quantity": 0
}
]
}{- "redirect_url": "string"
}{- "user": {
- "id": "string",
- "name": "string",
- "email": "string",
- "thumbnail_url": "string",
- "status": "UNKNOWN",
- "subscription_info": {
- "plan": "FREE",
- "period": "NOT_DEFINE",
- "status": "NO_SUBSCRIPTION",
- "start_at": "2019-08-24T14:15:22Z",
- "end_at": "2019-08-24T14:15:22Z"
}, - "create_at": "2019-08-24T14:15:22Z",
- "update_at": "2019-08-24T14:15:22Z"
}
}upload user avatar file with multipart/form-data
{ }{- "thumbnail_url": "string"
}| page | string <int64> default is 1 |
| limit | string <int64> default is 20 |
{- "tenants": [
- {
- "id": "string",
- "name": "string",
- "role": "string",
- "is_current": true,
- "created_at": "2019-08-24T14:15:22Z"
}
], - "page": {
- "has_more": true,
- "limit": "string",
- "page": "string",
- "total": "string"
}
}Array of objects (account_service_innerUserTenantMemberInviteByEmailRequestMember) |
{- "members": [
- {
- "email": "string",
- "role": "string"
}
]
}{- "rets": [
- {
- "status": "SC_OK",
- "email": "string",
- "message": "string",
- "invited_url": "string"
}
]
}use post cuz we use email as a unique
string | |
| role | string |
{- "email": "string",
- "role": "string"
}{ }| tenant_id | string |
{- "tenant_id": "string"
}{- "tenant_info": {
- "id": "string",
- "name": "string",
- "role": "string",
- "is_current": true,
- "created_at": "2019-08-24T14:15:22Z"
}
}| template_id | string |
| user_id | string |
| tenant_id | string |
| name | string |
| description | string |
| update_kb | boolean |
object | |
| business_type | string |
| url | string |
| agent_type | string |
{- "template_id": "string",
- "user_id": "string",
- "tenant_id": "string",
- "name": "string",
- "description": "string",
- "update_kb": true,
- "knowledge_base_ids": {
- "property1": "string",
- "property2": "string"
}, - "business_type": "string",
- "url": "string",
- "agent_type": "string"
}{- "agent_id": "string",
- "name": "string",
- "description": "string",
- "created_at": "string",
- "updated_at": "string"
}| agent_id required | string |
| name | string |
| description | string |
{- "name": "string",
- "description": "string"
}{- "agent_id": "string",
- "name": "string",
- "description": "string",
- "updated_at": "string"
}{- "id": "string",
- "agent_id": "string",
- "config": {
- "capture_lead_config": {
- "business_type": "string",
- "contact_info": {
- "fields": [
- "string"
], - "custom_fields": {
- "property1": "string",
- "property2": "string"
}
}, - "criteria": {
- "type": "string",
- "bant": {
- "budget": [
- {
- "question": "string"
}
], - "authority": [
- {
- "question": "string"
}
], - "need": [
- {
- "question": "string"
}
], - "timeline": [
- {
- "question": "string"
}
]
}, - "meddic": {
- "metrics": [
- {
- "question": "string"
}
], - "economic_buyer": [
- {
- "question": "string"
}
], - "decision_criteria": [
- {
- "question": "string"
}
], - "decision_process": [
- {
- "question": "string"
}
], - "identify_pain": [
- {
- "question": "string"
}
], - "champion": [
- {
- "question": "string"
}
]
}
}
}, - "qualify_lead_config": { },
- "appearance_config": {
- "widget": {
- "welcome_message": {
- "message": "string",
- "popup_mode": true
}, - "conversation_starter": {
- "messages": [
- "string"
], - "popup_mode": true
}, - "display_form_immediately": true,
- "brand_logo": {
- "url": "string"
}, - "color_theme": {
- "primary_color": "string"
}, - "disclaim_text": "string"
}, - "ai_nav": {
- "welcome_message": {
- "message": "string",
- "popup_mode": true
}, - "conversation_starter": {
- "messages": [
- "string"
], - "popup_mode": true
}, - "display_form_immediately": true,
- "brand_logo": {
- "url": "string"
}, - "color_theme": {
- "primary_color": "string"
}, - "disclaim_text": "string"
}
}, - "advanced_config": {
- "agent_description": "string",
- "reply_tone": "string",
- "multi_modal_support": true,
- "multi_lingual_support": true
}
}, - "created_at": "string",
- "updated_at": "string"
}| agent_id required | string |
object (mapping_serviceConfig) | |
| user_id | string |
{- "config": {
- "capture_lead_config": {
- "business_type": "string",
- "contact_info": {
- "fields": [
- "string"
], - "custom_fields": {
- "property1": "string",
- "property2": "string"
}
}, - "criteria": {
- "type": "string",
- "bant": {
- "budget": [
- {
- "question": "string"
}
], - "authority": [
- {
- "question": "string"
}
], - "need": [
- {
- "question": "string"
}
], - "timeline": [
- {
- "question": "string"
}
]
}, - "meddic": {
- "metrics": [
- {
- "question": "string"
}
], - "economic_buyer": [
- {
- "question": "string"
}
], - "decision_criteria": [
- {
- "question": "string"
}
], - "decision_process": [
- {
- "question": "string"
}
], - "identify_pain": [
- {
- "question": "string"
}
], - "champion": [
- {
- "question": "string"
}
]
}
}
}, - "qualify_lead_config": { },
- "appearance_config": {
- "widget": {
- "welcome_message": {
- "message": "string",
- "popup_mode": true
}, - "conversation_starter": {
- "messages": [
- "string"
], - "popup_mode": true
}, - "display_form_immediately": true,
- "brand_logo": {
- "url": "string"
}, - "color_theme": {
- "primary_color": "string"
}, - "disclaim_text": "string"
}, - "ai_nav": {
- "welcome_message": {
- "message": "string",
- "popup_mode": true
}, - "conversation_starter": {
- "messages": [
- "string"
], - "popup_mode": true
}, - "display_form_immediately": true,
- "brand_logo": {
- "url": "string"
}, - "color_theme": {
- "primary_color": "string"
}, - "disclaim_text": "string"
}
}, - "advanced_config": {
- "agent_description": "string",
- "reply_tone": "string",
- "multi_modal_support": true,
- "multi_lingual_support": true
}
}, - "user_id": "string"
}{- "agent_id": "string",
- "config": {
- "capture_lead_config": {
- "business_type": "string",
- "contact_info": {
- "fields": [
- "string"
], - "custom_fields": {
- "property1": "string",
- "property2": "string"
}
}, - "criteria": {
- "type": "string",
- "bant": {
- "budget": [
- {
- "question": "string"
}
], - "authority": [
- {
- "question": "string"
}
], - "need": [
- {
- "question": "string"
}
], - "timeline": [
- {
- "question": "string"
}
]
}, - "meddic": {
- "metrics": [
- {
- "question": "string"
}
], - "economic_buyer": [
- {
- "question": "string"
}
], - "decision_criteria": [
- {
- "question": "string"
}
], - "decision_process": [
- {
- "question": "string"
}
], - "identify_pain": [
- {
- "question": "string"
}
], - "champion": [
- {
- "question": "string"
}
]
}
}
}, - "qualify_lead_config": { },
- "appearance_config": {
- "widget": {
- "welcome_message": {
- "message": "string",
- "popup_mode": true
}, - "conversation_starter": {
- "messages": [
- "string"
], - "popup_mode": true
}, - "display_form_immediately": true,
- "brand_logo": {
- "url": "string"
}, - "color_theme": {
- "primary_color": "string"
}, - "disclaim_text": "string"
}, - "ai_nav": {
- "welcome_message": {
- "message": "string",
- "popup_mode": true
}, - "conversation_starter": {
- "messages": [
- "string"
], - "popup_mode": true
}, - "display_form_immediately": true,
- "brand_logo": {
- "url": "string"
}, - "color_theme": {
- "primary_color": "string"
}, - "disclaim_text": "string"
}
}, - "advanced_config": {
- "agent_description": "string",
- "reply_tone": "string",
- "multi_modal_support": true,
- "multi_lingual_support": true
}
}, - "updated_at": "string"
}| agent_id required | string |
object (mapping_serviceIntention) |
{- "intention": {
- "id": "string",
- "name": "string",
- "condition": "string",
- "action": "string",
- "is_enabled": true
}
}{- "intention": {
- "id": "string",
- "name": "string",
- "condition": "string",
- "action": "string",
- "is_enabled": true
}
}| agent_id required | string |
| intention_id required | string |
object (mapping_serviceIntention) |
{- "intention": {
- "id": "string",
- "name": "string",
- "condition": "string",
- "action": "string",
- "is_enabled": true
}
}{- "intention": {
- "id": "string",
- "name": "string",
- "condition": "string",
- "action": "string",
- "is_enabled": true
}
}{- "leads": [
- {
- "lead_id": "string",
- "agent_id": "string",
- "name": "string",
- "email": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "created_at": "string",
- "updated_at": "string",
- "is_deleted": true
}
]
}| plan_name | string If the plan is tenant-specific, the plan name is the tenant ID. |
object (usage_serviceSubscriptionConfig) | |
| description | string (subscription plan description. if not set, it is plan name) |
| credit_extension | integer <int32> credit_extension (in days): The number of days that credits remain valid after the end of the subscription period. |
{- "plan_name": "string",
- "config": {
- "usage_configs": [
- {
- "category": "USAGE_UNKNOWN",
- "total_amount": "string"
}
], - "lead_collections": [
- "LEADCOLLECTION_UNKNOWN"
], - "train_material_types": [
- "TRAINMAT_UNKNOWN"
], - "lead_qualification": true,
- "ai_web_widget": true,
- "magic_spotlight": true,
- "multi_lingual": true,
- "conversation_insights": true,
- "analytics": "ANALYTICS_UNKNOWN",
- "voice_agent": true,
- "custom_branding_footer": true,
- "integration_types": [
- "PLATFORM_UNKNOWN"
], - "team_members": 0
}, - "description": "string",
- "credit_extension": 0
}{- "plan": {
- "plan_name": "string",
- "config": {
- "usage_configs": [
- {
- "category": "USAGE_UNKNOWN",
- "total_amount": "string"
}
], - "lead_collections": [
- "LEADCOLLECTION_UNKNOWN"
], - "train_material_types": [
- "TRAINMAT_UNKNOWN"
], - "lead_qualification": true,
- "ai_web_widget": true,
- "magic_spotlight": true,
- "multi_lingual": true,
- "conversation_insights": true,
- "analytics": "ANALYTICS_UNKNOWN",
- "voice_agent": true,
- "custom_branding_footer": true,
- "integration_types": [
- "PLATFORM_UNKNOWN"
], - "team_members": 0
}, - "has_used": true,
- "description": "string",
- "credit_extension": 0,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
}{- "plan": {
- "plan_name": "string",
- "config": {
- "usage_configs": [
- {
- "category": "USAGE_UNKNOWN",
- "total_amount": "string"
}
], - "lead_collections": [
- "LEADCOLLECTION_UNKNOWN"
], - "train_material_types": [
- "TRAINMAT_UNKNOWN"
], - "lead_qualification": true,
- "ai_web_widget": true,
- "magic_spotlight": true,
- "multi_lingual": true,
- "conversation_insights": true,
- "analytics": "ANALYTICS_UNKNOWN",
- "voice_agent": true,
- "custom_branding_footer": true,
- "integration_types": [
- "PLATFORM_UNKNOWN"
], - "team_members": 0
}, - "has_used": true,
- "description": "string",
- "credit_extension": 0,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
}| plan_name required | string If the plan is Free, Pro, or Business, the plan name remains the same. If the plan is tenant-specific, the plan name is the tenant ID. |
object (usage_serviceSubscriptionConfig) | |
| description | string |
| credit_extension | integer <int32> credit_extension (in days): The number of days that credits remain valid after the end of the subscription period. |
{- "config": {
- "usage_configs": [
- {
- "category": "USAGE_UNKNOWN",
- "total_amount": "string"
}
], - "lead_collections": [
- "LEADCOLLECTION_UNKNOWN"
], - "train_material_types": [
- "TRAINMAT_UNKNOWN"
], - "lead_qualification": true,
- "ai_web_widget": true,
- "magic_spotlight": true,
- "multi_lingual": true,
- "conversation_insights": true,
- "analytics": "ANALYTICS_UNKNOWN",
- "voice_agent": true,
- "custom_branding_footer": true,
- "integration_types": [
- "PLATFORM_UNKNOWN"
], - "team_members": 0
}, - "description": "string",
- "credit_extension": 0
}{- "plan": {
- "plan_name": "string",
- "config": {
- "usage_configs": [
- {
- "category": "USAGE_UNKNOWN",
- "total_amount": "string"
}
], - "lead_collections": [
- "LEADCOLLECTION_UNKNOWN"
], - "train_material_types": [
- "TRAINMAT_UNKNOWN"
], - "lead_qualification": true,
- "ai_web_widget": true,
- "magic_spotlight": true,
- "multi_lingual": true,
- "conversation_insights": true,
- "analytics": "ANALYTICS_UNKNOWN",
- "voice_agent": true,
- "custom_branding_footer": true,
- "integration_types": [
- "PLATFORM_UNKNOWN"
], - "team_members": 0
}, - "has_used": true,
- "description": "string",
- "credit_extension": 0,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
}| tenant_id required | string |
| agent_ids | Array of strings |
{- "agent_ids": [
- "string"
]
}{- "agent_credits": {
- "property1": "string",
- "property2": "string"
}
}{- "config": {
- "current_plan": "FREE",
- "usage_configs": [
- {
- "category": "USAGE_UNKNOWN",
- "used_amount": "string",
- "total_amount": "string",
- "expiration_time": "2019-08-24T14:15:22Z"
}
], - "dataset_usages": {
- "property1": {
- "category": "USAGE_UNKNOWN",
- "used_amount": "string",
- "total_amount": "string",
- "expiration_time": "2019-08-24T14:15:22Z"
}, - "property2": {
- "category": "USAGE_UNKNOWN",
- "used_amount": "string",
- "total_amount": "string",
- "expiration_time": "2019-08-24T14:15:22Z"
}
}, - "lead_collections": [
- "LEADCOLLECTION_UNKNOWN"
], - "train_material_types": [
- "TRAINMAT_UNKNOWN"
], - "lead_qualification": true,
- "ai_web_widget": true,
- "magic_spotlight": true,
- "multi_lingual": true,
- "conversation_insights": true,
- "analytics": "ANALYTICS_UNKNOWN",
- "voice_agent": true,
- "custom_branding_footer": true,
- "integration_types": [
- "PLATFORM_UNKNOWN"
], - "team_members": 0,
- "updated_at": "2019-08-24T14:15:22Z"
}
}Chat with AI
| agent_id | string |
| external_user_id | string |
| tenant_id | string |
| message_content | string |
| response_mode | string (blocking/streaming) |
| conversation_id | string |
object (optional key-value pairs) | |
| source | string |
{- "agent_id": "string",
- "external_user_id": "string",
- "tenant_id": "string",
- "message_content": "string",
- "response_mode": "string",
- "conversation_id": "string",
- "inputs": {
- "property1": "string",
- "property2": "string"
}, - "source": "string"
}null