Emails
Email API v3
Documentación de la API de emails
API Versión v3
Todos los endpoints estan disponibles bajo el prefijo /v3, con respuestas que siguen el estandar AIP.
Servidor base: https://services.leadconnectorhq.com
Endpoints
- POST /emails/locations/{locationId}/templates — Crear an email template
- GET /emails/locations/{locationId}/templates — Listar plantillas
- POST /emails/locations/{locationId}/templates/import — Importar an email template
- POST /emails/locations/{locationId}/templates/folders — Crear a template folder
- GET /emails/locations/{locationId}/templates/{templateId} — Obtener Email Template by Id
- DELETE /emails/locations/{locationId}/templates/{templateId} — Eliminar a template
- PATCH /emails/locations/{locationId}/templates/{templateId} — Actualizar an email template
- GET /emails/locations/{locationId}/campaigns/stats/{source}/{sourceId} — Obtener Campaign Statistics
- POST /emails/locations/{locationId}/campaigns/emails — Crear Email Campaign
- GET /emails/locations/{locationId}/campaigns/emails — Listar Email Campaigns
- PATCH /emails/locations/{locationId}/campaigns/emails/{campaignId} — Actualizar Email Campaign
- GET /emails/locations/{locationId}/campaigns/emails/{campaignId} — Obtener Email Campaign by Id
- DELETE /emails/locations/{locationId}/campaigns/emails/{campaignId} — Eliminar campaña
- GET /emails/locations/{locationId}/campaigns/workflows — Listar Workflow Campaigns
- GET /emails/locations/{locationId}/campaigns/workflows/{campaignId} — Obtener Workflow Campaign by Id
- GET /emails/locations/{locationId}/campaigns/bulk-actions — Listar Bulk Action Campaigns
- GET /emails/locations/{locationId}/campaigns/bulk-actions/{campaignId} — Obtener Bulk Action Campaign by Id
- POST /emails/locations/{locationId}/campaigns/emails/{campaignId}/schedule — Schedule Campaign
POST /emails/locations/{locationId}/templates
Crear an email template Create a new email template
Scopes requeridos: emails/templates.write
Parametros:
- locationId (path, string) (requerido) — Id de sede
- Versión (header, string) (requerido) — Versión de la API
Cuerpo de la peticion (application/json):
- name (requerido) — string — Template name
- editorType (requerido) — string — Editor type for the new template. Use html for code-editor templates or text for plain-text templates.
- editorContent — string — Optional initial editor content. Provide HTML or plain-text string content.
- parentFolderId — string — Parent folder Id
- subjectLine — string — Email subject line
- fromName — string — Sender name
- fromEmail — string — Sender email address
- previewText — string — Preview text
- userId — string — Id of the user performing this action
Respuestas:
- 201 — Exitosa
- 400 — Peticion invalida
- 401 — No autorizado
- 403 — El token no tiene acceso a esta sede
- 404 — No encontrado
- 422 — Entidad no procesable
GET /emails/locations/{locationId}/templates
Listar plantillas Get list of templates by location
Scopes requeridos: emails/templates.readonly
Parametros:
- locationId (path, string) (requerido) — Id de sede
- limit (query, number) — Number of templates to return
- offset (query, number) — Number of templates to skip
- search (query, string) — Search by template name
- sortBy (query, string) — Field to sort by
- sortOrder (query, string) — Sort direction
- archived (query, boolean) — Return archived templates
- folderId (query, string) — Folder to list templates from. Use 'root' for top-level listing.
- include (query, string) — Whether to include templates, folders, or both in the response. templates will return only templates, folders will return only folders, and all will return both.
- Versión (header, string) (requerido) — Versión de la API
Respuestas:
- 200 — Exitosa
- 400 — Peticion invalida
- 401 — No autorizado
- 403 — El token no tiene acceso a esta sede
- 404 — No encontrado
- 422 — Entidad no procesable
POST /emails/locations/{locationId}/templates/import
Importar an email template Import a template from a provider URL
Scopes requeridos: emails/templates.write
Parametros:
- locationId (path, string) (requerido) — Id de sede
- Versión (header, string) (requerido) — Versión de la API
Cuerpo de la peticion (application/json):
- importProvider (requerido) — string — Import provider (URL-based providers only)
- importUrl (requerido) — string — Public import URL
- name — string — Template name
- parentFolderId — string — Parent folder Id
- userId — string — Id of the user performing this action
Respuestas:
- 201 — Exitosa
- 400 — Peticion invalida
- 401 — No autorizado
- 403 — El token no tiene acceso a esta sede
- 404 — No encontrado
- 422 — Entidad no procesable
POST /emails/locations/{locationId}/templates/folders
Crear a template folder Create a new template folder
Scopes requeridos: emails/templates.write
Parametros:
- locationId (path, string) (requerido) — Id de sede
- Versión (header, string) (requerido) — Versión de la API
Cuerpo de la peticion (application/json):
- name (requerido) — string — Folder name
- userId — string — Id of the user performing this action
Respuestas:
- 201 — Exitosa
- 400 — Peticion invalida
- 401 — No autorizado
- 403 — El token no tiene acceso a esta sede
- 404 — No encontrado
- 422 — Entidad no procesable
GET /emails/locations/{locationId}/templates/{templateId}
Obtener Email Template by Id Get a single email template by its Id
Scopes requeridos: emails/templates.readonly
Parametros:
- locationId (path, string) (requerido) — Id de sede
- templateId (path, string) (requerido) — Id de plantilla
- Versión (header, string) (requerido) — Versión de la API
Respuestas:
- 200 — Exitosa
- 400 — Peticion invalida
- 401 — No autorizado
- 403 — El token no tiene acceso a esta sede
- 404 — No encontrado
- 422 — Entidad no procesable
DELETE /emails/locations/{locationId}/templates/{templateId}
Eliminar a template Scopes requeridos: emails/templates.write
Parametros:
- locationId (path, string) (requerido) — Id de sede
- templateId (path, string) (requerido) — Id de plantilla
- Versión (header, string) (requerido) — Versión de la API
Respuestas:
- 200 — Exitosa
- 400 — Peticion invalida
- 401 — No autorizado
- 403 — El token no tiene acceso a esta sede
- 404 — No encontrado
- 422 — Entidad no procesable
PATCH /emails/locations/{locationId}/templates/{templateId}
Actualizar an email template Update email template
Scopes requeridos: emails/templates.write
Parametros:
- locationId (path, string) (requerido) — Id de sede
- templateId (path, string) (requerido) — Id de plantilla
- Versión (header, string) (requerido) — Versión de la API
Cuerpo de la peticion (application/json):
- name — string — Template name
- editorContent — string — Editor content to update. Required only when updating template content, and must be provided together with editorType. Provide HTML or plain-text string content.
- editorType — string — Type of editor content. Required only when updating template content, and must be provided together with editorContent.
- previewText — string — Preview text
- subjectLine — string — Email subject line
- fromName — string — Sender name
- fromEmail — string — Sender email address
- archived — boolean — Whether template is archived
- parentFolderId — string — Parent folder Id. Pass null to move template to the root level.
- userId — string — Id of the user performing this action
Respuestas:
- 200 — Exitosa
- 400 — Peticion invalida
- 401 — No autorizado
- 403 — El token no tiene acceso a esta sede
- 404 — No encontrado
- 422 — Entidad no procesable
GET /emails/locations/{locationId}/campaigns/stats/{source}/{sourceId}
Obtener Campaign Statistics Get statistics for email campaigns, workflows, or bulk actions
Scopes requeridos: emails/stats.readonly
Parametros:
- locationId (path, string) (requerido) — Id de sede
- source (path, string) (requerido) — Source type: email-campaigns, workflow-campaigns, or bulk-actions
- sourceId (path, string) (requerido) — Source Id of the email campaign, workflow campaign, or bulk action
- subSourceId (query, string) — Workflow action Id. Only valid when source is workflow-campaigns
- Versión (header, string) (requerido) — Versión de la API
Respuestas:
- 200 — Exitosa
- 400 — Peticion invalida
- 401 — No autorizado
- 403 — El token no tiene acceso a esta sede
- 404 — No encontrado
- 422 — Entidad no procesable
POST /emails/locations/{locationId}/campaigns/emails
Crear Email Campaign Create a new email campaign
Scopes requeridos: emails/campaigns.write
Parametros:
- locationId (path, string) (requerido) — Id de sede
- Versión (header, string) (requerido) — Versión de la API
Cuerpo de la peticion (application/json):
- name (requerido) — string — Campaign name
- editorType (requerido) — string — Editor type for the campaign content. Use html for code-editor campaigns or text for plain-text campaigns.
- templateId — string — Existing template Id to create the campaign from. Omit this field to create a blank campaign.
- editorContent — string — Optional initial editor content to persist immediately after campaign creation. Provide HTML or plain-text string content.
- parentFolderId — string — Parent folder Id
- timeZone (requerido) — string — Timezone for the campaign
- userId (requerido) — string — Id of the user performing this action
- userName — string — Name of the user performing this action
Respuestas:
- 201 — Exitosa
- 400 — Peticion invalida
- 401 — No autorizado
- 403 — El token no tiene acceso a esta sede
- 404 — No encontrado
- 422 — Entidad no procesable
GET /emails/locations/{locationId}/campaigns/emails
Listar Email Campaigns Get list of email campaigns for a location
Scopes requeridos: emails/campaigns.readonly
Parametros:
- locationId (path, string) (requerido) — Id de sede
- limit (query, number) — Number of campaigns to return. Defaults to 10, minimum is 1, maximum is 20
- offset (query, number) — Number of campaigns to skip for pagination. Defaults to 0, minimum is 0
- search (query, string) — Search text for campaign name
- status (query, string) — Filter by campaign status
- Versión (header, string) (requerido) — Versión de la API
Respuestas:
- 200 — Exitosa
- 400 — Peticion invalida
- 401 — No autorizado
- 403 — El token no tiene acceso a esta sede
- 404 — No encontrado
- 422 — Entidad no procesable
PATCH /emails/locations/{locationId}/campaigns/emails/{campaignId}
Actualizar Email Campaign Update an email campaign draft
Scopes requeridos: emails/campaigns.write
Parametros:
- locationId (path, string) (requerido) — Id de sede
- campaignId (path, string) (requerido) — Id de campaña
- Versión (header, string) (requerido) — Versión de la API
Cuerpo de la peticion (application/json):
- name — string — Campaign name
- editorContent — string — Editor content to update. Required only when updating campaign content, and must be provided together with editorType. Provide HTML or plain-text string content.
- editorType — string — Editor type for campaign content. Required only when updating campaign content, and must be provided together with editorContent.
- userId — string — Id of the user performing this action
Respuestas:
- 200 — Exitosa
- 400 — Peticion invalida
- 401 — No autorizado
- 403 — El token no tiene acceso a esta sede
- 404 — No encontrado
- 422 — Entidad no procesable
GET /emails/locations/{locationId}/campaigns/emails/{campaignId}
Obtener Email Campaign by Id Get a single email campaign by its Id
Scopes requeridos: emails/campaigns.readonly
Parametros:
- locationId (path, string) (requerido) — Id de sede
- campaignId (path, string) (requerido) — Id de campaña
- Versión (header, string) (requerido) — Versión de la API
Respuestas:
- 200 — Exitosa
- 400 — Peticion invalida
- 401 — No autorizado
- 403 — El token no tiene acceso a esta sede
- 404 — No encontrado
- 422 — Entidad no procesable
DELETE /emails/locations/{locationId}/campaigns/emails/{campaignId}
Eliminar campaña Delete a campaign
Scopes requeridos: emails/campaigns.write
Parametros:
- locationId (path, string) (requerido) — Id de sede
- campaignId (path, string) (requerido) — Id de campaña
- Versión (header, string) (requerido) — Versión de la API
Respuestas:
- 200 — Exitosa
- 400 — Peticion invalida
- 401 — No autorizado
- 403 — El token no tiene acceso a esta sede
- 404 — No encontrado
- 422 — Entidad no procesable
GET /emails/locations/{locationId}/campaigns/workflows
Listar Workflow Campaigns Get list of workflow campaigns for a location
Scopes requeridos: emails/campaigns.readonly
Parametros:
- locationId (path, string) (requerido) — Id de sede
- limit (query, number) — Number of campaigns to return. Defaults to 10, minimum is 1, maximum is 20
- offset (query, number) — Number of items to skip for pagination. Defaults to 0, minimum is 0
- search (query, string) — Search query to filter campaigns.
- status (query, string) — Filter by campaign status
- Versión (header, string) (requerido) — Versión de la API
Respuestas:
- 200 — Exitosa
- 400 — Peticion invalida
- 401 — No autorizado
- 403 — El token no tiene acceso a esta sede
- 404 — No encontrado
- 422 — Entidad no procesable
GET /emails/locations/{locationId}/campaigns/workflows/{campaignId}
Obtener Workflow Campaign by Id Get a single workflow campaign by its Id
Scopes requeridos: emails/campaigns.readonly
Parametros:
- locationId (path, string) (requerido) — Id de sede
- campaignId (path, string) (requerido) — Id de campaña
- Versión (header, string) (requerido) — Versión de la API
Respuestas:
- 200 — Exitosa
- 400 — Peticion invalida
- 401 — No autorizado
- 403 — El token no tiene acceso a esta sede
- 404 — No encontrado
- 422 — Entidad no procesable
GET /emails/locations/{locationId}/campaigns/bulk-actions
Listar Bulk Action Campaigns Get list of bulk action campaigns for a location
Scopes requeridos: emails/campaigns.readonly
Parametros:
- locationId (path, string) (requerido) — Id de sede
- limit (query, number) — Number of campaigns to return. Defaults to 10, minimum is 1, maximum is 20
- offset (query, number) — Number of campaigns to skip for pagination. Defaults to 0, minimum is 0
- search (query, string) — Search query to filter campaigns.
- dateFrom (query, string) — Filter by start date (ISO 8601 format)
- dateTo (query, string) — Filter by end date (ISO 8601 format)
- status (query, string) — Filter by status
- Versión (header, string) (requerido) — Versión de la API
Respuestas:
- 200 — Exitosa
- 400 — Peticion invalida
- 401 — No autorizado
- 403 — El token no tiene acceso a esta sede
- 404 — No encontrado
- 422 — Entidad no procesable
GET /emails/locations/{locationId}/campaigns/bulk-actions/{campaignId}
Obtener Bulk Action Campaign by Id Get a single bulk action campaign by its Id
Scopes requeridos: emails/campaigns.readonly
Parametros:
- locationId (path, string) (requerido) — Id de sede
- campaignId (path, string) (requerido) — Id de campaña
- Versión (header, string) (requerido) — Versión de la API
Respuestas:
- 200 — Exitosa
- 400 — Peticion invalida
- 401 — No autorizado
- 403 — El token no tiene acceso a esta sede
- 404 — No encontrado
- 422 — Entidad no procesable
POST /emails/locations/{locationId}/campaigns/emails/{campaignId}/schedule
Schedule Campaign Schedule or start an email campaign. The campaign must be in draft, cancelled, or paused status.
Scopes requeridos: emails/campaigns.write
Parametros:
- locationId (path, string) (requerido) — Id de sede
- campaignId (path, string) (requerido) — Id de campaña
- Versión (header, string) (requerido) — Versión de la API
Cuerpo de la peticion (application/json):
- scheduleType (requerido) — string — How to schedule the campaign
- timeZone (requerido) — string — IANA timezone
- userId (requerido) — string — Id of the user performing this action
- userName — string — Name of the user performing this action
- emailMeta (requerido) — — Email subject, sender, and content metadata
- recipients (requerido) — — Who receives the email. Must provide either contactIds or filter.
- sendDays — array — Days of the week to allow sending. Used for batch and RSS scheduleTypes.
- scheduleConfig — — Schedule configuration for immediate, scheduled, batch, and smart_send types. Required when scheduleType is not rss.
- rssConfig — — RSS feed configuration. Required when scheduleType is rss.
- abTestConfig — — A/B test configuration. Can be combined with any scheduleType except rss.
Respuestas:
- 201 — Exitosa
- 400 — Peticion invalida
- 401 — No autorizado
- 403 — El token no tiene acceso a esta sede
- 404 — No encontrado
- 409 — Conflict - Campaign is already scheduled or being processed
- 422 — Entidad no procesable
