Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guide iconUser guide
Developer guide iconDeveloper guide
Admin guide iconAdmin guide
English
  • Русский
  • English
Login
    Getting StartedAdministrator documentationFunctional characteristics
      Technology descriptionarrow
    • Architecture OverviewComponent Description
        Deployment schemesarrow
      • Basic schemeFail-safe schemeTypical Placement in Infrastructure
    System requirements
      Admin Panelarrow
      • Account areaarrow
        • Accountsarrow
        • Account UsersAccount Virtual SendersAccount Database Indexes
        TariffsExternal data configurationLDAPTasksSchedule JobsGlobal Stop ListsWebversion Store Policies
        Settingsarrow
      • Databases
          Accessarrow
        • AdminsAPI tokens
        Notifiers
          MTAarrow
        • Default rulesRetry rulesLock rulesBounce patternsStrategiesKeysISPsPools
      Nodes
        Sendersarrow
      • EmailSMSEvent generatorIntegration with Altcraft Cloud SMTPIntegration with Sendsay
        Reportsarrow
      • Audit JournalData Usage
        Toolsarrow
      • ARF decoderURL decoderSMID decoderLicense
      Platform installationarrow
    • Automatic installationManual installationRunning the platform in a Docker container
      Platform configurationarrow
    • Configuration fileDomain settingsLDAP access configurationSending Email via SMTP relayPixel and push domain configurationCluster and Replication SetupSystem notifications configurationProcesses UNIX sockets configurationHTTPS ConfigurationMigrating from MongoDB Community Edition to Percona Server for MongoDBAdding sender IP addressesDeduplication request settingsPostgreSQL database for Market dataProxy server settingsKeycloak Integration with AltcraftGetting HTTP service statusesConfiguring MongoDB log rotation
        Configuration of system constants and directoriesarrow
      • Filtering bot actionsDirectory of gender markers
      Custom Channelsarrow
    • Creating a Channel
        Pipelinesarrow
      • MessageScheduleListenerModerateStop
          Pipesarrow
        • HTTP RequestPackUnpackEventerSchedulerSelectorSQLStore SetStore GetLogResultError
      External Objects (Entities)Templating LanguageSending FilesPresets (Field Sets)DebuggingTechnical Limitations
      Platform maintenancearrow
    • Personnel requirementsPlatform maintenance processesPlatform updatingBackup and recoveryTransferring the platform to a new serverCreating, deleting, and populating tables for statistics in ClickHouseUsing the aktool utilityUsers and directories engaged by the platformPlatform service monitoringProcess and mailing monitoring via Prometheus
      Extraarrow
    • System page customizationSend Message IDClickHouse History Migration GuideInstructions for migrating history to ClickHouseUtility for importing push subscriptions to Firebase projectUtility for importing push subscriptions to Firebase projectENS: настройка интеграции
    Processing HTTP/HTTPS traffic
      Administrator APIarrow
      • Accounts admin apiarrow
        • Restricted accessarrow
        • Account Activation and DeactivationAccount Freeze and Unfreeze
        Get accounts listAdd a new accountDelete the account
        Account usersarrow
      • Update an Existing AccountAdd a new userDelete a userGet a list of usersSending a Welcome Email
        Nodesarrow
      • Synchronize node MTA configurationGet nodes listGet node MTA statusActivate node MTADeactivate node MTA
        Senders admin apiarrow
      • Create or update AKMTA senderGet AKMTA sender informationAssign account to senderGet senders listDelete senderRestore sender
          Sender queuearrow
        • Get sender queue informationHold sender queueRelease sender queueClear sender queue
        Virtual sendersarrow
      • Get virtual senders listGet virtual sender informationCreate virtual senderUpdate virtual senderClone virtual senderDelete virtual sender
    Documentation Archive
  • Custom Channels
  • External Objects (Entities)

External Objects (Entities)

An External Object (Entity) is an external entity with which a channel interacts through an API. An Entity allows you to load, create, and edit external data directly from the platform interface when configuring channel content. The retrieved data is then available in the main channel pipelines (Message, Schedule, Listener, Stop, Moderate) through the templating language.

Typical scenario: in the template editor, the user selects a profile from an external CRM, and the data of that profile (name, email, ID) is passed to the Message pipeline for sending to the external service.

External Objects are created on the External Objects tab when configuring a channel:

Creating an Entity​

When creating an external object, you need to specify:

FieldDescription
NameEntity name. Displayed in the interface when binding to a channel entity field
ShortnameUnique string identifier. Entity fields will be accessible in pipelines through templating by this name
DescriptionBrief description of the entity

Object structure​

The Object Structure section defines which fields the external API returns and which of them will be available in pipelines. This is a list of fields of different types.

When adding a field (Add Field), the following are specified:

FieldDescription
TitleDisplay name of the field
ShortnameField name for access in a pipeline through templating
TypeData type

Available field types:

  • Integer — integer
  • String — string
  • Boolean — boolean value
  • Serialized JSON string — JSON object
  • HTML content — HTML content
  • Text content — multiline text
  • Image Field — image

Among the fields, you need to designate a Primary Field (unique object identifier) and a Preview Field. The Preview Field is the field whose value is displayed in the user interface when previewing an entity. If the entity is bound to a screen form in list mode with selection enabled, the Preview Field value will be used to display the selected list items:

All operations must return data that matches this structure (not necessarily all fields, but the ones that are returned must be described here).

Operations​

An operation is a method of interacting with an external entity (create, delete, get a list, get a single object, etc.). Each operation consists of input data (Input Fields) and a pipeline.

Available operations​

OperationReturnsEffect on the interface
ListArray of objects"Add" button in a field with a bound Entity. Opens a table with the ability to select
ReadSingle object—
CreateSingle object"+" (create) button in a field with a bound Entity
UpdateSingle objectEdit button (pencil) in a field with a bound Entity
Delete—Delete button in a field with a bound Entity

Input data (Input Fields)​

A set of fields that the user fills in the interface before executing the operation. Input data is not required to be configured. For example, an API token and a database ID — values that may change and that you do not want to hardcode in the pipeline.

Values from Input Fields are available in the pipeline through $in.<shortname>.

Input Field as a filter for SQL.

Often, Input Fields are used to filter data in an SQL query. For example, if a field id is added for the Read operation, you can write SELECT * FROM my_table WHERE id = $in.id in the SQL query to retrieve a specific record by the entered ID.

When adding a field (Add Row), you can select a type:

  • Field — a data field. Title, Shortname, Type, required flag, default value, value range (Minimum/Maximum), and other parameters are configured.
  • Layout element — a decorative element: header (header), text block (message), divider (divider). Does not store data, used for visual organization of the form.

Operation pipeline​

A JSON array of pipes that is executed when the operation is launched from the interface. The configuration is similar to other pipelines in the channel, with some nuances. The pipeline is synchronous — the user who launches the operation in the interface will wait for the result.

Available pipe types:

PipePurpose
HTTP RequestHTTP request to an external API
PackPack data into JSON/XML
UnpackUnpack JSON/XML
ResultFix the operation result (required)
ErrorTerminate with an error
SelectorConditional branching
SQLSQL query to the database
Store SetSave data to storage
Store GetRead data from storage
LogWrite to log
caution

An event must always pass through the Result pipe before exiting the pipeline (unless exiting through Error).

Output forms (Output Operations Form)​

An output form defines how the operation result is displayed in the interface. The List form is bound to the List operation, the Single form — to the Read operation.

You cannot create new fields in an output form — you can only select and arrange fields already created in the Object Structure section.

FormUsed forDescription
ListList operationTable of objects. Fields are selected from Object Structure. The field order in the form determines the column order in the table
Single formRead operationForm with fields of a single object. Fields are selected from Object Structure

Fields in the output form are arranged by drag-and-drop.

Binding an External Object to a channel entity field​

After creating an External Object, it can be bound to a field in the Object Fields section of the channel (on the Template or Campaign tabs, where the Add Object button is available). A field with a bound External Object occupies the entire row in the Layout.

When binding, the following are configured:

FieldDescription
ShortnameName for accessing Entity data in the pipeline (for example, $template.profile). See templating language
Entity button descriptionButton text in the interface that opens Entity editing (for example, "Select profile")
External ObjectSelection of an External Object from the list of created ones
Entity operationSpecifies which operation result (List or Read) will be sent to the sender

Additional settings for the List operation​

FieldDescription
Select entity from listIf enabled — the user selects objects from the list. Activates the settings below
Multiple selectionAllows selecting multiple objects. If disabled — only one
Save selected entityDetermines whether to save the data when configuring the field, or to load fresh data when launching the mailing

List operation work types​

Depending on the Entity binding settings to a field, the List operation works in one of four modes:

ModeSettingsBehavior
Automatic loadingWithout additional checkboxesAll data from List is automatically pulled when the campaign is sent. The user does not select records — the List pipeline executes and returns all data
Single entity selection"Select entity from list" enabledThe user selects one record from the list. When the campaign is sent, data is pulled through the Read operation by the ID of the selected record
Multiple selection"Select entity from list" + "Multiple selection"The user selects one or more records from the list. Each is pulled through Read
Saving at template creation"Save selected entity" enabledData is pulled from the external database when the template is saved and stored in MongoDB, not when the campaign is sent

List + Read connection​

For the "Single entity selection" and "Multiple selection" modes, both operations must be configured:

  1. List — to display the list of available records (the user sees and selects)
  2. Read — to load full data of the selected record by ID

When a record is selected from the list, the platform automatically calls the Read operation with the ID of the selected record. Therefore, Read must be configured with an Input Field (for example, id) and a pipeline that uses this ID for filtering: SELECT * FROM my_table WHERE id = $in.id.

Pipeline examples for SQL operations​

Full pipeline examples for all five operations (Read, List, Create, Update, Delete) using the SQL pipe are in the SQL article. Key points:

  • Read: map: true + filter $in.id → Result with $#in.sql_query
  • List: without map (return array) → Result with $#in.sql_query
  • Create: INSERT with $in.<field> → Result
  • Update: UPDATE with $in.<field>, WHERE $in.id → Result
  • Delete: DELETE WHERE $in.id → Result

Example​

Suppose the List operation returned an array:

[
{ "id": 1, "name": "Segment 1" },
{ "id": 2, "name": "Segment 2" },
{ "id": 3, "name": "Segment 3" },
{ "id": 4, "name": "Segment 4" }
]

The user selected Segment 1 and Segment 3. The field will store:

[
{ "id": 1, "name": "Segment 1" },
{ "id": 3, "name": "Segment 3" }
]

In the pipeline, the data can be accessed through templating. For example, if the field is configured in Campaign:

TemplateResult
$campaign.segment.%1.nameSegment 3
$campaign.segment[{ "id": 1, "name": "Segment 1" }, { "id": 3, "name": "Segment 3" }]

If Select entity from list is disabled, the list of data cannot be edited from the interface — all data will be loaded and written to the field automatically by the operation pipeline.

Last updated on Jul 21, 2026
Previous
Error
Next
Templating Language
  • Creating an Entity
  • Object structure
  • Operations
    • Available operations
    • Input data (Input Fields)
    • Operation pipeline
  • Output forms (Output Operations Form)
  • Binding an External Object to a channel entity field
    • Additional settings for the List operation
    • List operation work types
    • List + Read connection
    • Pipeline examples for SQL operations
    • Example
© 2015 - 2026 Altcraft, LLC. All rights reserved.