Skip to content

Backend API ​

The Stripo Plugin Backend API allows for various operations related to compiling and managing email templates, including inlining CSS styles into HTML tags to provide the final HTML code ready to be sent to recipients. Please take a look at the available methods below.

Compiling Email Templates ​

This API call allows inlining CSS styles into HTML tags and provides the final HTML code of email templates that are ready to be sent to recipients.

OpenAPI Specification ​

Reference
yaml
openapi: 3.0.3
info:
  title: Compiling Email Templates
  description: |
    This API call allows inlining CSS styles into HTML tags and provides the final HTML code of email templates that are ready to be sent to recipients.
  version: 1.0.0
servers:
  - url: https://plugins.stripo.email
    description: Stripo API server
paths:
  /coediting/v1/email/compilation:
    get:
      tags:
        - Methods
      summary: Get compiled email
      description: Get compiled inline CSS into HTML email templates.
      parameters:
        - name: minimize
          in: query
          required: false
          description: >-
            If true then html code will be in a format of a single line without
            line breaks
          schema:
            type: boolean
            example: false
        - name: inlineCss
          in: query
          required: false
          description: >
            Allows you to select the type of code in the received compiled
            email. 
              inlineCss: true - by default. This means that we will see CSS placed inside tags when we make a compiled form of HTML. 
              inlineCss: false - editor will not inline the CSS in the tags, but rather write it at the head of the email.
          schema:
            type: boolean
            example: false
        - name: ES-PLUGIN-AUTH
          in: header
          required: true
          description: Stripo plugin auth token in the format - Bearer ${AUTH_TOKEN}
          schema:
            type: string
        - name: ES-PLUGIN-UI-DATA
          in: header
          required: true
          description: > 
            JSON string with parameters to identify email (Same as metadata param in UI editor). For example: {"emailId": "id1"}
          schema:
            type: string
      responses:
        '200':
          description: Compiled email
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompiledEmail'
components:
  schemas:
    CompiledEmail:
      type: object
      properties:
        html:
          type: string
          description: Compiled HTML
        ampHtml:
          type: string
          description: Compiled AMP version of HTML
        ampErrors:
          type: array
          description: List of AMP errors inside AMP HTML email template
          items:
            type: string
        syncModules:
          type: array
          description: List of IDs of sync modules what was found in the HTML
          items:
            type: integer
            format: int64
        conditions:
          type: array
          description: List of AMP errors inside AMP HTML email template
          items:
            $ref: '#/components/schemas/Condition'
    Condition:
      type: object
      properties:
        id:
          type: string
          description: Condition ID
        name:
          type: string
          description: Condition name
        description:
          type: string
          description: Condition description
        beforeScript:
          type: string
          description: Content of beforeScript section
        afterScript:
          type: string
          description: Content of afterScript section

Raw HTML Compilation ​

This API call allows you to compile raw HTML and CSS into export-ready email HTML by passing the source directly in the request body. Inlines CSS styles, resolves synchronizable modules, applies display conditions, adds UTM parameters, and generates AMP HTML when AMP markup is detected.
Use this method for legacy integrations or external workflows where email content is managed outside the Stripo editor.

OpenAPI Specification ​

Reference
yaml
openapi: 3.0.3
info:
  title: Raw HTML Compilation 
  version: 1.0.0

servers:
  - url: https://plugins.stripo.email
    description: Stripo plugin host

paths:
  /api/v1/cleaner/v1/compress:
    post:
      summary: Compile raw HTML and CSS
      description: |
        Accepts raw email HTML and CSS directly and returns compiled, export-ready HTML.

        Unlike the session-based compilation endpoint, this method does not require an active
        editor session or email ID — it processes whatever HTML and CSS you provide.

        Suitable for legacy integrations and external workflows where email content is managed
        outside the Stripo editor. Performs the same compilation pipeline: inlines CSS styles,
        resolves synchronizable modules, applies display conditions, adds UTM parameters,
        and generates AMP HTML when AMP markup is detected.
      operationId: compileTemplateHtml
      tags:
        - Methods
      security:
        - ESPluginAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompressRequest'
            example:
              html: "<!DOCTYPE html><html><head><title>Subject</title></head><body><p>Hello</p></body></html>"
              css: "p { color: red; }"
              minimize: true
              utmSource: "newsletter"
              utmMedium: "email"
              utmCampaign: "spring_sale"
      responses:
        '200':
          description: HTML was compiled successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompressResponse'
              example:
                html: "<!DOCTYPE html><html><head></head><body><p style=\"color:red\">Hello</p></body></html>"
                subject: "Subject"
        '400':
          description: Bad request, unsupported content type, missing body, missing `html`, or validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
              examples:
                missingHtml:
                  value:
                    message: "'html' param is required"
                missingBody:
                  value:
                    message: "Required request body is missing"
                cssTooLarge:
                  value:
                    message: "'css' must not be greater than 5 000 000 symbols"
                htmlTooLarge:
                  value:
                    message: "'html' must not be greater than 9 000 000 symbols"
        '401':
          description: Missing, invalid, or expired plugin authentication token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseText'
              example:
                message: "ES-PLUGIN-AUTH header is invalid or token is expired. Set header 'ES-PLUGIN-AUTH: Bearer YOUR_AUTH_TOKEN'"
        '429':
          description: Rate limit reached.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
              example:
                error: RATE_LIMIT_REACHED
        '500':
          description: Unexpected service error.

components:
  securitySchemes:
    ESPluginAuth:
      type: apiKey
      in: header
      name: ES-PLUGIN-AUTH
      description: Plugin JWT authentication header. Expected format is `Bearer YOUR_AUTH_TOKEN`.

  schemas:
    CompressRequest:
      type: object
      required:
        - html
      additionalProperties: false
      description: |
        Request body for compiling email template HTML.
        Only `html` is required by runtime validation.
      properties:
        html:
          type: string
          maxLength: 9000000
          description: Source email template HTML to compile.
        css:
          type: string
          description: |
            CSS to inline into the HTML. If absent or empty, HTML is returned without CSS inlining.
            Non-blank CSS is rejected only when both the raw CSS and the CSS after comment removal exceed 5,000,000 characters.
        minimize:
          type: boolean
          nullable: true
          default: false
          description: When true, removes unnecessary whitespace and compresses the regular HTML output.
        utmSource:
          type: string
          description: Value to add as the `utm_source` query parameter on links.
        utmMedium:
          type: string
          description: Value to add as the `utm_medium` query parameter on links.
        utmCampaign:
          type: string
          description: Value to add as the `utm_campaign` query parameter on links.
        utmContent:
          type: string
          description: Value to add as the `utm_content` query parameter on links.
        utmTerm:
          type: string
          description: Value to add as the `utm_term` query parameter on links.
        customUtms:
          type: array
          description: Custom query parameters to add to links along with standard UTM parameters.
          items:
            $ref: '#/components/schemas/CustomUtm'
        mergeTags:
          type: array
          description: Merge tag placeholders to preserve while processing links and UTM parameters.
          items:
            type: string
        apiRequestData:
          type: string
          description: |
            Plugin request data, encoded as a JSON string, passed to synchronizable module replacement.
            In the editor UI this is derived from plugin `apiRequestData` only when synchronizable modules are enabled.
            Pass it only if the HTML contains synchronizable modules that must be resolved.

    CompressResponse:
      type: object
      required:
        - html
      additionalProperties: false
      properties:
        html:
          type: string
          description: Compiled HTML.
        subject:
          type: string
          description: Email subject extracted from the HTML title.
        preheader:
          type: string
          description: Hidden email preheader extracted from the HTML.
        ampHtml:
          type: string
          description: Generated AMP HTML. Returned only when AMP markup is detected in source HTML.
        ampErrors:
          type: array
          description: AMP validation errors. Empty array means AMP validation passed; absent when AMP HTML was not generated.
          items:
            type: string
        syncModules:
          type: array
          description: Synchronizable module IDs.
          items:
            type: integer
            format: int64
        conditions:
          type: array
          description: Display conditions extracted from the source HTML.
          items:
            $ref: '#/components/schemas/Condition'

    Condition:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: Condition identifier.
        name:
          type: string
          description: Condition name.
        description:
          type: string
          description: Condition description.
        beforeScript:
          type: string
          description: Script inserted before the conditional content.
        afterScript:
          type: string
          description: Script inserted after the conditional content.

    CustomUtm:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          description: Custom query parameter name.
        value:
          type: string
          description: Custom query parameter value.

    APIError:
      type: object
      additionalProperties: true
      properties:
        message:
          type: string
          description: Human-readable error message.
        traceId:
          type: string
          description: Trace identifier, when available.
        code:
          type: string
          description: Application error code, when available.
        params:
          description: Additional error parameters.
        error:
          description: Structured internal error data, when available.
        detailedError:
          type: string
          description: Detailed error description, when available.
        date:
          type: string
          format: date-time
          description: Error timestamp, when available.

    ResponseText:
      type: object
      additionalProperties: false
      properties:
        message:
          type: string
          description: Error message returned by the API gateway auth filter.

    RateLimitError:
      type: object
      additionalProperties: false
      properties:
        error:
          type: string
          description: Rate limit error code.
          example: RATE_LIMIT_REACHED

Retrieving HTML and CSS (Legacy Compatibility) ​

This API call allows you to retrieve HTML and CSS from the “reference email” in Stripo’s database. This is particularly useful for maintaining compatibility with older versions of the Stripo editor.

OpenAPI Specification ​

Reference
yaml
openapi: 3.0.3
info:
  title: Retrieving HTML and CSS (Legacy Compatibility)
  description: |
    Returns HTML with developer markup and classes, along with CSS, to be stored within your database. This method ensures that when a customer wants to open an email with the editor (old plugin) next time, the stored HTML and CSS can be sent to the editor, maintaining compatibility with legacy systems and preserving the email's design and structure.
  version: 1.0.0
servers:
  - url: https://plugins.stripo.email
    description: Stripo API server
paths:
  /coediting/v1/email/html-css:
    get:
      tags:
        - Methods
      summary: Get HTML and CSS of email template
      description: Get HTML with developer markup and classes, along with CSS
      parameters:
        - name: ES-PLUGIN-AUTH
          in: header
          required: true
          description: Stripo plugin auth token in the format - Bearer ${AUTH_TOKEN}
          schema:
            type: string
        - name: ES-PLUGIN-UI-DATA
          in: header
          required: true
          description: >
            JSON string with parameters to identify email (Same as metadata param in UI editor). For example: {"emailId": "id1"}
          schema:
            type: string
      responses:
        '200':
          description: HTML and CSS of email template
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HtmlCss'
components:
  schemas:
    HtmlCss:
      type: object
      properties:
        html:
          type: string
          description: HTML of email template
        css:
          type: string
          description: CSS of email template
        emailId:
          type: integer
          format: int64
          description: ID of email
        syncModules:
          type: array
          description: List of IDs of sync modules what was found in the HTML (only in case you've activated the Synchronized Modules)
          items:
            type: integer
            format: int64
        utm:
          $ref: '#/components/schemas/UtmParams'
          description: UTM params of email template
    UtmParams:
      type: object
      properties:
        source:
          type: string
          description: UTM source
        medium:
          type: string
          description: UTM medium
        campaign:
          type: string
          description: UTM campaign
        content:
          type: string
          description: UTM content
        term:
          type: string
          description: UTM term
        custom:
          description: UTM custom properties
          additionalProperties:
            type: string
            nullable: true

Cloning an Email Model ​

Create a copy of an existing email model programmatically.

This API method allows you to clone an existing email model, creating a new, independent model with a unique identifier. The original email model is not modified. Use this endpoint to duplicate email models when you need to reuse structure or content in automation, integrations, or editorial workflows.

OpenAPI Specification ​

Reference
yaml
openapi: 3.0.3
info:
  title: Email Model Clone API
  description: |
    This API method allows you to clone an existing email model and create a new one
    based on its structure and content.

    The cloned email model is created as a separate entity with a new identifier,
    while the original email model remains unchanged.

    This method is useful when you need to duplicate an email model programmatically
    and continue working with the copied version independently.
  version: 1.0.0

servers:
  - url: https://plugins.stripo.email
    description: Stripo API server

paths:
  /coediting/v1/email/copy:
    post:
      tags:
        - Methods
      summary: Clone email model
      description: |
        Clone an existing email model and create a new email model based on it.

        The method copies the structure and content of the source email model
        and creates a new email model with a new unique identifier.

        The response contains the identifier of the newly created email model,
        which can be used for further operations in the editor or via API.

        To copy a specific historical version of the source email, pass the optional patchId — see the [Restore a Version as a New Email](/plugin-invocations/javascript-api#restore-a-version-as-a-new-email) guide.
      parameters:
        - name: ES-PLUGIN-AUTH
          in: header
          required: true
          description: Stripo plugin auth token in the format - Bearer ${AUTH_TOKEN}
          schema:
            type: string
        - name: ES-PLUGIN-UI-DATA
          in: header
          required: true
          description: >
            JSON string with parameters to identify email
            (same as metadata parameter in the UI editor).
            For example: {"emailId": "id1"}
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CopyEmailRequest'
      responses:
        '200':
          description: |
            Email model cloned successfully.
            Returns the ID of the newly created email model.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CopyEmailResponse'

components:
  schemas:
    CopyEmailRequest:
      type: object
      properties:
        sourceId:
          type: string
          description: Source email ID
        destinationId:
          type: string
          description: Destination email ID
        patchId:
          type: string
          format: uuid
          nullable: true
          description: >-
            Optional. UUID of a version (patch) of the source email. When provided, the destination model is created from the content of this historical version instead of the current state of the source model. The value must identify a visible, non-technical version of the source email -- an invalid, unknown, foreign, hidden, or technical patchId returns 400 Bad Request and the destination model is not created. The initial version ID 00000000-0000-0000-0000-000000000001 is supported. Note: if the source email uses a Template Theme, the destination is bound to the latest version of that theme -- the historical theme state is not restored.

    CopyEmailResponse:
      type: object
      properties:
        destinationId:
          type: string
          description: Destination email ID

Deleting Email Models ​

Delete one or multiple email models programmatically. This API method creates a background deletion job for the email models you select, either by their unique identifiers, by a prefix of the identifier, or both. Up to 1000 explicit identifiers can be passed per call. A prefix pattern such as qaautomation1-* selects every model of your plugin whose identifier starts with the given prefix; the number of models matched by a pattern is not limited. Deleted models are permanently removed and cannot be restored. Use this endpoint to manage email model lifecycle in automation pipelines, integrations, or bulk cleanup workflows, for example, to clear test models created across several environments without keeping a list of their identifiers. A pattern must contain exactly one * at the end, preceded by at least three literal characters. Matching is case-sensitive and limited to the plugin's authenticated models in the request. The 202 response confirms that the job was accepted; check the job status and per-model results to confirm that deletion finished.

OpenAPI Specification ​

Reference
yaml
openapi: 3.0.3
info:
  title: Asynchronous Email Model Deletion API
  version: 1.1.0
  description: |
    Delete emails by submitting their IDs, literal
    email-ID prefixes, or their union. Requests require a plugin token with the API role
    and apply only to emails belonging to that plugin.
    
    A 202 response confirms that a deletion job was stored, not that deletion finished.
    If needed, poll the job and inspect its item results before considering the request complete.
    Deleted data cannot be restored.
  contact:
    name: Stripo Support
    url: https://stripo.email
servers:
  - url: https://plugins.stripo.email
    description: Stripo Plugin API server
security:
  - pluginAuth: []
tags:
  - name: Methods
    description: Email model deletion jobs
paths:
  /coediting/v1/emails/delete-jobs:
    post:
      tags: [Methods]
      operationId: createEmailDeleteJob
      summary: Create an email deletion job
      description: |
        Accepts `emailIds`, `emailIdPatterns`, or both. At least one array must be
        nonempty. A field may be omitted or empty when the other is nonempty;
        explicit null, non-array values, invalid elements, and unknown fields
        return 400 before a job is created. The request body is limited to 1 MiB.
        `emailIds` are literal IDs, including any `*`.
        At most 1000 distinct explicit IDs are accepted. 
        Duplicate IDs and overlapping selections are processed once.

        Each pattern must contain exactly one `*`, at the end, after at least
        three literal Unicode code points. Matching preserves case and treats
        `%`, `_`, and `!` in the prefix as literal characters.
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDeleteJobRequest'
            examples:
              singleEmail:
                summary: Delete one email model
                value:
                  emailIds: [email-123]
              multipleEmails:
                summary: Delete multiple email models
                value:
                  emailIds: [email-123, email-456]
              prefixOnly:
                summary: Delete models matching either literal prefix
                value:
                  emailIdPatterns: ['qaautomation1-*', 'gluautomation2-*']
              mixedSelection:
                summary: Combine literal IDs and prefixes with deduplication
                value:
                  emailIds: [email-123, 'literal*']
                  emailIdPatterns: ['qaautomation1-*', 'QA_%!*']
              emptyIdsWithPrefix:
                summary: An empty emailIds array is valid with a nonempty pattern array
                value:
                  emailIds: []
                  emailIdPatterns: ['qaautomation1-*']
              idsWithEmptyPatterns:
                summary: An empty pattern array is valid with nonempty emailIds
                value:
                  emailIds: [email-123]
                  emailIdPatterns: []
      responses:
        '202':
          description: Job persisted. Deletion may still be pending or running.
          headers:
            Location:
              description: Relative URL of the job status endpoint.
              schema:
                type: string
                example: /coediting/v1/emails/delete-jobs/gcj_0123456789abcdef0123456789abcdef
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteJob'
              examples:
                queued:
                  $ref: '#/components/examples/QueuedJob'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /coediting/v1/emails/delete-jobs/{jobId}:
    get:
      tags: [Methods]
      operationId: getEmailDeleteJob
      summary: Get deletion job status and progress
      description: |
        Returns the current state. The `total`, `remaining`, and `percentage`
        progress fields are null until discovery finishes. `discovered` counts
        unique candidates across both selector arrays.
      parameters:
        - $ref: '#/components/parameters/JobId'
      responses:
        '200':
          description: Current job status and progress.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteJob'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '500':
          $ref: '#/components/responses/InternalServerError'

  /coediting/v1/emails/delete-jobs/{jobId}/items:
    get:
      tags: [Methods]
      operationId: listEmailDeleteJobItems
      summary: List per-email results
      description: |
        Returns one page of results for the authenticated plugin's job.
        Follow `nextCursor` until it is absent. The cursor is opaque.
        Results may change while the job is running; inspect them again after
        a terminal job status if a final accounting is required.
      parameters:
        - $ref: '#/components/parameters/JobId'
        - name: cursor
          in: query
          required: false
          description: Opaque `nextCursor` returned by the previous page.
          schema:
            type: string
        - name: pageSize
          in: query
          required: false
          description: Items per page; defaults to 50.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: status
          in: query
          required: false
          description: Optional case-insensitive item-status filter.
          schema:
            $ref: '#/components/schemas/ItemStatus'
      responses:
        '200':
          description: Page of per-email results.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteJobItemsPage'
              examples:
                firstPage:
                  value:
                    items:
                      - emailId: email-123
                        status: SUCCEEDED
                        attempt: 1
                        error: null
                      - emailId: email-456
                        status: FAILED
                        attempt: 1
                        error:
                          code: ROW_TOO_LARGE
                          message: The email could not be processed
                    nextCursor: "2"
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '500':
          $ref: '#/components/responses/InternalServerError'

components:
  securitySchemes:
    pluginAuth:
      type: apiKey
      in: header
      name: ES-PLUGIN-AUTH
      description: Bearer plugin token with the API role, for example `Bearer YOUR_AUTH_TOKEN`.

  parameters:
    JobId:
      name: jobId
      in: path
      required: true
      description: Job ID returned by the create endpoint.
      schema:
        type: string
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: |
        Retry key scoped to the plugin and DELETE operation. The same key and
        normalized selector arrays return the existing job. Order and duplicate
        selectors do not change the selection identity; both `emailIds` and
        `emailIdPatterns` participate. Reusing the key with a different selector
        set returns 409. Keep the returned job ID for subsequent reads;
        idempotency is limited by the lifetime of the stored job.
      schema:
        type: string

  headers:
    TraceId:
      description: Trace identifier for support and diagnostics.
      schema:
        type: string

  schemas:
    CreateDeleteJobRequest:
      type: object
      additionalProperties: false
      description: |
        Provide a nonempty emailIds array, a nonempty emailIdPatterns array,
        or both. Either field may be omitted or empty when the other is
        nonempty. Neither field nor its elements may be null.
      anyOf:
        - required: [emailIds]
          properties:
            emailIds:
              minItems: 1
        - required: [emailIdPatterns]
          properties:
            emailIdPatterns:
              minItems: 1
      properties:
        emailIds:
          type: array
          description: |
            Literal email IDs in this plugin's namespace; `*` has no wildcard
            meaning in this array. At most 1000 distinct IDs are accepted,
            subject to a potentially lower server-configured limit. Each ID must be
            nonblank and at most 100 UTF-8 bytes, and the composed plugin model
            ID must also fit its server limit. Double quotes, backslashes, tabs,
            carriage returns, and newlines are rejected in IDs. Duplicates are
            accepted and processed once. maxLength is a Unicode-code-point
            upper bound; the server additionally enforces the UTF-8 byte limit.
          items:
            type: string
            minLength: 1
            maxLength: 100
            pattern: '^[^"\\\r\n\t]+$'
            not:
              anyOf:
                - pattern: '^[\u0009-\u000d \u0085\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000]*$'
                - pattern: '["\\\r\n\t]'
          example: [email-123, email-456]
        emailIdPatterns:
          type: array
          description: |
            Literal email-ID prefixes in this plugin's namespace, each followed
            by one terminal wildcard. Duplicate and overlapping patterns are
            accepted; every discovered email is processed once. There is no
            per-pattern result count or limit of 1000 discovered candidates.
          items:
            $ref: '#/components/schemas/EmailIDPattern'
          example: ['qaautomation1-*', 'gluautomation2-*']

    EmailIDPattern:
      type: string
      minLength: 4
      maxLength: 101
      pattern: '^[^*"\\\r\n\t]{3,}\*$'
      not:
        anyOf:
          - pattern: '^[\u0009-\u000d \u0085\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000]*\*$'
          - pattern: '["\\\r\n\t]'
      description: |
        Exactly one `*` is required at the end, preceded by at least three
        literal Unicode code points. The prefix must not consist entirely of
        whitespace and must fit 100 UTF-8 bytes; the composed plugin model-ID
        prefix must also fit its server limit. maxLength is a Unicode-code-point
        upper bound; the server additionally enforces the UTF-8 byte limit.
        Double quotes, backslashes, tabs, carriage returns, and newlines are
        forbidden in the prefix. Matching is case-sensitive; `%`, `_`, and `!`
        are literal. IDs and prefixes are not trimmed or lowercased.
      example: 'qaautomation1-*'

    JobStatus:
      type: string
      enum:
        - QUEUED
        - SCANNING
        - RUNNING
        - PAUSE_REQUESTED
        - PAUSED
        - STOP_REQUESTED
        - STOPPED
        - COMPLETED
        - COMPLETED_WITH_ERRORS
        - FAILED

    ItemStatus:
      type: string
      enum:
        - PENDING
        - RUNNING
        - SUCCEEDED
        - SKIPPED
        - FAILED
        - NOT_PROCESSED

    DeleteJob:
      type: object
      additionalProperties: false
      required: [jobId, status, createdAt, startedAt, finishedAt, expiresAt, progress]
      properties:
        jobId:
          type: string
        status:
          $ref: '#/components/schemas/JobStatus'
        createdAt:
          type: string
          format: date-time
        startedAt:
          type: string
          format: date-time
          nullable: true
        finishedAt:
          type: string
          format: date-time
          nullable: true
        expiresAt:
          type: string
          format: date-time
          description: Time after which the job and its items may no longer be available.
        progress:
          $ref: '#/components/schemas/DeleteJobProgress'

    DeleteJobProgress:
      type: object
      additionalProperties: false
      required: [total, discovered, processed, running, succeeded, skipped, failed, remaining, percentage]
      properties:
        total:
          type: integer
          format: int64
          nullable: true
          description: Final unique candidate count; null until discovery finishes.
        discovered:
          type: integer
          format: int64
          description: Unique candidates recorded so far across IDs and patterns.
        processed:
          type: integer
          format: int64
          description: Sum of succeeded, skipped, and failed items.
        running:
          type: integer
          format: int64
        succeeded:
          type: integer
          format: int64
        skipped:
          type: integer
          format: int64
        failed:
          type: integer
          format: int64
        remaining:
          type: integer
          format: int64
          nullable: true
        percentage:
          type: number
          format: double
          nullable: true

    DeleteJobItemsPage:
      type: object
      additionalProperties: false
      required: [items]
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/DeleteJobItem'
        nextCursor:
          type: string
          description: Omitted when there is no next page.

    DeleteJobItem:
      type: object
      additionalProperties: false
      required: [emailId, status, attempt, error]
      properties:
        emailId:
          type: string
        status:
          $ref: '#/components/schemas/ItemStatus'
        attempt:
          type: integer
          minimum: 0
        error:
          $ref: '#/components/schemas/ItemError'

    ItemError:
      type: object
      nullable: true
      additionalProperties: false
      required: [code, message]
      properties:
        code:
          type: string
          description: Machine-readable reason; possible codes can evolve.
          example: ROW_TOO_LARGE
        message:
          type: string
          description: Human-readable explanation.

    ErrorResponse:
      type: object
      required: [Message]
      properties:
        Message:
          type: string

  examples:
    QueuedJob:
      value:
        jobId: gcj_0123456789abcdef0123456789abcdef
        status: QUEUED
        createdAt: '2026-09-29T08:00:00Z'
        startedAt: null
        finishedAt: null
        expiresAt: '2026-09-30T08:00:00Z'
        progress:
          total: null
          discovered: 0
          processed: 0
          running: 0
          succeeded: 0
          skipped: 0
          failed: 0
          remaining: null
          percentage: null

  responses:
    ControlAccepted:
      description: Control accepted; the returned job state may still be transitional.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DeleteJob'
    BadRequest:
      description: |
        Invalid body, empty combined selection, null or malformed selector
        arrays, invalid email IDs or patterns, excess distinct explicit IDs,
        unknown request fields, cursor, status filter, or page size.
      content:
        text/plain:
          schema:
            type: string
          example: '{"Message":"emailIds or emailIdPatterns must be nonempty"}'
    Unauthorized:
      description: Missing or invalid plugin authentication.
      content:
        text/plain:
          schema:
            type: string
          example: '{"Message":"Unauthorized"}'
    Forbidden:
      description: The plugin token does not have the API role.
      content:
        text/plain:
          schema:
            type: string
          example: '{"Message":"Forbidden: insufficient permissions"}'
    NotFound:
      description: Job not found, expired, owned by another plugin, or for another operation.
      content:
        text/plain:
          schema:
            type: string
          example: '{"Message":"Not Found"}'
    MethodNotAllowed:
      description: HTTP method is not supported for this path.
      content:
        text/plain:
          schema:
            type: string
          example: '{"Message":"Method Not Allowed"}'
    Conflict:
      description: Idempotency key reused for another selection or invalid control transition.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            Message: Conflict
    TooManyRequests:
      description: Rate limit exceeded. Retry after the indicated delay.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
        X-Rate-Limit-Reset:
          description: Unix timestamp when the limit resets.
          schema:
            type: integer
            format: int64
      content:
        text/plain:
          schema:
            type: string
          example: Too Many Requests
    ServiceUnavailable:
      description: The service is temporarily unavailable. Try again later.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            Message: Service Unavailable
    InternalServerError:
      description: Unexpected server error; include the X-Trace-Id in support requests.
      content:
        text/plain:
          schema:
            type: string
          example: '{"Message":"Internal server error, lookup traceId in headers for more information"}'

Retrieving Plugin Modules ​

This API call allows you to retrieve a list of email template modules (also known as custom blocks) created within your Stripo Plugin environment.

You can use this endpoint to fetch all modules associated with your plugin, including their metadata, icons, HTML/CSS content, categories, and synchronization status.

For faster response, modules are returned without HTML/CSS content by default. If you need to include it, set the withContent parameter to true

OpenAPI Specification ​

Reference
yaml
openapi: 3.0.3
info:
  title: Retrieving Plugin Modules API
  description: |
    This API specification describes the endpoint for retrieving plugin modules
    from the Stripo Email Editor plugin backend service.

    The endpoint allows authenticated plugins to list and filter their custom email
    template modules (blocks) with advanced filtering, pagination, and sorting capabilities.

    **Authentication**: Plugin-based authentication using the `ES-PLUGIN-AUTH` header.
    The authentication token must have the role set to "API" to access this endpoint.

    **Authorization**: Only modules belonging to the authenticated plugin are returned.
    Cross-plugin access is not permitted.

    **Performance Optimization**: Use the `withContent` parameter to include HTML and CSS
    content in responses. By default, content is excluded for optimal performance.

    **Filtering Capabilities**: Support for filtering by key, category, tags, synchronization
    status, and full-text search on module names.

    **Pagination**: Flexible pagination using either offset-based or page-based approaches
    with configurable page sizes.
  version: 1.0.0
  contact:
    name: Stripo Support
    url: https://stripo.email

servers:
  - url: https://plugins.stripo.email
    description: Plugin Backend Service

security:
  - pluginAuth: []

paths:
  /api/v1/customblocks/v4/modules/list:
    get:
      summary: List plugin modules
      tags:
        - Methods
      operationId: getModulesList
      description: |
        Retrieve a paginated and filterable list of all plugin modules belonging to
        the authenticated plugin.

        **Authorization**: Only modules associated with the plugin identified by the
        provided authentication token are returned. The token must have "API" role.

        **Performance**: By default, HTML and CSS content are excluded for optimal performance.
        Set `withContent=true` to include HTML and CSS content in the response.

        **Filtering**: Combine multiple filters (key, query, categories, tags, id,
        synchronizable) to narrow down results. All filters are applied with AND logic.

        **Sorting**: Results can be sorted by `id` or `name` in ascending or descending order.

        **Pagination**: Use either `offset` for cursor-based pagination or `page` for
        page-based pagination. The `limit` parameter controls the page size (default: 20).
      security:
        - pluginAuth: []
      parameters:
        - in: header
          name: ES-PLUGIN-AUTH
          description: |
            Plugin authentication token with "API" role. Must be in Bearer token format.
          required: true
          schema:
            type: string
          example: Bearer YOUR_AUTH_TOKEN
        - in: query
          name: key
          description: |
            Filter by module key (folder name). Returns modules matching the specified key.
          required: false
          schema:
            type: string
          example: "header-templates"
        - in: query
          name: query
          description: |
            Full-text search query for module name.
          required: false
          schema:
            type: string
          example: "newsletter"
        - in: query
          name: categories
          description: |
            Filter by one or more category IDs. Returns modules belonging to any of the
            specified categories.
          required: false
          schema:
            type: array
            items:
              type: integer
              format: int64
          example: [1, 2, 5]
        - in: query
          name: tags
          description: |
            Filter by one or more tag values. Returns modules that have any of the
            specified tags.
          required: false
          schema:
            type: array
            items:
              type: string
          example: ["promotional", "seasonal"]
        - in: query
          name: id
          description: |
            Filter by specific module ID. When provided, returns only the module with
            this exact ID (if it belongs to the authenticated plugin).
          required: false
          schema:
            type: integer
            format: int64
          example: 12345
        - in: query
          name: synchronizable
          description: |
            Filter by synchronizable status. Set to `true` for synchronizable modules only,
            `false` for non-synchronizable modules only, or omit for all modules.
          required: false
          schema:
            type: boolean
          example: true
        - in: query
          name: withContent
          description: |
            Performance optimization flag. When set to `true`, the `html` and `css` fields
            will be included in the response. By default (`false`), content is excluded
            to reduce response size when only module metadata is needed.
          required: false
          schema:
            type: boolean
            default: false
          example: false
        - in: query
          name: sortingColumn
          description: |
            Column to sort results by. Options are `id` (module ID) or `name` (module name).
          required: false
          schema:
            type: string
            enum: [id, name]
            default: id
          example: "name"
        - in: query
          name: sortingAsc
          description: |
            Sort direction. Set to `true` for ascending order, `false` for descending order.
          required: false
          schema:
            type: boolean
            default: false
          example: true
        - in: query
          name: offset
          description: |
            Zero-based pagination offset. Specifies the starting position in the result set.
            Takes precedence over the `page` parameter when both are provided.
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
          example: 0
        - in: query
          name: page
          description: |
            One-based page number for pagination. Used only if `offset` is not provided.
            Calculated as: offset = (page - 1) * limit
          required: false
          schema:
            type: integer
            minimum: 1
          example: 1
        - in: query
          name: limit
          description: |
            Maximum number of modules to return per page. Controls the page size for pagination.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
          example: 20
      responses:
        '200':
          description: |
            Modules list retrieved successfully. Returns a paginated list of modules
            with metadata and optionally HTML/CSS content.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModulesListResponseDto'
              examples:
                basicList:
                  summary: Basic module list with content (withContent=true)
                  value:
                    modules:
                      - id: 12345
                        key: "header-templates"
                        name: "Modern Header"
                        html: "<table>...</table>"
                        css: ".header { padding: 20px; }"
                        blockType: "BASIC"
                        scope: "HEADER"
                        icon: "https://example.com/icon.png"
                        croppedIcon: "https://example.com/icon-cropped.png"
                        description: "A modern header template"
                        synchronizable: true
                        tags: ["modern", "responsive"]
                        tagObjects:
                          - id: 1
                            value: "modern"
                          - id: 2
                            value: "responsive"
                        category:
                          key: 1
                          name: "Headers"
                        createdOn: "2024-01-15T10:30:00Z"
                        updatedOn: "2024-01-20T14:45:00Z"
                    total: 1
                    offset: 0
                    limit: 20
                metadataOnly:
                  summary: Module list without content (default, withContent=false)
                  value:
                    modules:
                      - id: 12345
                        key: "header-templates"
                        name: "Modern Header"
                        html: null
                        css: null
                        blockType: "BASIC"
                        scope: "HEADER"
                        icon: "https://example.com/icon.png"
                        croppedIcon: "https://example.com/icon-cropped.png"
                        description: "A modern header template"
                        synchronizable: true
                        tags: ["modern", "responsive"]
                        category:
                          key: 1
                          name: "Headers"
                        createdOn: "2024-01-15T10:30:00Z"
                        updatedOn: "2024-01-20T14:45:00Z"
                    total: 1
                    offset: 0
                    limit: 20
                emptyList:
                  summary: Empty result set
                  value:
                    modules: []
                    total: 0
                    offset: 0
                    limit: 20
        '401':
          description: |
            Unauthorized - Authentication failed. This can occur when:
            - The authentication token is missing or invalid
            - The token has expired
            - The token does not have "API" role
          content:
            application/json:
              schema:
                type: object
        '403':
          description: |
            Forbidden - The authenticated plugin does not have permissions to access modules.
            This typically indicates an authorization configuration issue.
          content:
            application/json:
              schema:
                type: object

components:
  securitySchemes:
    pluginAuth:
      type: apiKey
      in: header
      name: ES-PLUGIN-AUTH
      description: |
        Plugin authentication using Bearer token in the ES-PLUGIN-AUTH header.
        The token must have "API" role to access this endpoint.

  schemas:
    ModulesListResponseDto:
      type: object
      description: Response containing a paginated list of plugin modules with metadata
      properties:
        modules:
          type: array
          items:
            $ref: '#/components/schemas/ModuleListItemDto'
          description: |
            Array of module objects. Each module contains metadata and optionally
            HTML/CSS content (depending on the `withContent` parameter).
        total:
          type: integer
          format: int64
          description: |
            Total count of modules matching the filter criteria (across all pages).
            Used for calculating pagination metadata.
          minimum: 0
          example: 42
        offset:
          type: integer
          description: |
            Current pagination offset (starting position in the result set).
            Corresponds to the `offset` parameter from the request.
          minimum: 0
          example: 0
        limit:
          type: integer
          description: |
            Maximum number of modules returned in this page.
            Corresponds to the `limit` parameter from the request.
          minimum: 1
          example: 20

    ModuleListItemDto:
      type: object
      description: Represents a single plugin module with all its metadata and optional content
      properties:
        id:
          type: integer
          format: int64
          description: |
            Unique identifier of the module within the plugin.
          example: 12345
        key:
          type: string
          description: |
            Module key (folder name). Used for organizing modules into logical groups.
          example: "header-templates"
        name:
          type: string
          description: |
            Human-readable name of the module. Displayed in the editor's module library.
          example: "Modern Header"
        html:
          type: string
          nullable: true
          description: |
            HTML content of the module. Contains the email template markup.
            This field will be `null` when `withContent=false` (default) or not specified.
          example: "<table>...</table>"
        css:
          type: string
          nullable: true
          description: |
            CSS styles for the module. Applied to the HTML content when rendered.
            This field will be `null` when `withContent=false` (default) or not specified.
          example: ".header { padding: 20px; }"
        blockType:
          type: string
          description: |
            Type of block. Determines how the module behaves in the editor.
          example: "STRUCTURE"
        scope:
          type: string
          description: |
            Defines the section of the email where this module can be used.
            Modules are organized by scope in the editor's module library.
          enum: [INFO_AREA, HEADER, MENU, CONTENT, FOOTER]
          example: "HEADER"
        icon:
          type: string
          description: |
            URL to the module's icon image. Displayed as thumbnail in the module library.
          example: "https://example.com/icons/header-modern.png"
        croppedIcon:
          type: string
          description: |
            URL to the cropped version of the module's icon. Used for optimized display.
          example: "https://example.com/icons/header-modern-cropped.png"
        description:
          type: string
          description: |
            Textual description of the module. Provides additional context about the
            module's purpose and design.
          example: "A modern, responsive header template with logo and navigation"
        synchronizable:
          type: boolean
          description: |
            Indicates whether this module supports synchronization. Synchronized modules
            can be updated across multiple email templates automatically.
          example: true
        tags:
          type: array
          items:
            type: string
          description: |
            List of tag values associated with the module. Tags provide additional
            categorization and filtering capabilities. This is a simplified array
            of string values.
          example: ["modern", "responsive", "promotional"]
        tagObjects:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                format: int64
                description: Unique identifier of the tag
                example: 1
              value:
                type: string
                description: Tag value (name)
                example: "modern"
          description: |
            List of tag objects with full details including tag IDs. Provides more
            complete information than the `tags` array.
        category:
          type: object
          properties:
            key:
              type: integer
              format: int64
              description: |
                Unique identifier of the category.
              example: 1
            name:
              type: string
              description: |
                Human-readable name of the category.
              example: "Headers"
          description: |
            Category information for the module. Categories provide high-level
            organization of modules in the editor's library.
        createdOn:
          type: string
          format: date-time
          description: |
            ISO 8601 timestamp indicating when the module was created.
          example: "2024-01-15T10:30:00Z"
        updatedOn:
          type: string
          format: date-time
          description: |
            ISO 8601 timestamp indicating when the module was last updated.
          example: "2024-01-20T14:45:00Z"

tags:
  - name: Methods
    description: Plugin module management operations

Deleting Plugin Modules ​

Soft-delete one or multiple plugin modules programmatically. This API method allows you to mark multiple plugin modules as deleted by their unique identifiers in a single request. Deleted modules are not physically removed from the database — they are marked as deleted and will no longer appear in the module library or API responses.

Each module ID in the request is validated against the authenticated plugin — if any module does not belong to the plugin or does not exist, the entire request is rejected with a 403 Forbidden response and no modules are deleted.

Use this endpoint to manage the module lifecycle in automation pipelines, integrations, or bulk cleanup workflows.

OpenAPI Specification ​

Reference
yaml
openapi: 3.0.3
info:
  title: Delete Plugin Modules API
  description: |
    This API call bulk soft-deletes plugin modules from the module library.
    Modules are marked as deleted and are not physically removed from the database.

    **Authentication**: Plugin-based authentication using custom headers.
    Requires a valid plugin authentication token.

    **Authorization**: Only users with "API" role are permitted to use this endpoint.
    Other roles will receive a 403 Forbidden response.

    **Ownership Validation**: Each module ID in the request is validated to ensure it
    belongs to the authenticated plugin. If any module belongs to a different plugin,
    the entire request is rejected with 403 and no modules are deleted.

    **Behaviour**:
    - Modules that belong to the plugin are soft-deleted (marked as `deleted = true`).
    - If any `moduleId` belongs to another plugin, the request is rejected with 403
      and no module is deleted.
    - Non-existent `moduleIds` are silently skipped.
  version: 1.0.0
  contact:
    name: Stripo Support
    url: https://stripo.email

servers:
  - url: https://plugins.stripo.email
    description: Stripo Plugin API server

security:
  - pluginAuth: []

paths:
  /api/v1/customblocks/v4/modules/bulk-delete:
    post:
      summary: Bulk soft-delete modules
      description: |
        Soft-deletes a list of plugin modules by their IDs. Requires a token with the "API" role.
        Each module ID is verified to belong to the plugin identified by the authentication token.
      operationId: bulkDeleteModules
      tags:
        - Methods
      security:
        - pluginAuth: []
      parameters:
        - name: ES-PLUGIN-AUTH
          in: header
          required: true
          description: "Stripo plugin auth token in the format — Bearer ${AUTH_TOKEN}. Must have the 'API' role."
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkDeleteModulesRequest'
            examples:
              singleModule:
                summary: Delete a single module
                value:
                  moduleIds: [101]
              multipleModules:
                summary: Delete multiple modules
                value:
                  moduleIds: [101, 102, 103]
              bulkDeletion:
                summary: Bulk deletion of modules
                value:
                  moduleIds:
                    - 101
                    - 102
                    - 103
                    - 104
                    - 105
      responses:
        '204':
          description: |
            All modules soft-deleted successfully. No response body is returned.
        '400':
          description: |
            Bad request — moduleIds must not be empty or array too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                noModuleIds:
                  summary: No module IDs provided
                  value:
                    message: "moduleIds must not be empty"
                tooManyIds:
                  summary: Too many module IDs in request
                  value:
                    message: "Too many module IDs (max 1000)"
        '401':
          description: |
            Unauthorized — ES-PLUGIN-AUTH header is missing or the token is invalid or expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                authFailed:
                  summary: Authentication failed
                  value:
                    message: "Unauthorized"
        '403':
          description: |
            Forbidden — either the token does not have the "API" role, or at least one
            of the provided moduleIds belongs to another plugin. In the latter case no
            module is deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                insufficientPermissions:
                  summary: User lacks required role
                  value:
                    message: "Forbidden: insufficient permissions"
                foreignModule:
                  summary: Module belongs to another plugin
                  value:
                    message: "Forbidden: one or more modules do not belong to the authenticated plugin"
        '500':
          description: |
            Internal server error — Failed to delete modules.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                deleteFailed:
                  summary: Deletion operation failed
                  value:
                    message: "Internal server error, lookup traceId in headers for more information"

components:
  securitySchemes:
    pluginAuth:
      type: apiKey
      in: header
      name: ES-PLUGIN-AUTH
      description: |
        Plugin authentication using Bearer token in the ES-PLUGIN-AUTH header.
        The token must have "API" role to access this endpoint.

  schemas:
    BulkDeleteModulesRequest:
      type: object
      description: Request body containing module IDs to soft-delete.
      required:
        - moduleIds
      properties:
        moduleIds:
          type: array
          description: |
            List of module IDs to soft-delete. Min: 1, max: 1000.
            All IDs must belong to the plugin identified by the authentication token.
            Non-existent IDs are silently skipped.
          items:
            type: integer
            format: int64
          minItems: 1
          maxItems: 1000
          example: [101, 102, 103]

    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Human-readable error description
          example: "moduleIds must not be empty"

tags:
  - name: Methods
    description: Plugin module management operations

This API call allows you to update timer links in the HTML code when copying an email template outside the Stripo editor. It ensures that the timers are correctly cloned and updated in the new template.

OpenAPI Specification ​

Reference
yaml
openapi: 3.0.1
info:
  title: Timer Clone API
  description: This API call allows you to update timer links in the HTML code when copying an email template outside the Stripo editor. It ensures that the timers are correctly cloned and updated in the new template.
  version: 1.0.0
servers:
  - url: https://plugins.stripo.email
paths:
  /api/v1/timers/clone:
    post:
      tags:
        - Methods
      summary: Updating Timer Block Links
      description: Clone timers and update timer links in HTML
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                html:
                  type: string
                  description: HTML code containing timer links
                  example: 'Timer link: ...'
              required:
                - html
      parameters:
        - in: header
          name: ES-PLUGIN-AUTH
          required: true
          schema:
            type: string
          description: Authorization token
          example: Bearer YOUR_AUTH_TOKEN
      responses:
        '200':
          description: Successful response with updated HTML and timer mapping
          content:
            application/json:
              schema:
                type: object
                properties:
                  html:
                    type: string
                    description: HTML code with updated timer links
                    example: 'Timer link: ...'
                  timersMap:
                    type: object
                    description: Mapping of old timer IDs to new timer IDs and URLs. Keys are old timer IDs, values are objects containing new timer information.
                    additionalProperties:
                      type: object
                      properties:
                        id:
                          type: integer
                          description: New timer ID in the cloned template
                          example: 152752
                        url:
                          type: string
                          format: uri
                          description: URL of the new timer image
                          example: 'https://cdt-timer-plugins.stripocdn.email/api/v1/images/s5exXSdnyicX1pCXcz83Faw-C7kFWaTlkeHuxpPS8rs'
                      required:
                        - id
                        - url
                    example:
                      '152702':
                        id: 152752
                        url: 'https://cdt-timer-plugins.stripocdn.email/api/v1/images/s5exXSdnyicX1pCXcz83Faw-C7kFWaTlkeHuxpPS8rs'
                      '152701':
                        id: 152751
                        url: 'https://cdt-timer-plugins.stripocdn.email/api/v1/images/VxPC8zhLbJuBOfRINW0LODFkYw7WWRpi5WgOOq4AGsI'

Access to Stripo Templates ​

Stripo provides access to a variety of email templates that you can use based on your subscription plan. If you have registered your account and integrated your plugin application, you can access these templates.

Template Access Based on Plan:

  • FREE Plan: Access to basic templates only.
  • STARTUP Plan: Access to basic templates and those marked as FREE.
  • BUSINESS and ENTERPRISE Plans: Access to basic, free, and PREMIUM templates.

How to Access Templates ​

After making the initial request to get an array of the available templates, you will need to make individual calls for each template to retrieve its HTML and CSS.

Step-by-Step Process ​

  1. Get List of Templates: Make a request to retrieve an array of available templates based on your plan.
    Endpoint:
    GET /bapi/plugin-templates/v1/templates
  2. Get HTML and CSS for Each Template: For each template in the array, make separate requests to retrieve its HTML and CSS.
    Endpoint:
    GET /bapi/plugin-templates/v1/templates/{templateId}

OpenAPI Specification ​

Reference
yaml
openapi: 3.0.0
info:
  title: Stripo Email Template API
  description: |
    Stripo provides access to a variety of email templates that you can use based on your subscription plan. If you have registered your account and integrated your plugin application, you can access these templates.

    After making the initial request to get an array of the available templates, you will need to make individual calls for each template to retrieve its HTML and CSS.
  version: 1.0.0
servers:
  - url: https://my.stripo.email/bapi/plugin-templates
paths:
  /v1/templates:
    get:
      tags:
        - Methods
      summary: Get Templates
      description: Get templates matching the specified search criteria.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum: [BASIC, FREE, PREMIUM]
          description: Specifies the variety of templates to be returned.
        - name: sort
          in: query
          schema:
            type: string
            enum: [NEW, ACTUAL]
            default: ACTUAL
          description: Defines how the templates are sorted in response.
        - name: limit
          in: query
          schema:
            type: integer
          description: Regulates how many items should be returned per page (suggested limit of no more than 50).
        - name: page
          in: query
          schema:
            type: integer
          description: Defines the number of the page.
        - name: templateTypes
          in: query
          schema:
            type: array
            items:
              type: integer
          description: Filters templates that specifically pertain to relevant categories.
        - name: templateSeasons
          in: query
          schema:
            type: array
            items:
              type: integer
          description: Restricts the selection of templates to those associated with seasonal events categories.
        - name: templateFeatures
          in: query
          schema:
            type: array
            items:
              type: integer
          description: Ensures that only templates related to specific feature categories are retrieved.
        - name: templateIndustries
          in: query
          schema:
            type: array
            items:
              type: integer
          description: Narrows down template selection to include only those featuring industry-specific categories.
      responses:
        '200':
          description: A list of templates matching the search criteria.
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        templateId:
                          type: integer
                        name:
                          type: string
                        logo:
                          type: string
                        premium:
                          type: boolean
                        hasAmp:
                          type: boolean
                        updatedAt:
                          type: integer
                        createdTime:
                          type: integer
                        templateTypes:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: integer
                              name:
                                type: string
                        templateSeasons:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: integer
                              name:
                                type: string
                        templateFeatures:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: integer
                              name:
                                type: string
                        templateIndustries:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: integer
                              name:
                                type: string
      security:
        - ES-PLUGIN-AUTH: []

  /v1/templates/{templateId}:
    get:
      tags:
        - Methods
      summary: Get Template Details
      description: Get the metadata, HTML, and CSS code for a specific template by ID.
      parameters:
        - name: templateId
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Metadata, HTML, and CSS code for the specified template.
          content:
            application/json:
              schema:
                type: object
                properties:
                  templateId:
                    type: integer
                  name:
                    type: string
                  logo:
                    type: string
                  premium:
                    type: boolean
                  hasAmp:
                    type: boolean
                  updatedAt:
                    type: integer
                  createdTime:
                    type: integer
                  templateTypes:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        name:
                          type: string
                  templateSeasons:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        name:
                          type: string
                  templateFeatures:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        name:
                          type: string
                  templateIndustries:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        name:
                          type: string
                  html:
                    type: string
                  css:
                    type: string
      security:
        - ES-PLUGIN-AUTH: []

  /v1/templates/types:
    get:
      tags:
        - Methods
      summary: Get Template Types
      description: Get available values for the templateTypes parameter.
      responses:
        '200':
          description: Array of available values for the templateTypes parameter.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                    name:
                      type: string
      security:
        - ES-PLUGIN-AUTH: []

  /v1/templates/seasons:
    get:
      tags:
        - Methods
      summary: Get Template Seasons
      description: Get available values for the templateSeasons parameter.
      responses:
        '200':
          description: Array of available values for the templateSeasons parameter.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                    name:
                      type: string
      security:
        - ES-PLUGIN-AUTH: []

  /v1/templates/features:
    get:
      tags:
        - Methods
      summary: Get Template Features
      description: Get available values for the templateFeatures parameter.
      responses:
        '200':
          description: Array of available values for the templateFeatures parameter.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                    name:
                      type: string
      security:
        - ES-PLUGIN-AUTH: []

  /v1/templates/industries:
    get:
      tags:
        - Methods
      summary: Get Template Industries
      description: Get available values for the templateIndustries parameter.
      responses:
        '200':
          description: Array of available values for the templateIndustries parameter.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                    name:
                      type: string
      security:
        - ES-PLUGIN-AUTH: []

components:
  securitySchemes:
    ES-PLUGIN-AUTH:
      type: apiKey
      in: header
      name: ES-PLUGIN-AUTH
      description: Bearer YOUR_AUTH_TOKEN

Detailed Explanation ​

Get Templates ​

/v1/templates?type=BASIC

  • Summary: Get templates matching the specified search criteria.

  • Parameters:

    • type (required, query): Specifies the variety of templates to be returned (BASIC, FREE, PREMIUM).
    • sort (query): Defines how the templates are sorted in response (NEW, ACTUAL).
    • limit (query): Regulates how many items should be returned per page (suggested limit of no more than 50).
    • page (query): Defines the number of the page.
    • templateTypes (query): Filters templates that specifically pertain to relevant categories.
    • templateSeasons (query): Restricts the selection of templates to those associated with seasonal events categories.
    • templateFeatures (query): Ensures that only templates related to specific feature categories are retrieved.
    • templateIndustries (query): Narrows down template selection to include only those featuring industry-specific categories.

Get Template Details ​

/v1/templates/{templateId}

  • Summary: Get the metadata, HTML, and CSS code for a specific template by ID.

  • Parameters:

    • templateId (required, path): The ID of the template.

Get Template Types ​

/v1/templates/types

  • Summary: Get available values for the templateTypes parameter.

Get Template Seasons ​

/v1/templates/seasons

  • Summary: Get available values for the templateSeasons parameter.

Get Template Features ​

/v1/templates/features

  • Summary: Get available values for the templateFeatures parameter.

Get Template Industries ​

/v1/templates/industries

  • Summary: Get available values for the templateIndustries parameter.