curl --request POST \
--url https://api.wegly.com.br/integrations/external/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"crm_task_type_id": "c5bb4fd2-5098-4e19-ae9e-6f9bf0be8458",
"crm_deal_id": "2b56f4df-c7d7-4f0a-8db0-93e2f83dd7db",
"title": "Reunião de kick-off",
"description": "Validar participantes e escopo inicial.",
"priority": 2,
"start_date": "2026-03-06T13:00:00.000Z",
"end_date": "2026-03-06T14:00:00.000Z",
"has_time": true,
"reminders_minutes": [
15,
60
]
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"description": "<string>",
"is_personal": true,
"priority": 0,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"has_time": true,
"completed_at": "2023-11-07T05:31:56Z",
"meeting_outcome": 1,
"meeting_outcome_notes": "<string>",
"ai_processed": true,
"ai_status": 123,
"ai_error_log": "<string>",
"ai_last_action": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"crm_task_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crm_task_stage_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crm_lead_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crm_deal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crm_delivery_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crm_person_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crm_organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crm_customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recurrence_series_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recurrence_index": 123,
"recurrence_is_exception": true,
"is_recurring": true,
"recurrence": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pattern": "every_n_days",
"interval": 123,
"week_days": [
"sunday"
],
"end_type": "none",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"until_date": "2023-11-07T05:31:56Z",
"index": 123,
"is_exception": true
},
"responsible_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
},
"completed_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
},
"responsible": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
},
"crm_task_type": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"icon": "<string>",
"is_meeting": true
},
"crm_task_stage": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"color": "<string>",
"is_completion": true,
"position": 123
},
"crm_lead": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"code": "<string>"
},
"crm_deal": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"code": "<string>"
},
"crm_delivery": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"code": "<string>",
"status": 123
},
"crm_person": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"crm_organization": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"legal_name": "<string>"
},
"crm_customer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": 123,
"type": 123,
"status": 123,
"person": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"organization": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"legal_name": "<string>"
}
},
"mentions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mentioned": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
},
"mentioned_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
},
"created_at": "2023-11-07T05:31:56Z"
}
],
"recordings": [
{
"recording_url": "<string>",
"transcription_url": "<string>",
"duration": 123,
"transcription_vtt_url": "<string>",
"transcription_txt_url": "<string>"
}
],
"reminders_minutes": [
123
],
"meeting_link": "<string>",
"meeting_participants": [
"jsmith@example.com"
],
"meeting_provider": "teams_integration",
"provider": "teams_integration",
"sync_warning": "<string>",
"origin": "WEGLY",
"is_actionable": true,
"ai_generated": true,
"parent_task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"hierarchy_level": 123,
"is_subtask": true,
"parent_task": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"parent_task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"hierarchy_level": 123
},
"subtasks": "<array>",
"tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"color": "<string>"
}
],
"calendar_lifecycle_status": "upcoming",
"meeting_mode": "online",
"meeting_location": "<string>",
"meeting_description": "<string>",
"meeting_event": {
"provider": "<string>",
"kind": "instant_link",
"mode": "online",
"location": "<string>",
"description": "<string>",
"status": "<string>",
"sync_status": "<string>",
"sync_operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sync": {
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "synced",
"attempts": 123,
"max_attempts": 123,
"next_retry_at": "2023-11-07T05:31:56Z",
"retry_after_at": "2023-11-07T05:31:56Z",
"can_retry": true,
"error": "<string>"
},
"cancelled_at": "2023-11-07T05:31:56Z",
"online_url": "<string>",
"calendar_url": "<string>",
"attendees": [
{
"email": "jsmith@example.com",
"name": "<string>",
"response_status": "needs_action",
"response_updated_at": "2023-11-07T05:31:56Z",
"is_organizer": true,
"is_self": true
}
],
"is_external_invitation": true,
"can_manage_event": true,
"can_edit_participants": true,
"provider_updated_at": "2023-11-07T05:31:56Z",
"last_synced_at": "2023-11-07T05:31:56Z"
},
"meeting_sync": {
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "synced",
"attempts": 123,
"max_attempts": 123,
"next_retry_at": "2023-11-07T05:31:56Z",
"retry_after_at": "2023-11-07T05:31:56Z",
"can_retry": true,
"error": "<string>"
},
"meeting_attendees": [
{
"email": "jsmith@example.com",
"name": "<string>",
"response_status": "needs_action",
"response_updated_at": "2023-11-07T05:31:56Z",
"is_organizer": true,
"is_self": true
}
],
"meeting_can_manage_participants": true,
"calendar_event_url": "<string>",
"meeting_response": {
"can_respond": true,
"attendee_email": "<string>",
"response_status": "<string>"
},
"meeting_can_respond": true,
"meeting_self_attendee_email": "<string>",
"meeting_self_response_status": "<string>",
"meeting_recorder_sessions": [
{}
],
"comments": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Criação de tarefa
Cria uma tarefa via integração externa, usando o usuário criador da chave como ator. A tarefa pode ser vinculada a exatamente um contexto principal entre lead, oportunidade, entrega, pessoa, organização ou cliente, conforme as regras do módulo interno. Vínculo com lead ou oportunidade exige start_date. Quando omitidos, responsible_id assume o usuário criador da chave e crm_task_stage_id assume a primeira etapa ativa que não seja de conclusão.
curl --request POST \
--url https://api.wegly.com.br/integrations/external/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"crm_task_type_id": "c5bb4fd2-5098-4e19-ae9e-6f9bf0be8458",
"crm_deal_id": "2b56f4df-c7d7-4f0a-8db0-93e2f83dd7db",
"title": "Reunião de kick-off",
"description": "Validar participantes e escopo inicial.",
"priority": 2,
"start_date": "2026-03-06T13:00:00.000Z",
"end_date": "2026-03-06T14:00:00.000Z",
"has_time": true,
"reminders_minutes": [
15,
60
]
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"description": "<string>",
"is_personal": true,
"priority": 0,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"has_time": true,
"completed_at": "2023-11-07T05:31:56Z",
"meeting_outcome": 1,
"meeting_outcome_notes": "<string>",
"ai_processed": true,
"ai_status": 123,
"ai_error_log": "<string>",
"ai_last_action": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"crm_task_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crm_task_stage_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crm_lead_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crm_deal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crm_delivery_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crm_person_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crm_organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crm_customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recurrence_series_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recurrence_index": 123,
"recurrence_is_exception": true,
"is_recurring": true,
"recurrence": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pattern": "every_n_days",
"interval": 123,
"week_days": [
"sunday"
],
"end_type": "none",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"until_date": "2023-11-07T05:31:56Z",
"index": 123,
"is_exception": true
},
"responsible_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
},
"completed_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
},
"responsible": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
},
"crm_task_type": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"icon": "<string>",
"is_meeting": true
},
"crm_task_stage": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"color": "<string>",
"is_completion": true,
"position": 123
},
"crm_lead": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"code": "<string>"
},
"crm_deal": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"code": "<string>"
},
"crm_delivery": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"code": "<string>",
"status": 123
},
"crm_person": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"crm_organization": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"legal_name": "<string>"
},
"crm_customer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": 123,
"type": 123,
"status": 123,
"person": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"organization": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"legal_name": "<string>"
}
},
"mentions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mentioned": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
},
"mentioned_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
},
"created_at": "2023-11-07T05:31:56Z"
}
],
"recordings": [
{
"recording_url": "<string>",
"transcription_url": "<string>",
"duration": 123,
"transcription_vtt_url": "<string>",
"transcription_txt_url": "<string>"
}
],
"reminders_minutes": [
123
],
"meeting_link": "<string>",
"meeting_participants": [
"jsmith@example.com"
],
"meeting_provider": "teams_integration",
"provider": "teams_integration",
"sync_warning": "<string>",
"origin": "WEGLY",
"is_actionable": true,
"ai_generated": true,
"parent_task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"hierarchy_level": 123,
"is_subtask": true,
"parent_task": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"parent_task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"hierarchy_level": 123
},
"subtasks": "<array>",
"tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"color": "<string>"
}
],
"calendar_lifecycle_status": "upcoming",
"meeting_mode": "online",
"meeting_location": "<string>",
"meeting_description": "<string>",
"meeting_event": {
"provider": "<string>",
"kind": "instant_link",
"mode": "online",
"location": "<string>",
"description": "<string>",
"status": "<string>",
"sync_status": "<string>",
"sync_operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sync": {
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "synced",
"attempts": 123,
"max_attempts": 123,
"next_retry_at": "2023-11-07T05:31:56Z",
"retry_after_at": "2023-11-07T05:31:56Z",
"can_retry": true,
"error": "<string>"
},
"cancelled_at": "2023-11-07T05:31:56Z",
"online_url": "<string>",
"calendar_url": "<string>",
"attendees": [
{
"email": "jsmith@example.com",
"name": "<string>",
"response_status": "needs_action",
"response_updated_at": "2023-11-07T05:31:56Z",
"is_organizer": true,
"is_self": true
}
],
"is_external_invitation": true,
"can_manage_event": true,
"can_edit_participants": true,
"provider_updated_at": "2023-11-07T05:31:56Z",
"last_synced_at": "2023-11-07T05:31:56Z"
},
"meeting_sync": {
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "synced",
"attempts": 123,
"max_attempts": 123,
"next_retry_at": "2023-11-07T05:31:56Z",
"retry_after_at": "2023-11-07T05:31:56Z",
"can_retry": true,
"error": "<string>"
},
"meeting_attendees": [
{
"email": "jsmith@example.com",
"name": "<string>",
"response_status": "needs_action",
"response_updated_at": "2023-11-07T05:31:56Z",
"is_organizer": true,
"is_self": true
}
],
"meeting_can_manage_participants": true,
"calendar_event_url": "<string>",
"meeting_response": {
"can_respond": true,
"attendee_email": "<string>",
"response_status": "<string>"
},
"meeting_can_respond": true,
"meeting_self_attendee_email": "<string>",
"meeting_self_response_status": "<string>",
"meeting_recorder_sessions": [
{}
],
"comments": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Authorizations
Chave de integração com prefixo wegly_, enviada em Authorization: Bearer . Não é JWT. A chave deve estar ativa, não excluída e dentro da validade. Com allowed_domain, Origin (ou Referer na ausência de Origin) precisa informar o hostname permitido. A empresa e as permissões são obtidas pela chave.
Body
crm_task_type_id e title são obrigatórios. Envie no máximo um vínculo entre crm_lead_id, crm_deal_id, crm_delivery_id, crm_person_id, crm_organization_id e crm_customer_id.
Response
Tarefa criada com sucesso.
