Skip to main content
POST
/
api
/
template
Crear Plantilla
curl --request POST \
  --url https://api.plazbot.com/api/template \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-workspace-id: <x-workspace-id>' \
  --data '
{
  "workspaceId": "<string>",
  "userId": "<string>",
  "elementName": "<string>",
  "languageCode": "<string>",
  "category": "<string>",
  "templateType": "<string>",
  "components": [
    {
      "type": "<string>",
      "format": "<string>",
      "text": "<string>",
      "buttons": [
        {
          "type": "<string>",
          "text": "<string>",
          "phone_number": "<string>",
          "url": "<string>",
          "tagIds": [
            "<string>"
          ],
          "segmentationIds": [
            "<string>"
          ],
          "phaseIds": [
            "<string>"
          ],
          "agentIds": [
            "<string>"
          ]
        }
      ],
      "variables": [
        {
          "variable": "<string>",
          "example": "<string>"
        }
      ]
    }
  ]
}
'
{
  "success": true,
  "code": 123,
  "errorCode": "<string>",
  "message": "<string>",
  "data": {
    "plantilla": {
      "id": "<string>",
      "elementName": "<string>",
      "status": "<string>"
    }
  }
}

Authorizations

Authorization
string
header
required

Token de autenticacion Bearer. Obtenga el token usando el endpoint /api/user/login

Headers

x-workspace-id
string
required

Identificador del workspace

Body

application/json
workspaceId
string
required

Identificador del workspace

userId
string
required

ID del usuario que crea la plantilla

elementName
string
required

Nombre de la plantilla

languageCode
string
required

Codigo de idioma (ej: es, en)

category
string
required

Categoria de la plantilla: MARKETING, UTILITY, AUTHENTICATION

templateType
string
required

Tipo de plantilla: TEXT, IMAGE, VIDEO, DOCUMENT

components
object[]
required

Componentes de la plantilla (HEADER, BODY, FOOTER, BUTTONS)

Response

Plantilla creada exitosamente

success
boolean
required

Indica si la operacion fue exitosa

code
integer
required

Codigo HTTP de la respuesta

errorCode
string | null
required

Codigo de error, null si no hay error

message
string
required

Mensaje descriptivo del resultado

data
object
required