{
 "openapi": "3.0.1",
 "info": {
  "title": "Silnik szablonów API",
  "version": "2026-10-08",
  "description": "Renderowanie szablonów tekstowych z danymi.\n\nAdres bazowy: `https://{instancja}-template-engine-api.enterprise.sellrocket.pl` — `{instancja}` to nazwa Twojej instancji Sellrocket, którą otrzymasz przy jej uruchomieniu.\n\nWszystkie żądania wymagają nagłówka `Authorization: Bearer <token>` — zobacz [Uwierzytelnianie](../../start/uwierzytelnianie/).\n\n**Specyfikacja OpenAPI:** [szablony.json](../../specs/szablony.json) — do importu w Postmanie/Insomnii lub generowania klienta."
 },
 "servers": [
  {
   "url": "https://{instancja}-template-engine-api.enterprise.sellrocket.pl",
   "variables": {
    "instancja": {
     "default": "twoja-instancja",
     "description": "Nazwa Twojej instancji Sellrocket"
    }
   }
  }
 ],
 "tags": [
  {
   "name": "Szablony"
  }
 ],
 "paths": {
  "/api/v1/Templates": {
   "post": {
    "tags": [
     "Szablony"
    ],
    "summary": "Wypełnij szablon danymi",
    "description": "Renderuje szablon tekstowy (składnia {{pole}}) na podstawie przekazanych danych i zwraca wynik; brakujące klucze dają puste miejsca. Przydatne do generowania treści wiadomości lub dokumentów.\n\nIf the data passed to the endpoint will not contain keys from template, segments where values should be located will be empty.\n            \n<br /><b>Example</b> \n\nSending request like\n```\n{\n    \"template\": \"zamowienie nr {{id}}, status: {{status.id}}, komentarz: {{NOT_EXISTING.comment}}\",\n    \"data\": {\n        \"id\": 877,\n        \"source\": {\n            \"connectionId\": 12,\n            \"connectionType\": \"MAG2\",\n            \"platformAccountId\": \"\",\n            \"platformOrderId\": \"1\"\n        },\n        \"status\": {\n            \"id\": 1212121,\n            \"from\": \"2023-12-14T11:56:18.511114Z\"\n        }\n    }\n}\n```\n            \nWhere there is no object `NOT_EXISTING` will return template `zamowienie nr 877, status: 1212121, komentarz: `",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/FillTemplateRequest"
         }
        ]
       }
      },
      "text/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/FillTemplateRequest"
         }
        ]
       }
      },
      "application/*+json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/FillTemplateRequest"
         }
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BadRequest"
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "operationId": "post-templates"
   }
  }
 },
 "components": {
  "schemas": {
   "BadRequest": {
    "type": "object",
    "properties": {
     "statusCode": {
      "type": "integer",
      "format": "int32",
      "readOnly": true
     }
    },
    "additionalProperties": false
   },
   "FillTemplateRequest": {
    "type": "object",
    "properties": {
     "template": {
      "type": "string",
      "nullable": true
     },
     "data": {
      "type": "object",
      "additionalProperties": {},
      "nullable": true
     }
    },
    "additionalProperties": false
   }
  },
  "securitySchemes": {
   "Bearer": {
    "type": "http",
    "scheme": "bearer",
    "bearerFormat": "JWT",
    "description": "Token API wygenerowany w panelu Sellrocket."
   }
  }
 },
 "security": [
  {
   "Bearer": []
  }
 ]
}