openapi: 3.0.0
info:
  title: Brickworks - Synerise Public API
  version: 1.3.0
servers:
  - description: Microsoft Azure EU
    url: https://api.synerise.com
  - description: Microsoft Azure USA
    url: https://api.azu.synerise.com
  - description: Google Cloud Platform
    url: https://api.geb.synerise.com
tags:
  - name: "Brickworks: Schemas"
  - name: "Brickworks: Records"
  - name: "Brickworks: Content generation"
  - name: "Brickworks: External sources"
  - name: "Brickworks: Record versions"
x-tagGroups:
  - name: Brickworks
    tags:
      - "Brickworks: Schemas"
      - "Brickworks: Records"
      - "Brickworks: Content generation"
      - "Brickworks: External sources"
      - "Brickworks: Record versions"
paths:
  /brickworks/v1/schemas:
    get:
      tags:
        - "Brickworks: Schemas"
      summary: Get schemas
      description: |
        Retrieve a list of schemas. You can paginate the results, filter by schema type, and search for a phrase in schema names.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_SCHEMAS_READ`

        **User role permission required:** `assets_brickworks: read`
      operationId: getSchemas
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-queryLimit"
        - $ref: "#/components/parameters/brickworks-service-queryPage"
        - $ref: "#/components/parameters/brickworks-service-querySearch"
        - $ref: "#/components/parameters/brickworks-service-querySortBy"
        - $ref: "#/components/parameters/brickworks-service-querySchemaTypes"
      responses:
        "200":
          description: Schema objects
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/brickworks-service-SchemaPagingResult"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Schemas/operation/getSchemas
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/brickworks/v1/schemas?limit=SOME_INTEGER_VALUE&page=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=updatedAt%3Aasc&schemaTypes=SOME_STRING_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/brickworks/v1/schemas?limit=SOME_INTEGER_VALUE&page=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=updatedAt%3Aasc&schemaTypes=SOME_STRING_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/brickworks/v1/schemas?limit=SOME_INTEGER_VALUE&page=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=updatedAt%3Aasc&schemaTypes=SOME_STRING_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/brickworks/v1/schemas?limit=SOME_INTEGER_VALUE&page=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=updatedAt%3Aasc&schemaTypes=SOME_STRING_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/brickworks/v1/schemas');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'limit' => 'SOME_INTEGER_VALUE',
              'page' => 'SOME_INTEGER_VALUE',
              'search' => 'SOME_STRING_VALUE',
              'sortBy' => 'updatedAt:asc',
              'schemaTypes' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/brickworks/v1/schemas?limit=SOME_INTEGER_VALUE&page=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=updatedAt%3Aasc&schemaTypes=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      tags:
        - "Brickworks: Schemas"
      summary: Create schema
      description: |
        Create a new schema

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_SCHEMAS_CREATE`

        **User role permission required:** `assets_brickworks: create`
      operationId: createSchema
      security:
        - JWT: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/brickworks-service-CreateSchemaRequest"
      responses:
        "200":
          description: Details of the created schema
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/brickworks-service-Schema"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Schemas/operation/createSchema
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/brickworks/v1/schemas \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"appId":"string","displayName":"string","description":"string","fields":{"type":"object","properties":{"property1":{"type":"number","subtype":"number","minimum":0.1,"maximum":0.1,"unique":true,"searchable":true,"default":0,"isConstantField":false},"property2":{"type":"number","subtype":"number","minimum":0.1,"maximum":0.1,"unique":true,"searchable":true,"default":0,"isConstantField":false}},"required":["string"],"allOf":[{"if":{"required":["string"],"properties":{"property1":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}},"property2":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}}}},"then":{"required":["string"],"properties":{"property1":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}},"property2":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}}}},"else":{"required":["string"],"properties":{"property1":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}},"property2":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}}}}}],"additionalProperties":true},"displayConfiguration":{"ordering":{"property1":0,"property2":0},"metadata":{"property1":{"title":"empty title","description":"string","useAsRecordName":false},"property2":{"title":"empty title","description":"string","useAsRecordName":false}}},"audience":{"targetType":"SEGMENT","segments":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"query":"{\\\"analysis\\\":{\\\"title\\\":\\\"notempty\\\",\\\"segments\\\":[{\\\"title\\\":\\\"notempty\\\",\\\"filter\\\":{\\\"matching\\\":true,\\\"expressions\\\":[{\\\"type\\\":\\\"ATTRIBUTE\\\",\\\"attribute\\\":{\\\"expressions\\\":[{\\\"constraint\\\":{\\\"type\\\":\\\"BOOL\\\",\\\"logic\\\":\\\"IS_TRUE\\\"},\\\"attribute\\\":{\\\"type\\\":\\\"PARAM\\\",\\\"param\\\":\\\"exampleBool\\\"}}]}}]}}]}}"},"schemaType":"SIMPLE"}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"appId\":\"string\",\"displayName\":\"string\",\"description\":\"string\",\"fields\":{\"type\":\"object\",\"properties\":{\"property1\":{\"type\":\"number\",\"subtype\":\"number\",\"minimum\":0.1,\"maximum\":0.1,\"unique\":true,\"searchable\":true,\"default\":0,\"isConstantField\":false},\"property2\":{\"type\":\"number\",\"subtype\":\"number\",\"minimum\":0.1,\"maximum\":0.1,\"unique\":true,\"searchable\":true,\"default\":0,\"isConstantField\":false}},\"required\":[\"string\"],\"allOf\":[{\"if\":{\"required\":[\"string\"],\"properties\":{\"property1\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}},\"property2\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}}}},\"then\":{\"required\":[\"string\"],\"properties\":{\"property1\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}},\"property2\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}}}},\"else\":{\"required\":[\"string\"],\"properties\":{\"property1\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}},\"property2\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}}}}}],\"additionalProperties\":true},\"displayConfiguration\":{\"ordering\":{\"property1\":0,\"property2\":0},\"metadata\":{\"property1\":{\"title\":\"empty title\",\"description\":\"string\",\"useAsRecordName\":false},\"property2\":{\"title\":\"empty title\",\"description\":\"string\",\"useAsRecordName\":false}}},\"audience\":{\"targetType\":\"SEGMENT\",\"segments\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"query\":\"{\\\\\\\"analysis\\\\\\\":{\\\\\\\"title\\\\\\\":\\\\\\\"notempty\\\\\\\",\\\\\\\"segments\\\\\\\":[{\\\\\\\"title\\\\\\\":\\\\\\\"notempty\\\\\\\",\\\\\\\"filter\\\\\\\":{\\\\\\\"matching\\\\\\\":true,\\\\\\\"expressions\\\\\\\":[{\\\\\\\"type\\\\\\\":\\\\\\\"ATTRIBUTE\\\\\\\",\\\\\\\"attribute\\\\\\\":{\\\\\\\"expressions\\\\\\\":[{\\\\\\\"constraint\\\\\\\":{\\\\\\\"type\\\\\\\":\\\\\\\"BOOL\\\\\\\",\\\\\\\"logic\\\\\\\":\\\\\\\"IS_TRUE\\\\\\\"},\\\\\\\"attribute\\\\\\\":{\\\\\\\"type\\\\\\\":\\\\\\\"PARAM\\\\\\\",\\\\\\\"param\\\\\\\":\\\\\\\"exampleBool\\\\\\\"}}]}}]}}]}}\"},\"schemaType\":\"SIMPLE\"}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/brickworks/v1/schemas", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "appId": "string",
              "displayName": "string",
              "description": "string",
              "fields": {
                "type": "object",
                "properties": {
                  "property1": {
                    "type": "number",
                    "subtype": "number",
                    "minimum": 0.1,
                    "maximum": 0.1,
                    "unique": true,
                    "searchable": true,
                    "default": 0,
                    "isConstantField": false
                  },
                  "property2": {
                    "type": "number",
                    "subtype": "number",
                    "minimum": 0.1,
                    "maximum": 0.1,
                    "unique": true,
                    "searchable": true,
                    "default": 0,
                    "isConstantField": false
                  }
                },
                "required": [
                  "string"
                ],
                "allOf": [
                  {
                    "if": {
                      "required": [
                        "string"
                      ],
                      "properties": {
                        "property1": {
                          "minItems": 0,
                          "maxItems": 0,
                          "uniqueItems": true,
                          "minimum": 0,
                          "maximum": 0,
                          "pattern": "string",
                          "const": null,
                          "enum": [
                            "string"
                          ],
                          "not": {}
                        },
                        "property2": {
                          "minItems": 0,
                          "maxItems": 0,
                          "uniqueItems": true,
                          "minimum": 0,
                          "maximum": 0,
                          "pattern": "string",
                          "const": null,
                          "enum": [
                            "string"
                          ],
                          "not": {}
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "string"
                      ],
                      "properties": {
                        "property1": {
                          "minItems": 0,
                          "maxItems": 0,
                          "uniqueItems": true,
                          "minimum": 0,
                          "maximum": 0,
                          "pattern": "string",
                          "const": null,
                          "enum": [
                            "string"
                          ],
                          "not": {}
                        },
                        "property2": {
                          "minItems": 0,
                          "maxItems": 0,
                          "uniqueItems": true,
                          "minimum": 0,
                          "maximum": 0,
                          "pattern": "string",
                          "const": null,
                          "enum": [
                            "string"
                          ],
                          "not": {}
                        }
                      }
                    },
                    "else": {
                      "required": [
                        "string"
                      ],
                      "properties": {
                        "property1": {
                          "minItems": 0,
                          "maxItems": 0,
                          "uniqueItems": true,
                          "minimum": 0,
                          "maximum": 0,
                          "pattern": "string",
                          "const": null,
                          "enum": [
                            "string"
                          ],
                          "not": {}
                        },
                        "property2": {
                          "minItems": 0,
                          "maxItems": 0,
                          "uniqueItems": true,
                          "minimum": 0,
                          "maximum": 0,
                          "pattern": "string",
                          "const": null,
                          "enum": [
                            "string"
                          ],
                          "not": {}
                        }
                      }
                    }
                  }
                ],
                "additionalProperties": true
              },
              "displayConfiguration": {
                "ordering": {
                  "property1": 0,
                  "property2": 0
                },
                "metadata": {
                  "property1": {
                    "title": "empty title",
                    "description": "string",
                    "useAsRecordName": false
                  },
                  "property2": {
                    "title": "empty title",
                    "description": "string",
                    "useAsRecordName": false
                  }
                }
              },
              "audience": {
                "targetType": "SEGMENT",
                "segments": [
                  "497f6eca-6276-4993-bfeb-53cbbbba6f08"
                ],
                "query": "{\\\"analysis\\\":{\\\"title\\\":\\\"notempty\\\",\\\"segments\\\":[{\\\"title\\\":\\\"notempty\\\",\\\"filter\\\":{\\\"matching\\\":true,\\\"expressions\\\":[{\\\"type\\\":\\\"ATTRIBUTE\\\",\\\"attribute\\\":{\\\"expressions\\\":[{\\\"constraint\\\":{\\\"type\\\":\\\"BOOL\\\",\\\"logic\\\":\\\"IS_TRUE\\\"},\\\"attribute\\\":{\\\"type\\\":\\\"PARAM\\\",\\\"param\\\":\\\"exampleBool\\\"}}]}}]}}]}}"
              },
              "schemaType": "SIMPLE"
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/brickworks/v1/schemas");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/brickworks/v1/schemas",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              appId: 'string',
              displayName: 'string',
              description: 'string',
              fields: {
                type: 'object',
                properties: {
                  property1: {
                    type: 'number',
                    subtype: 'number',
                    minimum: 0.1,
                    maximum: 0.1,
                    unique: true,
                    searchable: true,
                    default: 0,
                    isConstantField: false
                  },
                  property2: {
                    type: 'number',
                    subtype: 'number',
                    minimum: 0.1,
                    maximum: 0.1,
                    unique: true,
                    searchable: true,
                    default: 0,
                    isConstantField: false
                  }
                },
                required: ['string'],
                allOf: [
                  {
                    if: {
                      required: ['string'],
                      properties: {
                        property1: {
                          minItems: 0,
                          maxItems: 0,
                          uniqueItems: true,
                          minimum: 0,
                          maximum: 0,
                          pattern: 'string',
                          const: null,
                          enum: ['string'],
                          not: {}
                        },
                        property2: {
                          minItems: 0,
                          maxItems: 0,
                          uniqueItems: true,
                          minimum: 0,
                          maximum: 0,
                          pattern: 'string',
                          const: null,
                          enum: ['string'],
                          not: {}
                        }
                      }
                    },
                    then: {
                      required: ['string'],
                      properties: {
                        property1: {
                          minItems: 0,
                          maxItems: 0,
                          uniqueItems: true,
                          minimum: 0,
                          maximum: 0,
                          pattern: 'string',
                          const: null,
                          enum: ['string'],
                          not: {}
                        },
                        property2: {
                          minItems: 0,
                          maxItems: 0,
                          uniqueItems: true,
                          minimum: 0,
                          maximum: 0,
                          pattern: 'string',
                          const: null,
                          enum: ['string'],
                          not: {}
                        }
                      }
                    },
                    else: {
                      required: ['string'],
                      properties: {
                        property1: {
                          minItems: 0,
                          maxItems: 0,
                          uniqueItems: true,
                          minimum: 0,
                          maximum: 0,
                          pattern: 'string',
                          const: null,
                          enum: ['string'],
                          not: {}
                        },
                        property2: {
                          minItems: 0,
                          maxItems: 0,
                          uniqueItems: true,
                          minimum: 0,
                          maximum: 0,
                          pattern: 'string',
                          const: null,
                          enum: ['string'],
                          not: {}
                        }
                      }
                    }
                  }
                ],
                additionalProperties: true
              },
              displayConfiguration: {
                ordering: {property1: 0, property2: 0},
                metadata: {
                  property1: {title: 'empty title', description: 'string', useAsRecordName: false},
                  property2: {title: 'empty title', description: 'string', useAsRecordName: false}
                }
              },
              audience: {
                targetType: 'SEGMENT',
                segments: ['497f6eca-6276-4993-bfeb-53cbbbba6f08'],
                query: '{\"analysis\":{\"title\":\"notempty\",\"segments\":[{\"title\":\"notempty\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"exampleBool\"}}]}}]}}]}}'
              },
              schemaType: 'SIMPLE'
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/brickworks/v1/schemas');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"appId":"string","displayName":"string","description":"string","fields":{"type":"object","properties":{"property1":{"type":"number","subtype":"number","minimum":0.1,"maximum":0.1,"unique":true,"searchable":true,"default":0,"isConstantField":false},"property2":{"type":"number","subtype":"number","minimum":0.1,"maximum":0.1,"unique":true,"searchable":true,"default":0,"isConstantField":false}},"required":["string"],"allOf":[{"if":{"required":["string"],"properties":{"property1":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}},"property2":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}}}},"then":{"required":["string"],"properties":{"property1":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}},"property2":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}}}},"else":{"required":["string"],"properties":{"property1":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}},"property2":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}}}}}],"additionalProperties":true},"displayConfiguration":{"ordering":{"property1":0,"property2":0},"metadata":{"property1":{"title":"empty title","description":"string","useAsRecordName":false},"property2":{"title":"empty title","description":"string","useAsRecordName":false}}},"audience":{"targetType":"SEGMENT","segments":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"query":"{\\\\\\"analysis\\\\\\":{\\\\\\"title\\\\\\":\\\\\\"notempty\\\\\\",\\\\\\"segments\\\\\\":[{\\\\\\"title\\\\\\":\\\\\\"notempty\\\\\\",\\\\\\"filter\\\\\\":{\\\\\\"matching\\\\\\":true,\\\\\\"expressions\\\\\\":[{\\\\\\"type\\\\\\":\\\\\\"ATTRIBUTE\\\\\\",\\\\\\"attribute\\\\\\":{\\\\\\"expressions\\\\\\":[{\\\\\\"constraint\\\\\\":{\\\\\\"type\\\\\\":\\\\\\"BOOL\\\\\\",\\\\\\"logic\\\\\\":\\\\\\"IS_TRUE\\\\\\"},\\\\\\"attribute\\\\\\":{\\\\\\"type\\\\\\":\\\\\\"PARAM\\\\\\",\\\\\\"param\\\\\\":\\\\\\"exampleBool\\\\\\"}}]}}]}}]}}"},"schemaType":"SIMPLE"}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/brickworks/v1/schemas")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"appId\":\"string\",\"displayName\":\"string\",\"description\":\"string\",\"fields\":{\"type\":\"object\",\"properties\":{\"property1\":{\"type\":\"number\",\"subtype\":\"number\",\"minimum\":0.1,\"maximum\":0.1,\"unique\":true,\"searchable\":true,\"default\":0,\"isConstantField\":false},\"property2\":{\"type\":\"number\",\"subtype\":\"number\",\"minimum\":0.1,\"maximum\":0.1,\"unique\":true,\"searchable\":true,\"default\":0,\"isConstantField\":false}},\"required\":[\"string\"],\"allOf\":[{\"if\":{\"required\":[\"string\"],\"properties\":{\"property1\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}},\"property2\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}}}},\"then\":{\"required\":[\"string\"],\"properties\":{\"property1\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}},\"property2\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}}}},\"else\":{\"required\":[\"string\"],\"properties\":{\"property1\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}},\"property2\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}}}}}],\"additionalProperties\":true},\"displayConfiguration\":{\"ordering\":{\"property1\":0,\"property2\":0},\"metadata\":{\"property1\":{\"title\":\"empty title\",\"description\":\"string\",\"useAsRecordName\":false},\"property2\":{\"title\":\"empty title\",\"description\":\"string\",\"useAsRecordName\":false}}},\"audience\":{\"targetType\":\"SEGMENT\",\"segments\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"query\":\"{\\\\\\\"analysis\\\\\\\":{\\\\\\\"title\\\\\\\":\\\\\\\"notempty\\\\\\\",\\\\\\\"segments\\\\\\\":[{\\\\\\\"title\\\\\\\":\\\\\\\"notempty\\\\\\\",\\\\\\\"filter\\\\\\\":{\\\\\\\"matching\\\\\\\":true,\\\\\\\"expressions\\\\\\\":[{\\\\\\\"type\\\\\\\":\\\\\\\"ATTRIBUTE\\\\\\\",\\\\\\\"attribute\\\\\\\":{\\\\\\\"expressions\\\\\\\":[{\\\\\\\"constraint\\\\\\\":{\\\\\\\"type\\\\\\\":\\\\\\\"BOOL\\\\\\\",\\\\\\\"logic\\\\\\\":\\\\\\\"IS_TRUE\\\\\\\"},\\\\\\\"attribute\\\\\\\":{\\\\\\\"type\\\\\\\":\\\\\\\"PARAM\\\\\\\",\\\\\\\"param\\\\\\\":\\\\\\\"exampleBool\\\\\\\"}}]}}]}}]}}\"},\"schemaType\":\"SIMPLE\"}")
              .asString();
  /brickworks/v1/schemas/{SchemaIdentifier}:
    get:
      tags:
        - "Brickworks: Schemas"
      summary: Get schema
      description: |
        Retrieve the details of a schema.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_SCHEMAS_READ`

        **User role permission required:** `assets_brickworks: read`
      operationId: getSchemaById
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathSchemaIdentifier"
      responses:
        "200":
          description: Details of the schema
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/brickworks-service-Schema"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Schemas/operation/getSchemaById
    put:
      tags:
        - "Brickworks: Schemas"
      summary: Update schema
      description: |
        Update a schema.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_SCHEMAS_UPDATE`

        **User role permission required:** `assets_brickworks: update`
      operationId: updateSchema
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathSchemaIdentifier"
      requestBody:
        description: Schema properties to update
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/brickworks-service-UpdateSchemaRequest"
      responses:
        "200":
          description: Schema updated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/brickworks-service-Schema"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Schemas/operation/updateSchema
    delete:
      tags:
        - "Brickworks: Schemas"
      summary: Delete schema
      description: |
        Delete a schema.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_SCHEMAS_DELETE`

        **User role permission required:** `assets_brickworks: delete`
      operationId: deleteSchema
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathSchemaIdentifier"
      responses:
        "204":
          description: Schema deleted
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Schemas/operation/deleteSchema
  /brickworks/v1/schemas/{SchemaIdentifier}/records:
    get:
      tags:
        - "Brickworks: Records"
      summary: Get records from schema
      description: |
        Retrieve records from a schema. You can paginate, sort, and refine the results. By default, the records are sorted by status (published > scheduled > draft > unpublished) and then by last update time.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_RECORDS_READ`

        **User role permission required:** `assets_brickworks: read`
      operationId: getRecordsFromSchema
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathSchemaIdentifier"
        - $ref: "#/components/parameters/brickworks-service-queryLimit"
        - $ref: "#/components/parameters/brickworks-service-queryPage"
        - $ref: "#/components/parameters/brickworks-service-queryRecordFilters"
        - $ref: "#/components/parameters/brickworks-service-querySearchRecords"
        - $ref: "#/components/parameters/brickworks-service-querySortByRecords"
        - $ref: "#/components/parameters/brickworks-service-queryIds"
        - $ref: "#/components/parameters/brickworks-service-queryStatuses"
        - $ref: "#/components/parameters/brickworks-service-querySlugs"
        - $ref: "#/components/parameters/brickworks-service-queryFields"
      responses:
        "200":
          description: A page of records
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/brickworks-service-RecordPagingResult"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Records/operation/getRecordsFromSchema
    post:
      tags:
        - "Brickworks: Records"
      summary: Add record to schema
      description: |
        Add a record to a schema

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_RECORDS_CREATE`

        **User role permission required:** `assets_brickworks: create`
      operationId: addRecordToSchema
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathSchemaIdentifier"
      requestBody:
        description: Add record to schema
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/brickworks-service-AddRecordToSchemaRequest"
      responses:
        "200":
          description: Record data
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/brickworks-service-Record"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Records/operation/addRecordToSchema
  /brickworks/v1/schemas/{SchemaIdentifier}/records/{RecordIdentifier}:
    get:
      tags:
        - "Brickworks: Records"
      summary: Get record
      description: |
        Retrieve a record. You can select the fields that you want to include in the response.

        If the record has multiple versions in different publishing states, the first available version is returned according to publishing status priority:
          - PUBLISHED
          - DRAFT
          - SCHEDULED
          - UNPUBLISHED
        You can use the `statuses` parameter to limit the lookup.


        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_RECORDS_READ`

        **User role permission required:** `assets_brickworks: read`
      operationId: getRecord
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathSchemaIdentifier"
        - $ref: "#/components/parameters/brickworks-service-pathRecordIdentifier"
        - $ref: "#/components/parameters/brickworks-service-queryFields"
        - $ref: "#/components/parameters/brickworks-service-queryStatuses"
      responses:
        "200":
          description: Details of the record
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/brickworks-service-Record"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Records/operation/getRecord
    put:
      tags:
        - "Brickworks: Records"
      summary: Update record
      description: |
        Update a record.

        In a versioned schema, you can't directly edit a published record. To make changes, update the status to DRAFT (you can include the other changes that you want to make). This creates a new version of the record (without modifying the currently published version), which you can edit and publish.


        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_RECORDS_UPDATE`

        **User role permission required:** `assets_brickworks: update`
      operationId: updateRecord
      security:
        - JWT: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/brickworks-service-UpdateRecordRequest"
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathSchemaIdentifier"
        - $ref: "#/components/parameters/brickworks-service-pathRecordIdentifier"
      responses:
        "200":
          description: Details of the updated record
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/brickworks-service-Record"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Records/operation/updateRecord
    delete:
      tags:
        - "Brickworks: Records"
      summary: Delete record
      description: |
        Delete a record **permanently**. If you want to unpublish a record instead, send an update request to change the status to `UNPUBLISHED`

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_RECORDS_DELETE`

        **User role permission required:** `assets_brickworks: delete`
      operationId: deleteRecord
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathSchemaIdentifier"
        - $ref: "#/components/parameters/brickworks-service-pathRecordIdentifier"
      responses:
        "204":
          description: Record deleted
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Records/operation/deleteRecord
  /brickworks/v1/schemas/{SchemaIdentifier}/records/{RecordIdentifier}/generate/by/{IdentifierType}:
    post:
      tags:
        - "Brickworks: Content generation"
      summary: Generate object from a record (as workspace)
      description: |
        Generate content from the latest **published version of a record** by processing Jinjava inserts and requests to external sources. Profile data (if needed, for example for Jinjava) is retrieved automatically from the profile declared in the request.

        The system looks for values to generate in the following order:

          1. Values in the `fieldContext` object (used by recommendations and relations).
          1. Values saved in the record.
          2. Values from the `default` object in the schema.  
            This is available for all field types.  
          3. Default values nested in the `properties` of a field in the schema.  
            This is available for some complex field types.  


        The content is always generated according to the latest version of a schema:
          - If fields were deleted from the schema, but they still exist in the record, they are ignored.
          - If fields were added to the schema and they don't exist in the record, their default values are added. If there are no default values, the fields are ignored.

        Some data is cached:
        - profile data (even if the profile is updated)
        - responses from external sources  
        For details, see the [User Guide](https://hub.synerise.com/docs/assets/brickworks/limits).


        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_RECORDS_READ`

        **User role permission required:** `assets_brickworks: read`
      operationId: generateObjectForProfile
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathSchemaIdentifier"
        - $ref: "#/components/parameters/brickworks-service-pathRecordIdentifier"
        - $ref: "#/components/parameters/brickworks-service-pathIdentifierType"
      requestBody:
        description: Object generation request
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/brickworks-service-GenerateRequest"
      responses:
        "200":
          $ref: "#/components/responses/brickworks-service-GeneratedObject"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Content-generation/operation/generateObjectForProfile
  /brickworks/v1/schemas/{SchemaIdentifier}/records/{RecordIdentifier}/generate:
    post:
      tags:
        - "Brickworks: Content generation"
      summary: Generate object from a record (as any consumer)
      description: |
        Generate content from the latest **published version of a record** by processing Jinjava inserts and requests to external sources.  
        If the request is authorized by a profile, the profile data is automatically retrieve for fields which need it (for example, in Jinjava inserts).

        The system looks for values to generate in the following order:

          1. Values in the `fieldContext` object (used by recommendations and relations).
          1. Values saved in the record.
          2. Values from the `default` object in the schema.  
            This is available for all field types.  
          3. Default values nested in the `properties` of a field in the schema.  
            This is available for some complex field types.  


        The content is always generated according to the latest version of a schema:
          - If fields were deleted from the schema, but they still exist in the record, they are ignored.
          - If fields were added to the schema and they don't exist in the record, their default values are added. If there are no default values, the fields are ignored.

        Some data is cached:
        - profile data (even if the profile is updated)
        - responses from external sources  
        For details, see the [User Guide](https://hub.synerise.com/docs/assets/brickworks/limits).


        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=authenticateUsingPOST_v3" target="_blank" rel="noopener">Profile (Client)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=LogInAnonymouslyV3" target="_blank" rel="noopener">Anonymous Profile</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `BRICKWORKS_RECORDS_READ`

        **User role permission required:** `assets_brickworks: read`
      operationId: generateObject
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathSchemaIdentifier"
        - $ref: "#/components/parameters/brickworks-service-pathRecordIdentifier"
      requestBody:
        description: Object generation request
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/brickworks-service-GenerateRequestWithoutIdentifier"
      responses:
        "200":
          $ref: "#/components/responses/brickworks-service-GeneratedObject"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Content-generation/operation/generateObject
  /brickworks/v1/schemas/records/preview/by/{IdentifierType}:
    post:
      tags:
        - "Brickworks: Records"
      summary: Preview object (as workspace)
      description: |
        Preview an object by sending field values. 

        When generating a preview, fields are only generated when you send their value or they have a default value. Values saved in the record are not used in the preview.

        Some data is cached:
        - profile data (even if the profile is updated)
        - responses from external sources  
        For details, see the [User Guide](https://hub.synerise.com/docs/assets/brickworks/limits).


        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_RECORDS_READ`

        **User role permission required:** `assets_brickworks: read`
      operationId: previewObject
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathIdentifierType"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/brickworks-service-PreviewRequest"
      responses:
        "200":
          description: Generated JSON
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/brickworks-service-GeneratedObject"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Records/operation/previewObject
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/brickworks/v1/schemas/records/preview/by/%7BIdentifierType%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"identifierValue":"string","context":{"property1":null,"property2":null},"fieldContext":{"property1":{"page":1,"limit":10,"itemId":"item-123","additionalFilters":"custom filter value"},"property2":{"page":1,"limit":10,"itemId":"item-123","additionalFilters":"custom filter value"}},"values":{"property1":null,"property2":null},"schema":{"fields":{"type":"object","properties":{"property1":{"type":"number","subtype":"number","minimum":0.1,"maximum":0.1,"unique":true,"searchable":true,"default":0,"isConstantField":false},"property2":{"type":"number","subtype":"number","minimum":0.1,"maximum":0.1,"unique":true,"searchable":true,"default":0,"isConstantField":false}},"required":["string"],"allOf":[{"if":{"required":["string"],"properties":{"property1":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}},"property2":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}}}},"then":{"required":["string"],"properties":{"property1":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}},"property2":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}}}},"else":{"required":["string"],"properties":{"property1":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}},"property2":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}}}}}],"additionalProperties":true},"audience":{"targetType":"SEGMENT","segments":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"query":"{\\\"analysis\\\":{\\\"title\\\":\\\"notempty\\\",\\\"segments\\\":[{\\\"title\\\":\\\"notempty\\\",\\\"filter\\\":{\\\"matching\\\":true,\\\"expressions\\\":[{\\\"type\\\":\\\"ATTRIBUTE\\\",\\\"attribute\\\":{\\\"expressions\\\":[{\\\"constraint\\\":{\\\"type\\\":\\\"BOOL\\\",\\\"logic\\\":\\\"IS_TRUE\\\"},\\\"attribute\\\":{\\\"type\\\":\\\"PARAM\\\",\\\"param\\\":\\\"exampleBool\\\"}}]}}]}}]}}"},"schemaType":"SIMPLE"}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"identifierValue\":\"string\",\"context\":{\"property1\":null,\"property2\":null},\"fieldContext\":{\"property1\":{\"page\":1,\"limit\":10,\"itemId\":\"item-123\",\"additionalFilters\":\"custom filter value\"},\"property2\":{\"page\":1,\"limit\":10,\"itemId\":\"item-123\",\"additionalFilters\":\"custom filter value\"}},\"values\":{\"property1\":null,\"property2\":null},\"schema\":{\"fields\":{\"type\":\"object\",\"properties\":{\"property1\":{\"type\":\"number\",\"subtype\":\"number\",\"minimum\":0.1,\"maximum\":0.1,\"unique\":true,\"searchable\":true,\"default\":0,\"isConstantField\":false},\"property2\":{\"type\":\"number\",\"subtype\":\"number\",\"minimum\":0.1,\"maximum\":0.1,\"unique\":true,\"searchable\":true,\"default\":0,\"isConstantField\":false}},\"required\":[\"string\"],\"allOf\":[{\"if\":{\"required\":[\"string\"],\"properties\":{\"property1\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}},\"property2\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}}}},\"then\":{\"required\":[\"string\"],\"properties\":{\"property1\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}},\"property2\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}}}},\"else\":{\"required\":[\"string\"],\"properties\":{\"property1\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}},\"property2\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}}}}}],\"additionalProperties\":true},\"audience\":{\"targetType\":\"SEGMENT\",\"segments\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"query\":\"{\\\\\\\"analysis\\\\\\\":{\\\\\\\"title\\\\\\\":\\\\\\\"notempty\\\\\\\",\\\\\\\"segments\\\\\\\":[{\\\\\\\"title\\\\\\\":\\\\\\\"notempty\\\\\\\",\\\\\\\"filter\\\\\\\":{\\\\\\\"matching\\\\\\\":true,\\\\\\\"expressions\\\\\\\":[{\\\\\\\"type\\\\\\\":\\\\\\\"ATTRIBUTE\\\\\\\",\\\\\\\"attribute\\\\\\\":{\\\\\\\"expressions\\\\\\\":[{\\\\\\\"constraint\\\\\\\":{\\\\\\\"type\\\\\\\":\\\\\\\"BOOL\\\\\\\",\\\\\\\"logic\\\\\\\":\\\\\\\"IS_TRUE\\\\\\\"},\\\\\\\"attribute\\\\\\\":{\\\\\\\"type\\\\\\\":\\\\\\\"PARAM\\\\\\\",\\\\\\\"param\\\\\\\":\\\\\\\"exampleBool\\\\\\\"}}]}}]}}]}}\"},\"schemaType\":\"SIMPLE\"}}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/brickworks/v1/schemas/records/preview/by/%7BIdentifierType%7D", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "identifierValue": "string",
              "context": {
                "property1": null,
                "property2": null
              },
              "fieldContext": {
                "property1": {
                  "page": 1,
                  "limit": 10,
                  "itemId": "item-123",
                  "additionalFilters": "custom filter value"
                },
                "property2": {
                  "page": 1,
                  "limit": 10,
                  "itemId": "item-123",
                  "additionalFilters": "custom filter value"
                }
              },
              "values": {
                "property1": null,
                "property2": null
              },
              "schema": {
                "fields": {
                  "type": "object",
                  "properties": {
                    "property1": {
                      "type": "number",
                      "subtype": "number",
                      "minimum": 0.1,
                      "maximum": 0.1,
                      "unique": true,
                      "searchable": true,
                      "default": 0,
                      "isConstantField": false
                    },
                    "property2": {
                      "type": "number",
                      "subtype": "number",
                      "minimum": 0.1,
                      "maximum": 0.1,
                      "unique": true,
                      "searchable": true,
                      "default": 0,
                      "isConstantField": false
                    }
                  },
                  "required": [
                    "string"
                  ],
                  "allOf": [
                    {
                      "if": {
                        "required": [
                          "string"
                        ],
                        "properties": {
                          "property1": {
                            "minItems": 0,
                            "maxItems": 0,
                            "uniqueItems": true,
                            "minimum": 0,
                            "maximum": 0,
                            "pattern": "string",
                            "const": null,
                            "enum": [
                              "string"
                            ],
                            "not": {}
                          },
                          "property2": {
                            "minItems": 0,
                            "maxItems": 0,
                            "uniqueItems": true,
                            "minimum": 0,
                            "maximum": 0,
                            "pattern": "string",
                            "const": null,
                            "enum": [
                              "string"
                            ],
                            "not": {}
                          }
                        }
                      },
                      "then": {
                        "required": [
                          "string"
                        ],
                        "properties": {
                          "property1": {
                            "minItems": 0,
                            "maxItems": 0,
                            "uniqueItems": true,
                            "minimum": 0,
                            "maximum": 0,
                            "pattern": "string",
                            "const": null,
                            "enum": [
                              "string"
                            ],
                            "not": {}
                          },
                          "property2": {
                            "minItems": 0,
                            "maxItems": 0,
                            "uniqueItems": true,
                            "minimum": 0,
                            "maximum": 0,
                            "pattern": "string",
                            "const": null,
                            "enum": [
                              "string"
                            ],
                            "not": {}
                          }
                        }
                      },
                      "else": {
                        "required": [
                          "string"
                        ],
                        "properties": {
                          "property1": {
                            "minItems": 0,
                            "maxItems": 0,
                            "uniqueItems": true,
                            "minimum": 0,
                            "maximum": 0,
                            "pattern": "string",
                            "const": null,
                            "enum": [
                              "string"
                            ],
                            "not": {}
                          },
                          "property2": {
                            "minItems": 0,
                            "maxItems": 0,
                            "uniqueItems": true,
                            "minimum": 0,
                            "maximum": 0,
                            "pattern": "string",
                            "const": null,
                            "enum": [
                              "string"
                            ],
                            "not": {}
                          }
                        }
                      }
                    }
                  ],
                  "additionalProperties": true
                },
                "audience": {
                  "targetType": "SEGMENT",
                  "segments": [
                    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
                  ],
                  "query": "{\\\"analysis\\\":{\\\"title\\\":\\\"notempty\\\",\\\"segments\\\":[{\\\"title\\\":\\\"notempty\\\",\\\"filter\\\":{\\\"matching\\\":true,\\\"expressions\\\":[{\\\"type\\\":\\\"ATTRIBUTE\\\",\\\"attribute\\\":{\\\"expressions\\\":[{\\\"constraint\\\":{\\\"type\\\":\\\"BOOL\\\",\\\"logic\\\":\\\"IS_TRUE\\\"},\\\"attribute\\\":{\\\"type\\\":\\\"PARAM\\\",\\\"param\\\":\\\"exampleBool\\\"}}]}}]}}]}}"
                },
                "schemaType": "SIMPLE"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/brickworks/v1/schemas/records/preview/by/%7BIdentifierType%7D");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/brickworks/v1/schemas/records/preview/by/%7BIdentifierType%7D",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              identifierValue: 'string',
              context: {property1: null, property2: null},
              fieldContext: {
                property1: {
                  page: 1,
                  limit: 10,
                  itemId: 'item-123',
                  additionalFilters: 'custom filter value'
                },
                property2: {
                  page: 1,
                  limit: 10,
                  itemId: 'item-123',
                  additionalFilters: 'custom filter value'
                }
              },
              values: {property1: null, property2: null},
              schema: {
                fields: {
                  type: 'object',
                  properties: {
                    property1: {
                      type: 'number',
                      subtype: 'number',
                      minimum: 0.1,
                      maximum: 0.1,
                      unique: true,
                      searchable: true,
                      default: 0,
                      isConstantField: false
                    },
                    property2: {
                      type: 'number',
                      subtype: 'number',
                      minimum: 0.1,
                      maximum: 0.1,
                      unique: true,
                      searchable: true,
                      default: 0,
                      isConstantField: false
                    }
                  },
                  required: ['string'],
                  allOf: [
                    {
                      if: {
                        required: ['string'],
                        properties: {
                          property1: {
                            minItems: 0,
                            maxItems: 0,
                            uniqueItems: true,
                            minimum: 0,
                            maximum: 0,
                            pattern: 'string',
                            const: null,
                            enum: ['string'],
                            not: {}
                          },
                          property2: {
                            minItems: 0,
                            maxItems: 0,
                            uniqueItems: true,
                            minimum: 0,
                            maximum: 0,
                            pattern: 'string',
                            const: null,
                            enum: ['string'],
                            not: {}
                          }
                        }
                      },
                      then: {
                        required: ['string'],
                        properties: {
                          property1: {
                            minItems: 0,
                            maxItems: 0,
                            uniqueItems: true,
                            minimum: 0,
                            maximum: 0,
                            pattern: 'string',
                            const: null,
                            enum: ['string'],
                            not: {}
                          },
                          property2: {
                            minItems: 0,
                            maxItems: 0,
                            uniqueItems: true,
                            minimum: 0,
                            maximum: 0,
                            pattern: 'string',
                            const: null,
                            enum: ['string'],
                            not: {}
                          }
                        }
                      },
                      else: {
                        required: ['string'],
                        properties: {
                          property1: {
                            minItems: 0,
                            maxItems: 0,
                            uniqueItems: true,
                            minimum: 0,
                            maximum: 0,
                            pattern: 'string',
                            const: null,
                            enum: ['string'],
                            not: {}
                          },
                          property2: {
                            minItems: 0,
                            maxItems: 0,
                            uniqueItems: true,
                            minimum: 0,
                            maximum: 0,
                            pattern: 'string',
                            const: null,
                            enum: ['string'],
                            not: {}
                          }
                        }
                      }
                    }
                  ],
                  additionalProperties: true
                },
                audience: {
                  targetType: 'SEGMENT',
                  segments: ['497f6eca-6276-4993-bfeb-53cbbbba6f08'],
                  query: '{\"analysis\":{\"title\":\"notempty\",\"segments\":[{\"title\":\"notempty\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"exampleBool\"}}]}}]}}]}}'
                },
                schemaType: 'SIMPLE'
              }
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/brickworks/v1/schemas/records/preview/by/%7BIdentifierType%7D');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"identifierValue":"string","context":{"property1":null,"property2":null},"fieldContext":{"property1":{"page":1,"limit":10,"itemId":"item-123","additionalFilters":"custom filter value"},"property2":{"page":1,"limit":10,"itemId":"item-123","additionalFilters":"custom filter value"}},"values":{"property1":null,"property2":null},"schema":{"fields":{"type":"object","properties":{"property1":{"type":"number","subtype":"number","minimum":0.1,"maximum":0.1,"unique":true,"searchable":true,"default":0,"isConstantField":false},"property2":{"type":"number","subtype":"number","minimum":0.1,"maximum":0.1,"unique":true,"searchable":true,"default":0,"isConstantField":false}},"required":["string"],"allOf":[{"if":{"required":["string"],"properties":{"property1":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}},"property2":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}}}},"then":{"required":["string"],"properties":{"property1":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}},"property2":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}}}},"else":{"required":["string"],"properties":{"property1":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}},"property2":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}}}}}],"additionalProperties":true},"audience":{"targetType":"SEGMENT","segments":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"query":"{\\\\\\"analysis\\\\\\":{\\\\\\"title\\\\\\":\\\\\\"notempty\\\\\\",\\\\\\"segments\\\\\\":[{\\\\\\"title\\\\\\":\\\\\\"notempty\\\\\\",\\\\\\"filter\\\\\\":{\\\\\\"matching\\\\\\":true,\\\\\\"expressions\\\\\\":[{\\\\\\"type\\\\\\":\\\\\\"ATTRIBUTE\\\\\\",\\\\\\"attribute\\\\\\":{\\\\\\"expressions\\\\\\":[{\\\\\\"constraint\\\\\\":{\\\\\\"type\\\\\\":\\\\\\"BOOL\\\\\\",\\\\\\"logic\\\\\\":\\\\\\"IS_TRUE\\\\\\"},\\\\\\"attribute\\\\\\":{\\\\\\"type\\\\\\":\\\\\\"PARAM\\\\\\",\\\\\\"param\\\\\\":\\\\\\"exampleBool\\\\\\"}}]}}]}}]}}"},"schemaType":"SIMPLE"}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/brickworks/v1/schemas/records/preview/by/%7BIdentifierType%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"identifierValue\":\"string\",\"context\":{\"property1\":null,\"property2\":null},\"fieldContext\":{\"property1\":{\"page\":1,\"limit\":10,\"itemId\":\"item-123\",\"additionalFilters\":\"custom filter value\"},\"property2\":{\"page\":1,\"limit\":10,\"itemId\":\"item-123\",\"additionalFilters\":\"custom filter value\"}},\"values\":{\"property1\":null,\"property2\":null},\"schema\":{\"fields\":{\"type\":\"object\",\"properties\":{\"property1\":{\"type\":\"number\",\"subtype\":\"number\",\"minimum\":0.1,\"maximum\":0.1,\"unique\":true,\"searchable\":true,\"default\":0,\"isConstantField\":false},\"property2\":{\"type\":\"number\",\"subtype\":\"number\",\"minimum\":0.1,\"maximum\":0.1,\"unique\":true,\"searchable\":true,\"default\":0,\"isConstantField\":false}},\"required\":[\"string\"],\"allOf\":[{\"if\":{\"required\":[\"string\"],\"properties\":{\"property1\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}},\"property2\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}}}},\"then\":{\"required\":[\"string\"],\"properties\":{\"property1\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}},\"property2\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}}}},\"else\":{\"required\":[\"string\"],\"properties\":{\"property1\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}},\"property2\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}}}}}],\"additionalProperties\":true},\"audience\":{\"targetType\":\"SEGMENT\",\"segments\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"query\":\"{\\\\\\\"analysis\\\\\\\":{\\\\\\\"title\\\\\\\":\\\\\\\"notempty\\\\\\\",\\\\\\\"segments\\\\\\\":[{\\\\\\\"title\\\\\\\":\\\\\\\"notempty\\\\\\\",\\\\\\\"filter\\\\\\\":{\\\\\\\"matching\\\\\\\":true,\\\\\\\"expressions\\\\\\\":[{\\\\\\\"type\\\\\\\":\\\\\\\"ATTRIBUTE\\\\\\\",\\\\\\\"attribute\\\\\\\":{\\\\\\\"expressions\\\\\\\":[{\\\\\\\"constraint\\\\\\\":{\\\\\\\"type\\\\\\\":\\\\\\\"BOOL\\\\\\\",\\\\\\\"logic\\\\\\\":\\\\\\\"IS_TRUE\\\\\\\"},\\\\\\\"attribute\\\\\\\":{\\\\\\\"type\\\\\\\":\\\\\\\"PARAM\\\\\\\",\\\\\\\"param\\\\\\\":\\\\\\\"exampleBool\\\\\\\"}}]}}]}}]}}\"},\"schemaType\":\"SIMPLE\"}}")
              .asString();
  /brickworks/v1/schemas/records/preview:
    post:
      tags:
        - "Brickworks: Records"
      summary: Preview object (as any consumer)
      description: |
        Preview an object by sending field values. 

        When generating a preview, fields are only generated when you send their value or they have a default value. Values saved in the record are not used in the preview.

        Some data is cached:
        - profile data (even if the profile is updated)
        - responses from external sources  
        For details, see the [User Guide](https://hub.synerise.com/docs/assets/brickworks/limits).


        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=authenticateUsingPOST_v3" target="_blank" rel="noopener">Profile (Client)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=LogInAnonymouslyV3" target="_blank" rel="noopener">Anonymous Profile</a>

        **API key permission required:** `BRICKWORKS_RECORDS_READ`

        **User role permission required:** `assets_brickworks: read`
      operationId: previewObjectByProfile
      security:
        - JWT: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/brickworks-service-PreviewRequestWithoutIdentifier"
      responses:
        "200":
          description: Generated JSON
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/brickworks-service-GeneratedObject"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Records/operation/previewObjectByProfile
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/brickworks/v1/schemas/records/preview \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"context":{"property1":null,"property2":null},"fieldContext":{"property1":{"page":1,"limit":10,"itemId":"item-123","additionalFilters":"custom filter value"},"property2":{"page":1,"limit":10,"itemId":"item-123","additionalFilters":"custom filter value"}},"values":{"property1":null,"property2":null},"schema":{"fields":{"type":"object","properties":{"property1":{"type":"number","subtype":"number","minimum":0.1,"maximum":0.1,"unique":true,"searchable":true,"default":0,"isConstantField":false},"property2":{"type":"number","subtype":"number","minimum":0.1,"maximum":0.1,"unique":true,"searchable":true,"default":0,"isConstantField":false}},"required":["string"],"allOf":[{"if":{"required":["string"],"properties":{"property1":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}},"property2":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}}}},"then":{"required":["string"],"properties":{"property1":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}},"property2":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}}}},"else":{"required":["string"],"properties":{"property1":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}},"property2":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}}}}}],"additionalProperties":true},"audience":{"targetType":"SEGMENT","segments":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"query":"{\\\"analysis\\\":{\\\"title\\\":\\\"notempty\\\",\\\"segments\\\":[{\\\"title\\\":\\\"notempty\\\",\\\"filter\\\":{\\\"matching\\\":true,\\\"expressions\\\":[{\\\"type\\\":\\\"ATTRIBUTE\\\",\\\"attribute\\\":{\\\"expressions\\\":[{\\\"constraint\\\":{\\\"type\\\":\\\"BOOL\\\",\\\"logic\\\":\\\"IS_TRUE\\\"},\\\"attribute\\\":{\\\"type\\\":\\\"PARAM\\\",\\\"param\\\":\\\"exampleBool\\\"}}]}}]}}]}}"},"schemaType":"SIMPLE"}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"context\":{\"property1\":null,\"property2\":null},\"fieldContext\":{\"property1\":{\"page\":1,\"limit\":10,\"itemId\":\"item-123\",\"additionalFilters\":\"custom filter value\"},\"property2\":{\"page\":1,\"limit\":10,\"itemId\":\"item-123\",\"additionalFilters\":\"custom filter value\"}},\"values\":{\"property1\":null,\"property2\":null},\"schema\":{\"fields\":{\"type\":\"object\",\"properties\":{\"property1\":{\"type\":\"number\",\"subtype\":\"number\",\"minimum\":0.1,\"maximum\":0.1,\"unique\":true,\"searchable\":true,\"default\":0,\"isConstantField\":false},\"property2\":{\"type\":\"number\",\"subtype\":\"number\",\"minimum\":0.1,\"maximum\":0.1,\"unique\":true,\"searchable\":true,\"default\":0,\"isConstantField\":false}},\"required\":[\"string\"],\"allOf\":[{\"if\":{\"required\":[\"string\"],\"properties\":{\"property1\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}},\"property2\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}}}},\"then\":{\"required\":[\"string\"],\"properties\":{\"property1\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}},\"property2\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}}}},\"else\":{\"required\":[\"string\"],\"properties\":{\"property1\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}},\"property2\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}}}}}],\"additionalProperties\":true},\"audience\":{\"targetType\":\"SEGMENT\",\"segments\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"query\":\"{\\\\\\\"analysis\\\\\\\":{\\\\\\\"title\\\\\\\":\\\\\\\"notempty\\\\\\\",\\\\\\\"segments\\\\\\\":[{\\\\\\\"title\\\\\\\":\\\\\\\"notempty\\\\\\\",\\\\\\\"filter\\\\\\\":{\\\\\\\"matching\\\\\\\":true,\\\\\\\"expressions\\\\\\\":[{\\\\\\\"type\\\\\\\":\\\\\\\"ATTRIBUTE\\\\\\\",\\\\\\\"attribute\\\\\\\":{\\\\\\\"expressions\\\\\\\":[{\\\\\\\"constraint\\\\\\\":{\\\\\\\"type\\\\\\\":\\\\\\\"BOOL\\\\\\\",\\\\\\\"logic\\\\\\\":\\\\\\\"IS_TRUE\\\\\\\"},\\\\\\\"attribute\\\\\\\":{\\\\\\\"type\\\\\\\":\\\\\\\"PARAM\\\\\\\",\\\\\\\"param\\\\\\\":\\\\\\\"exampleBool\\\\\\\"}}]}}]}}]}}\"},\"schemaType\":\"SIMPLE\"}}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/brickworks/v1/schemas/records/preview", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "context": {
                "property1": null,
                "property2": null
              },
              "fieldContext": {
                "property1": {
                  "page": 1,
                  "limit": 10,
                  "itemId": "item-123",
                  "additionalFilters": "custom filter value"
                },
                "property2": {
                  "page": 1,
                  "limit": 10,
                  "itemId": "item-123",
                  "additionalFilters": "custom filter value"
                }
              },
              "values": {
                "property1": null,
                "property2": null
              },
              "schema": {
                "fields": {
                  "type": "object",
                  "properties": {
                    "property1": {
                      "type": "number",
                      "subtype": "number",
                      "minimum": 0.1,
                      "maximum": 0.1,
                      "unique": true,
                      "searchable": true,
                      "default": 0,
                      "isConstantField": false
                    },
                    "property2": {
                      "type": "number",
                      "subtype": "number",
                      "minimum": 0.1,
                      "maximum": 0.1,
                      "unique": true,
                      "searchable": true,
                      "default": 0,
                      "isConstantField": false
                    }
                  },
                  "required": [
                    "string"
                  ],
                  "allOf": [
                    {
                      "if": {
                        "required": [
                          "string"
                        ],
                        "properties": {
                          "property1": {
                            "minItems": 0,
                            "maxItems": 0,
                            "uniqueItems": true,
                            "minimum": 0,
                            "maximum": 0,
                            "pattern": "string",
                            "const": null,
                            "enum": [
                              "string"
                            ],
                            "not": {}
                          },
                          "property2": {
                            "minItems": 0,
                            "maxItems": 0,
                            "uniqueItems": true,
                            "minimum": 0,
                            "maximum": 0,
                            "pattern": "string",
                            "const": null,
                            "enum": [
                              "string"
                            ],
                            "not": {}
                          }
                        }
                      },
                      "then": {
                        "required": [
                          "string"
                        ],
                        "properties": {
                          "property1": {
                            "minItems": 0,
                            "maxItems": 0,
                            "uniqueItems": true,
                            "minimum": 0,
                            "maximum": 0,
                            "pattern": "string",
                            "const": null,
                            "enum": [
                              "string"
                            ],
                            "not": {}
                          },
                          "property2": {
                            "minItems": 0,
                            "maxItems": 0,
                            "uniqueItems": true,
                            "minimum": 0,
                            "maximum": 0,
                            "pattern": "string",
                            "const": null,
                            "enum": [
                              "string"
                            ],
                            "not": {}
                          }
                        }
                      },
                      "else": {
                        "required": [
                          "string"
                        ],
                        "properties": {
                          "property1": {
                            "minItems": 0,
                            "maxItems": 0,
                            "uniqueItems": true,
                            "minimum": 0,
                            "maximum": 0,
                            "pattern": "string",
                            "const": null,
                            "enum": [
                              "string"
                            ],
                            "not": {}
                          },
                          "property2": {
                            "minItems": 0,
                            "maxItems": 0,
                            "uniqueItems": true,
                            "minimum": 0,
                            "maximum": 0,
                            "pattern": "string",
                            "const": null,
                            "enum": [
                              "string"
                            ],
                            "not": {}
                          }
                        }
                      }
                    }
                  ],
                  "additionalProperties": true
                },
                "audience": {
                  "targetType": "SEGMENT",
                  "segments": [
                    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
                  ],
                  "query": "{\\\"analysis\\\":{\\\"title\\\":\\\"notempty\\\",\\\"segments\\\":[{\\\"title\\\":\\\"notempty\\\",\\\"filter\\\":{\\\"matching\\\":true,\\\"expressions\\\":[{\\\"type\\\":\\\"ATTRIBUTE\\\",\\\"attribute\\\":{\\\"expressions\\\":[{\\\"constraint\\\":{\\\"type\\\":\\\"BOOL\\\",\\\"logic\\\":\\\"IS_TRUE\\\"},\\\"attribute\\\":{\\\"type\\\":\\\"PARAM\\\",\\\"param\\\":\\\"exampleBool\\\"}}]}}]}}]}}"
                },
                "schemaType": "SIMPLE"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/brickworks/v1/schemas/records/preview");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/brickworks/v1/schemas/records/preview",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              context: {property1: null, property2: null},
              fieldContext: {
                property1: {
                  page: 1,
                  limit: 10,
                  itemId: 'item-123',
                  additionalFilters: 'custom filter value'
                },
                property2: {
                  page: 1,
                  limit: 10,
                  itemId: 'item-123',
                  additionalFilters: 'custom filter value'
                }
              },
              values: {property1: null, property2: null},
              schema: {
                fields: {
                  type: 'object',
                  properties: {
                    property1: {
                      type: 'number',
                      subtype: 'number',
                      minimum: 0.1,
                      maximum: 0.1,
                      unique: true,
                      searchable: true,
                      default: 0,
                      isConstantField: false
                    },
                    property2: {
                      type: 'number',
                      subtype: 'number',
                      minimum: 0.1,
                      maximum: 0.1,
                      unique: true,
                      searchable: true,
                      default: 0,
                      isConstantField: false
                    }
                  },
                  required: ['string'],
                  allOf: [
                    {
                      if: {
                        required: ['string'],
                        properties: {
                          property1: {
                            minItems: 0,
                            maxItems: 0,
                            uniqueItems: true,
                            minimum: 0,
                            maximum: 0,
                            pattern: 'string',
                            const: null,
                            enum: ['string'],
                            not: {}
                          },
                          property2: {
                            minItems: 0,
                            maxItems: 0,
                            uniqueItems: true,
                            minimum: 0,
                            maximum: 0,
                            pattern: 'string',
                            const: null,
                            enum: ['string'],
                            not: {}
                          }
                        }
                      },
                      then: {
                        required: ['string'],
                        properties: {
                          property1: {
                            minItems: 0,
                            maxItems: 0,
                            uniqueItems: true,
                            minimum: 0,
                            maximum: 0,
                            pattern: 'string',
                            const: null,
                            enum: ['string'],
                            not: {}
                          },
                          property2: {
                            minItems: 0,
                            maxItems: 0,
                            uniqueItems: true,
                            minimum: 0,
                            maximum: 0,
                            pattern: 'string',
                            const: null,
                            enum: ['string'],
                            not: {}
                          }
                        }
                      },
                      else: {
                        required: ['string'],
                        properties: {
                          property1: {
                            minItems: 0,
                            maxItems: 0,
                            uniqueItems: true,
                            minimum: 0,
                            maximum: 0,
                            pattern: 'string',
                            const: null,
                            enum: ['string'],
                            not: {}
                          },
                          property2: {
                            minItems: 0,
                            maxItems: 0,
                            uniqueItems: true,
                            minimum: 0,
                            maximum: 0,
                            pattern: 'string',
                            const: null,
                            enum: ['string'],
                            not: {}
                          }
                        }
                      }
                    }
                  ],
                  additionalProperties: true
                },
                audience: {
                  targetType: 'SEGMENT',
                  segments: ['497f6eca-6276-4993-bfeb-53cbbbba6f08'],
                  query: '{\"analysis\":{\"title\":\"notempty\",\"segments\":[{\"title\":\"notempty\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"exampleBool\"}}]}}]}}]}}'
                },
                schemaType: 'SIMPLE'
              }
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/brickworks/v1/schemas/records/preview');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"context":{"property1":null,"property2":null},"fieldContext":{"property1":{"page":1,"limit":10,"itemId":"item-123","additionalFilters":"custom filter value"},"property2":{"page":1,"limit":10,"itemId":"item-123","additionalFilters":"custom filter value"}},"values":{"property1":null,"property2":null},"schema":{"fields":{"type":"object","properties":{"property1":{"type":"number","subtype":"number","minimum":0.1,"maximum":0.1,"unique":true,"searchable":true,"default":0,"isConstantField":false},"property2":{"type":"number","subtype":"number","minimum":0.1,"maximum":0.1,"unique":true,"searchable":true,"default":0,"isConstantField":false}},"required":["string"],"allOf":[{"if":{"required":["string"],"properties":{"property1":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}},"property2":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}}}},"then":{"required":["string"],"properties":{"property1":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}},"property2":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}}}},"else":{"required":["string"],"properties":{"property1":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}},"property2":{"minItems":0,"maxItems":0,"uniqueItems":true,"minimum":0,"maximum":0,"pattern":"string","const":null,"enum":["string"],"not":{}}}}}],"additionalProperties":true},"audience":{"targetType":"SEGMENT","segments":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"query":"{\\\\\\"analysis\\\\\\":{\\\\\\"title\\\\\\":\\\\\\"notempty\\\\\\",\\\\\\"segments\\\\\\":[{\\\\\\"title\\\\\\":\\\\\\"notempty\\\\\\",\\\\\\"filter\\\\\\":{\\\\\\"matching\\\\\\":true,\\\\\\"expressions\\\\\\":[{\\\\\\"type\\\\\\":\\\\\\"ATTRIBUTE\\\\\\",\\\\\\"attribute\\\\\\":{\\\\\\"expressions\\\\\\":[{\\\\\\"constraint\\\\\\":{\\\\\\"type\\\\\\":\\\\\\"BOOL\\\\\\",\\\\\\"logic\\\\\\":\\\\\\"IS_TRUE\\\\\\"},\\\\\\"attribute\\\\\\":{\\\\\\"type\\\\\\":\\\\\\"PARAM\\\\\\",\\\\\\"param\\\\\\":\\\\\\"exampleBool\\\\\\"}}]}}]}}]}}"},"schemaType":"SIMPLE"}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/brickworks/v1/schemas/records/preview")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"context\":{\"property1\":null,\"property2\":null},\"fieldContext\":{\"property1\":{\"page\":1,\"limit\":10,\"itemId\":\"item-123\",\"additionalFilters\":\"custom filter value\"},\"property2\":{\"page\":1,\"limit\":10,\"itemId\":\"item-123\",\"additionalFilters\":\"custom filter value\"}},\"values\":{\"property1\":null,\"property2\":null},\"schema\":{\"fields\":{\"type\":\"object\",\"properties\":{\"property1\":{\"type\":\"number\",\"subtype\":\"number\",\"minimum\":0.1,\"maximum\":0.1,\"unique\":true,\"searchable\":true,\"default\":0,\"isConstantField\":false},\"property2\":{\"type\":\"number\",\"subtype\":\"number\",\"minimum\":0.1,\"maximum\":0.1,\"unique\":true,\"searchable\":true,\"default\":0,\"isConstantField\":false}},\"required\":[\"string\"],\"allOf\":[{\"if\":{\"required\":[\"string\"],\"properties\":{\"property1\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}},\"property2\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}}}},\"then\":{\"required\":[\"string\"],\"properties\":{\"property1\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}},\"property2\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}}}},\"else\":{\"required\":[\"string\"],\"properties\":{\"property1\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}},\"property2\":{\"minItems\":0,\"maxItems\":0,\"uniqueItems\":true,\"minimum\":0,\"maximum\":0,\"pattern\":\"string\",\"const\":null,\"enum\":[\"string\"],\"not\":{}}}}}],\"additionalProperties\":true},\"audience\":{\"targetType\":\"SEGMENT\",\"segments\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"query\":\"{\\\\\\\"analysis\\\\\\\":{\\\\\\\"title\\\\\\\":\\\\\\\"notempty\\\\\\\",\\\\\\\"segments\\\\\\\":[{\\\\\\\"title\\\\\\\":\\\\\\\"notempty\\\\\\\",\\\\\\\"filter\\\\\\\":{\\\\\\\"matching\\\\\\\":true,\\\\\\\"expressions\\\\\\\":[{\\\\\\\"type\\\\\\\":\\\\\\\"ATTRIBUTE\\\\\\\",\\\\\\\"attribute\\\\\\\":{\\\\\\\"expressions\\\\\\\":[{\\\\\\\"constraint\\\\\\\":{\\\\\\\"type\\\\\\\":\\\\\\\"BOOL\\\\\\\",\\\\\\\"logic\\\\\\\":\\\\\\\"IS_TRUE\\\\\\\"},\\\\\\\"attribute\\\\\\\":{\\\\\\\"type\\\\\\\":\\\\\\\"PARAM\\\\\\\",\\\\\\\"param\\\\\\\":\\\\\\\"exampleBool\\\\\\\"}}]}}]}}]}}\"},\"schemaType\":\"SIMPLE\"}}")
              .asString();
  /brickworks/v1/external-sources:
    get:
      tags:
        - "Brickworks: External sources"
      summary: List external sources
      description: |
        Retrieve a list of external data sources. You can sort and paginate the results.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_EXTERNALSOURCES_READ`

        **User role permission required:** `assets_brickworks: read`
      operationId: listExternalSource
      parameters:
        - $ref: "#/components/parameters/brickworks-service-queryLimit"
        - $ref: "#/components/parameters/brickworks-service-queryPage"
        - $ref: "#/components/parameters/brickworks-service-querySearch"
        - in: query
          name: sortBy
          required: false
          description: |
            You can sort by:
            - `createdAt`
            - `updatedAt`
            - `name`
          schema:
            type: string
            example: createdAt:asc|desc
        - $ref: "#/components/parameters/brickworks-service-methodQueryParam"
      security:
        - JWT: []
      responses:
        "200":
          description: A page of external data sources
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/brickworks-service-ExternalSourcePagingResult"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-External-sources/operation/listExternalSource
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/brickworks/v1/external-sources?limit=SOME_INTEGER_VALUE&page=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=createdAt%3Aasc%7Cdesc&method=SOME_STRING_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/brickworks/v1/external-sources?limit=SOME_INTEGER_VALUE&page=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=createdAt%3Aasc%7Cdesc&method=SOME_STRING_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/brickworks/v1/external-sources?limit=SOME_INTEGER_VALUE&page=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=createdAt%3Aasc%7Cdesc&method=SOME_STRING_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/brickworks/v1/external-sources?limit=SOME_INTEGER_VALUE&page=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=createdAt%3Aasc%7Cdesc&method=SOME_STRING_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/brickworks/v1/external-sources');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'limit' => 'SOME_INTEGER_VALUE',
              'page' => 'SOME_INTEGER_VALUE',
              'search' => 'SOME_STRING_VALUE',
              'sortBy' => 'createdAt:asc|desc',
              'method' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/brickworks/v1/external-sources?limit=SOME_INTEGER_VALUE&page=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=createdAt%3Aasc%7Cdesc&method=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      tags:
        - "Brickworks: External sources"
      summary: Create external source
      description: |
        Create an external data source definition. External sources can be used as a special schema field to retrieve data from a given URL when generating an object from a record.

        Before starting, make sure you have a [connection](https://hub.synerise.com/docs/settings/tool/connections/) which you can use in the external source definition.


        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_EXTERNALSOURCES_CREATE`

        **User role permission required:** `assets_brickworks: create`
      operationId: createExternalSource
      security:
        - JWT: []
      requestBody:
        description: External data source definition
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/brickworks-service-CreateExternalSourceRequest"
      responses:
        "200":
          description: External Data Source created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/brickworks-service-ExternalSourceModel"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-External-sources/operation/createExternalSource
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/brickworks/v1/external-sources \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"name":"string","description":"string","properties":{"sourceType":"http_source","url":"https://example.com/clients/{% customer email %}","method":"post","headers":{"property1":"string","property2":"string"},"params":{"property1":"string","property2":"string"},"authType":"basic","authId":"25d4321e-f980-49d3-983b-4275c49dc2c4","body":{"someString":"string","someObject":{"key":"{% customer email %}"},"dynamicField":"{% customer id %}"},"bodySchema":{"type":"object","subtype":"key_value","properties":{"someObject":{"type":"object","subtype":"key_value","properties":{"key":{"type":"string","subtype":"jinjava"}},"additionalProperties":true},"dynamicField":{"type":"string","subtype":"jinjava"}},"additionalProperties":true}},"ttl":0}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"name\":\"string\",\"description\":\"string\",\"properties\":{\"sourceType\":\"http_source\",\"url\":\"https://example.com/clients/{% customer email %}\",\"method\":\"post\",\"headers\":{\"property1\":\"string\",\"property2\":\"string\"},\"params\":{\"property1\":\"string\",\"property2\":\"string\"},\"authType\":\"basic\",\"authId\":\"25d4321e-f980-49d3-983b-4275c49dc2c4\",\"body\":{\"someString\":\"string\",\"someObject\":{\"key\":\"{% customer email %}\"},\"dynamicField\":\"{% customer id %}\"},\"bodySchema\":{\"type\":\"object\",\"subtype\":\"key_value\",\"properties\":{\"someObject\":{\"type\":\"object\",\"subtype\":\"key_value\",\"properties\":{\"key\":{\"type\":\"string\",\"subtype\":\"jinjava\"}},\"additionalProperties\":true},\"dynamicField\":{\"type\":\"string\",\"subtype\":\"jinjava\"}},\"additionalProperties\":true}},\"ttl\":0}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/brickworks/v1/external-sources", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "name": "string",
              "description": "string",
              "properties": {
                "sourceType": "http_source",
                "url": "https://example.com/clients/{% customer email %}",
                "method": "post",
                "headers": {
                  "property1": "string",
                  "property2": "string"
                },
                "params": {
                  "property1": "string",
                  "property2": "string"
                },
                "authType": "basic",
                "authId": "25d4321e-f980-49d3-983b-4275c49dc2c4",
                "body": {
                  "someString": "string",
                  "someObject": {
                    "key": "{% customer email %}"
                  },
                  "dynamicField": "{% customer id %}"
                },
                "bodySchema": {
                  "type": "object",
                  "subtype": "key_value",
                  "properties": {
                    "someObject": {
                      "type": "object",
                      "subtype": "key_value",
                      "properties": {
                        "key": {
                          "type": "string",
                          "subtype": "jinjava"
                        }
                      },
                      "additionalProperties": true
                    },
                    "dynamicField": {
                      "type": "string",
                      "subtype": "jinjava"
                    }
                  },
                  "additionalProperties": true
                }
              },
              "ttl": 0
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/brickworks/v1/external-sources");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/brickworks/v1/external-sources",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              name: 'string',
              description: 'string',
              properties: {
                sourceType: 'http_source',
                url: 'https://example.com/clients/{% customer email %}',
                method: 'post',
                headers: {property1: 'string', property2: 'string'},
                params: {property1: 'string', property2: 'string'},
                authType: 'basic',
                authId: '25d4321e-f980-49d3-983b-4275c49dc2c4',
                body: {
                  someString: 'string',
                  someObject: {key: '{% customer email %}'},
                  dynamicField: '{% customer id %}'
                },
                bodySchema: {
                  type: 'object',
                  subtype: 'key_value',
                  properties: {
                    someObject: {
                      type: 'object',
                      subtype: 'key_value',
                      properties: {key: {type: 'string', subtype: 'jinjava'}},
                      additionalProperties: true
                    },
                    dynamicField: {type: 'string', subtype: 'jinjava'}
                  },
                  additionalProperties: true
                }
              },
              ttl: 0
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/brickworks/v1/external-sources');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"name":"string","description":"string","properties":{"sourceType":"http_source","url":"https://example.com/clients/{% customer email %}","method":"post","headers":{"property1":"string","property2":"string"},"params":{"property1":"string","property2":"string"},"authType":"basic","authId":"25d4321e-f980-49d3-983b-4275c49dc2c4","body":{"someString":"string","someObject":{"key":"{% customer email %}"},"dynamicField":"{% customer id %}"},"bodySchema":{"type":"object","subtype":"key_value","properties":{"someObject":{"type":"object","subtype":"key_value","properties":{"key":{"type":"string","subtype":"jinjava"}},"additionalProperties":true},"dynamicField":{"type":"string","subtype":"jinjava"}},"additionalProperties":true}},"ttl":0}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/brickworks/v1/external-sources")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"name\":\"string\",\"description\":\"string\",\"properties\":{\"sourceType\":\"http_source\",\"url\":\"https://example.com/clients/{% customer email %}\",\"method\":\"post\",\"headers\":{\"property1\":\"string\",\"property2\":\"string\"},\"params\":{\"property1\":\"string\",\"property2\":\"string\"},\"authType\":\"basic\",\"authId\":\"25d4321e-f980-49d3-983b-4275c49dc2c4\",\"body\":{\"someString\":\"string\",\"someObject\":{\"key\":\"{% customer email %}\"},\"dynamicField\":\"{% customer id %}\"},\"bodySchema\":{\"type\":\"object\",\"subtype\":\"key_value\",\"properties\":{\"someObject\":{\"type\":\"object\",\"subtype\":\"key_value\",\"properties\":{\"key\":{\"type\":\"string\",\"subtype\":\"jinjava\"}},\"additionalProperties\":true},\"dynamicField\":{\"type\":\"string\",\"subtype\":\"jinjava\"}},\"additionalProperties\":true}},\"ttl\":0}")
              .asString();
  /brickworks/v1/external-sources/{ExternalDataSourceId}:
    get:
      tags:
        - "Brickworks: External sources"
      summary: Get External Source
      description: |
        Retrieve the details of an external data source.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_EXTERNALSOURCES_READ`

        **User role permission required:** `assets_brickworks: read`
      operationId: getExternalSourceById
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathExternalDataSourceId"
      responses:
        "200":
          description: Details of the external source
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/brickworks-service-ExternalSourceModel"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-External-sources/operation/getExternalSourceById
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.synerise.com/brickworks/v1/external-sources/%7BExternalDataSourceId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/brickworks/v1/external-sources/%7BExternalDataSourceId%7D", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/brickworks/v1/external-sources/%7BExternalDataSourceId%7D");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/brickworks/v1/external-sources/%7BExternalDataSourceId%7D",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/brickworks/v1/external-sources/%7BExternalDataSourceId%7D');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/brickworks/v1/external-sources/%7BExternalDataSourceId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    put:
      tags:
        - "Brickworks: External sources"
      summary: Update External Source
      description: |
        Update an external data source definition.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_EXTERNALSOURCES_UPDATE`

        **User role permission required:** `assets_brickworks: update`
      operationId: updateExternalSource
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathExternalDataSourceId"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/brickworks-service-UpdateExternalSourceRequest"
      responses:
        "200":
          description: External Source updated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/brickworks-service-ExternalSourceModel"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-External-sources/operation/updateExternalSource
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request PUT \
              --url https://api.synerise.com/brickworks/v1/external-sources/%7BExternalDataSourceId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"name":"string","description":"string","properties":{"sourceType":"http_source","url":"https://example.com/clients/{% customer email %}","method":"post","headers":{"property1":"string","property2":"string"},"params":{"property1":"string","property2":"string"},"authType":"basic","authId":"25d4321e-f980-49d3-983b-4275c49dc2c4","body":{"someString":"string","someObject":{"key":"{% customer email %}"},"dynamicField":"{% customer id %}"},"bodySchema":{"type":"object","subtype":"key_value","properties":{"someObject":{"type":"object","subtype":"key_value","properties":{"key":{"type":"string","subtype":"jinjava"}},"additionalProperties":true},"dynamicField":{"type":"string","subtype":"jinjava"}},"additionalProperties":true}},"ttl":0}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"name\":\"string\",\"description\":\"string\",\"properties\":{\"sourceType\":\"http_source\",\"url\":\"https://example.com/clients/{% customer email %}\",\"method\":\"post\",\"headers\":{\"property1\":\"string\",\"property2\":\"string\"},\"params\":{\"property1\":\"string\",\"property2\":\"string\"},\"authType\":\"basic\",\"authId\":\"25d4321e-f980-49d3-983b-4275c49dc2c4\",\"body\":{\"someString\":\"string\",\"someObject\":{\"key\":\"{% customer email %}\"},\"dynamicField\":\"{% customer id %}\"},\"bodySchema\":{\"type\":\"object\",\"subtype\":\"key_value\",\"properties\":{\"someObject\":{\"type\":\"object\",\"subtype\":\"key_value\",\"properties\":{\"key\":{\"type\":\"string\",\"subtype\":\"jinjava\"}},\"additionalProperties\":true},\"dynamicField\":{\"type\":\"string\",\"subtype\":\"jinjava\"}},\"additionalProperties\":true}},\"ttl\":0}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("PUT", "/brickworks/v1/external-sources/%7BExternalDataSourceId%7D", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "name": "string",
              "description": "string",
              "properties": {
                "sourceType": "http_source",
                "url": "https://example.com/clients/{% customer email %}",
                "method": "post",
                "headers": {
                  "property1": "string",
                  "property2": "string"
                },
                "params": {
                  "property1": "string",
                  "property2": "string"
                },
                "authType": "basic",
                "authId": "25d4321e-f980-49d3-983b-4275c49dc2c4",
                "body": {
                  "someString": "string",
                  "someObject": {
                    "key": "{% customer email %}"
                  },
                  "dynamicField": "{% customer id %}"
                },
                "bodySchema": {
                  "type": "object",
                  "subtype": "key_value",
                  "properties": {
                    "someObject": {
                      "type": "object",
                      "subtype": "key_value",
                      "properties": {
                        "key": {
                          "type": "string",
                          "subtype": "jinjava"
                        }
                      },
                      "additionalProperties": true
                    },
                    "dynamicField": {
                      "type": "string",
                      "subtype": "jinjava"
                    }
                  },
                  "additionalProperties": true
                }
              },
              "ttl": 0
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://api.synerise.com/brickworks/v1/external-sources/%7BExternalDataSourceId%7D");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/brickworks/v1/external-sources/%7BExternalDataSourceId%7D",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              name: 'string',
              description: 'string',
              properties: {
                sourceType: 'http_source',
                url: 'https://example.com/clients/{% customer email %}',
                method: 'post',
                headers: {property1: 'string', property2: 'string'},
                params: {property1: 'string', property2: 'string'},
                authType: 'basic',
                authId: '25d4321e-f980-49d3-983b-4275c49dc2c4',
                body: {
                  someString: 'string',
                  someObject: {key: '{% customer email %}'},
                  dynamicField: '{% customer id %}'
                },
                bodySchema: {
                  type: 'object',
                  subtype: 'key_value',
                  properties: {
                    someObject: {
                      type: 'object',
                      subtype: 'key_value',
                      properties: {key: {type: 'string', subtype: 'jinjava'}},
                      additionalProperties: true
                    },
                    dynamicField: {type: 'string', subtype: 'jinjava'}
                  },
                  additionalProperties: true
                }
              },
              ttl: 0
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/brickworks/v1/external-sources/%7BExternalDataSourceId%7D');
            $request->setMethod(HTTP_METH_PUT);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"name":"string","description":"string","properties":{"sourceType":"http_source","url":"https://example.com/clients/{% customer email %}","method":"post","headers":{"property1":"string","property2":"string"},"params":{"property1":"string","property2":"string"},"authType":"basic","authId":"25d4321e-f980-49d3-983b-4275c49dc2c4","body":{"someString":"string","someObject":{"key":"{% customer email %}"},"dynamicField":"{% customer id %}"},"bodySchema":{"type":"object","subtype":"key_value","properties":{"someObject":{"type":"object","subtype":"key_value","properties":{"key":{"type":"string","subtype":"jinjava"}},"additionalProperties":true},"dynamicField":{"type":"string","subtype":"jinjava"}},"additionalProperties":true}},"ttl":0}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.put("https://api.synerise.com/brickworks/v1/external-sources/%7BExternalDataSourceId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"name\":\"string\",\"description\":\"string\",\"properties\":{\"sourceType\":\"http_source\",\"url\":\"https://example.com/clients/{% customer email %}\",\"method\":\"post\",\"headers\":{\"property1\":\"string\",\"property2\":\"string\"},\"params\":{\"property1\":\"string\",\"property2\":\"string\"},\"authType\":\"basic\",\"authId\":\"25d4321e-f980-49d3-983b-4275c49dc2c4\",\"body\":{\"someString\":\"string\",\"someObject\":{\"key\":\"{% customer email %}\"},\"dynamicField\":\"{% customer id %}\"},\"bodySchema\":{\"type\":\"object\",\"subtype\":\"key_value\",\"properties\":{\"someObject\":{\"type\":\"object\",\"subtype\":\"key_value\",\"properties\":{\"key\":{\"type\":\"string\",\"subtype\":\"jinjava\"}},\"additionalProperties\":true},\"dynamicField\":{\"type\":\"string\",\"subtype\":\"jinjava\"}},\"additionalProperties\":true}},\"ttl\":0}")
              .asString();
    delete:
      tags:
        - "Brickworks: External sources"
      summary: Delete external source
      description: |
        Permanently delete an external data source definition.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_EXTERNALSOURCES_DELETE`

        **User role permission required:** `assets_brickworks: delete`
      operationId: deleteExternalSource
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathExternalDataSourceId"
      responses:
        "204":
          description: No content
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-External-sources/operation/deleteExternalSource
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request DELETE \
              --url https://api.synerise.com/brickworks/v1/external-sources/%7BExternalDataSourceId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("DELETE", "/brickworks/v1/external-sources/%7BExternalDataSourceId%7D", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("DELETE", "https://api.synerise.com/brickworks/v1/external-sources/%7BExternalDataSourceId%7D");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/brickworks/v1/external-sources/%7BExternalDataSourceId%7D",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/brickworks/v1/external-sources/%7BExternalDataSourceId%7D');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.delete("https://api.synerise.com/brickworks/v1/external-sources/%7BExternalDataSourceId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /brickworks/v1/schemas/{SchemaIdentifier}/records/{RecordIdentifier}/duplicate:
    post:
      tags:
        - "Brickworks: Records"
      summary: Duplicate record
      description: |
        Create a copy of a record. The name of the copy is `{recordName} - copy`

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_RECORDS_CREATE`

        **User role permission required:** `assets_brickworks: create`
      operationId: duplicateRecordBySchemaAppIdAndRecordId
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathSchemaIdentifier"
        - $ref: "#/components/parameters/brickworks-service-pathRecordIdentifier"
      responses:
        "200":
          description: Data of the created record
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/brickworks-service-Record"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Records/operation/duplicateRecordBySchemaAppIdAndRecordId
  /brickworks/v1/schemas/{SchemaIdentifier}/records/{RecordIdentifier}/versions:
    get:
      tags:
        - "Brickworks: Record versions"
      summary: Get record versions
      description: |
        Retrieve all versions of a record. You can paginate, sort, and refine the results. By default, the versions are sorted from newest to oldest.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_RECORDS_READ`

        **User role permission required:** `assets_brickworks: read`
      operationId: getRecordVersions
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathSchemaIdentifier"
        - $ref: "#/components/parameters/brickworks-service-pathRecordIdentifier"
        - $ref: "#/components/parameters/brickworks-service-queryLimit"
        - $ref: "#/components/parameters/brickworks-service-queryPage"
        - $ref: "#/components/parameters/brickworks-service-queryRecordFilters"
        - $ref: "#/components/parameters/brickworks-service-querySortBy"
        - $ref: "#/components/parameters/brickworks-service-queryStatuses"
      responses:
        "200":
          description: A page of record versions
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/brickworks-service-RecordVersionPagingResult"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Record-versions/operation/getRecordVersions
  /brickworks/v1/schemas/{SchemaIdentifier}/records/{RecordIdentifier}/versions/{RecordVersionIdentifier}:
    get:
      tags:
        - "Brickworks: Record versions"
      summary: Get record version
      description: |
        Retrieve the details of a record version. The version can be identified by either a UUID (RecordVersionId) or a version number (integer).

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_RECORDS_READ`

        **User role permission required:** `assets_brickworks: read`
      operationId: getRecordVersion
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathSchemaIdentifier"
        - $ref: "#/components/parameters/brickworks-service-pathRecordIdentifier"
        - $ref: "#/components/parameters/brickworks-service-pathRecordVersionIdentifier"
      responses:
        "200":
          description: Record version object
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/brickworks-service-RecordVersion"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Record-versions/operation/getRecordVersion
  /brickworks/v1/async/schemas/{SchemaIdentifier}/records:
    post:
      tags:
        - "Brickworks: Records"
      summary: Batch create or update records (async)
      description: |
        This endpoint can only be used for simple schemas.

        - If a record included in this request already exists, it's entirely overwritten by the content from the request (including the slug - if the slug isn't sent, it's removed).
        - Provide the current identifier value (if your request changes the identifier, provide the one from before the change).
        - The record must conform with the schema.

        Asynchronous requests are processed according to the time they reach the service.  
        This means that requests to synchronous endpoints may overwrite asynchronous operations which were sent earlier and queued due to high traffic.

        In some edge cases, changing a record may fail further in the backend, even when this endpoint returns no errors. In such cases, contact Support.


        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_RECORDS_CREATE`

        **User role permission required:** `assets_brickworks: create`
      operationId: createOrUpdateRecordBatchAsync
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathSchemaIdentifier"
      requestBody:
        description: Record data
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: "#/components/schemas/brickworks-service-AsyncRecordRequest"
      responses:
        "201":
          description: Operation added to queue
        "207":
          $ref: "#/components/responses/brickworks-service-207Response"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Records/operation/createOrUpdateRecordBatchAsync
    patch:
      tags:
        - "Brickworks: Records"
      summary: Batch create or partially update record (async)
      description: |
        This endpoint can only be used for simple schemas.

        Asynchronous requests are processed according to the time they reach the service.  
        This means that requests to synchronous endpoints may overwrite asynchronous operations which were sent earlier and queued due to high traffic.

        In some edge cases, changing a record may fail further in the backend, even when this endpoint returns no errors. In such cases, contact Support.


        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_RECORDS_CREATE`

        **User role permission required:** `assets_brickworks: create`
      operationId: createOrPartialUpdateRecordBatchAsync
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathSchemaIdentifier"
      requestBody:
        description: Record data
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: "#/components/schemas/brickworks-service-AsyncRecordRequest"
      responses:
        "201":
          description: Operation added to queue
        "207":
          $ref: "#/components/responses/brickworks-service-207Response"
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Records/operation/createOrPartialUpdateRecordBatchAsync
  /brickworks/v1/async/schemas/{SchemaIdentifier}/record:
    post:
      tags:
        - "Brickworks: Records"
      summary: Create or update record (async)
      description: |
        This endpoint can only be used for simple schemas.

        - If a record included in this request already exists, it's entirely overwritten by the content from the request (including the slug - if the slug isn't sent, it's removed).
        - Provide the current identifier value (if your request changes the identifier, provide the one from before the change).
        - The record must conform with the schema.

        Asynchronous requests are processed according to the time they reach the service.  
        This means that requests to synchronous endpoints may overwrite asynchronous operations which were sent earlier and queued due to high traffic.

        In some edge cases, changing a record may fail further in the backend, even when this endpoint returns no errors. In such cases, contact Support.


        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_RECORDS_CREATE`

        **User role permission required:** `assets_brickworks: create`
      operationId: createOrUpdateRecordSingleAsync
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathSchemaIdentifier"
      requestBody:
        description: Record data
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/brickworks-service-AsyncRecordRequest"
      responses:
        "201":
          description: Operation added to queue
          content: {}
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Records/operation/createOrUpdateRecordSingleAsync
    patch:
      tags:
        - "Brickworks: Records"
      summary: Create or partially update record (async)
      description: |
        This endpoint can only be used for simple schemas.

        - You can use this endpoint to update a record by sending only the fields which you want to change. Other fields are not affected.
        - This endpoint doesn't validate the data against field-specific settings, such as limits on character count or regex in a string field.

        Asynchronous requests are processed according to the time they reach the service.  
        This means that requests to synchronous endpoints may overwrite asynchronous operations which were sent earlier and queued due to high traffic.

        In some edge cases, changing a record may fail further in the backend, even when this endpoint returns no errors. In such cases, contact Support.


        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `BRICKWORKS_RECORDS_CREATE`

        **User role permission required:** `assets_brickworks: create`
      operationId: createOrPartialUpdateRecordSingleAsync
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/brickworks-service-pathSchemaIdentifier"
      requestBody:
        description: Record data
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/brickworks-service-AsyncRecordRequest"
      responses:
        "201":
          description: Operation added to queue
        "400":
          $ref: "#/components/responses/brickworks-service-GenericBadRequestError"
        "401":
          $ref: "#/components/responses/brickworks-service-GenericUnauthorizedError"
        "403":
          $ref: "#/components/responses/brickworks-service-GenericForbiddenError"
        "404":
          $ref: "#/components/responses/brickworks-service-GenericNotFoundError"
        "409":
          $ref: "#/components/responses/brickworks-service-GenericConflictError"
        "422":
          $ref: "#/components/responses/brickworks-service-GenericUnprocessableContentError"
        "500":
          $ref: "#/components/responses/brickworks-service-GenericError"
      x-snr-doc-urls:
        - /api-reference/brickworks#tag/Brickworks:-Records/operation/createOrPartialUpdateRecordSingleAsync
components:
  securitySchemes:
    JWT:
      type: http
      scheme: bearer
      description: |-
        JWT Bearer token. The header looks like this: `Bearer {JWT}`

        Remember to include the space between 'Bearer' and the token.

        Generate a token via the **Authorization** endpoints.
    TrackerKey:
      type: apiKey
      name: token
      in: query
      description: Authorization by tracker key sent as a query parameter. This is the same key as used in the website tracking code.
  schemas:
    brickworks-service-ObjectsError:
      type: object
      x-class-name: ObjectsError
      x-interface-name-ts: ObjectsError
      required:
        - httpStatus
        - errorCode
        - timestamp
        - message
      properties:
        timestamp:
          type: string
          format: date-time
          description: Time when the error occurred
        errorCode:
          type: string
          description: |
            Code of the error, needed for troubleshooting

            See error reference: [https://developers.synerise.com/errors.html](https://developers.synerise.com/errors.html)
        httpStatus:
          type: integer
          description: Error's HTTP status code
        message:
          type: string
          description: Description of the problem
        traceId:
          type: string
          description: Unique identifier of the request, useful for tracing logs
        errors:
          type: array
          items:
            $ref: "#/components/schemas/brickworks-service-ObjectsError"
        source:
          type: object
          x-class-name: ObjectErrorSource
          x-interface-name-ts: ObjectErrorSource
          required:
            - pointer
          properties:
            pointer:
              type: string
              description: JSON Pointer for invalid body path
            value:
              type: string
              description: Value that caused the validation error
        details:
          type: object
          x-class-name: ObjectsErrorDetails
          x-interface-name-ts: ObjectsErrorDetails
          additionalProperties:
            type: object
          description: Additional structured error information
        field:
          type: string
          description: Name of the field that caused the error
    brickworks-service-GatewayError:
      type: object
      x-class-name: GatewayError
      x-interface-name-ts: GatewayError
      properties:
        error:
          type: string
          description: Summary of the error
        status:
          type: integer
          format: int32
          description: Status code
        timestamp:
          type: string
          description: Time when the message was sent
        message:
          type: string
          description: Description of the problem
    brickworks-service-SchemaPagingResult:
      type: object
      x-class-name: SchemaPagingResult
      x-interface-name-ts: SchemaPagingResult
      required:
        - meta
        - data
      properties:
        meta:
          $ref: "#/components/schemas/brickworks-service-Meta"
        data:
          type: array
          description: Array of schemas
          items:
            $ref: "#/components/schemas/brickworks-service-Schema"
    brickworks-service-Schema:
      type: object
      x-class-name: Schema
      x-interface-name-ts: Schema
      description: Schema object
      required:
        - id
        - appId
        - displayName
        - createdBy
        - updatedBy
        - createdAt
        - updatedAt
        - audience
      properties:
        id:
          $ref: "#/components/schemas/brickworks-service-SchemaId"
        appId:
          $ref: "#/components/schemas/brickworks-service-SchemaAppId"
        displayName:
          $ref: "#/components/schemas/brickworks-service-SchemaDisplayName"
        description:
          $ref: "#/components/schemas/brickworks-service-SchemaDescription"
        fields:
          $ref: "#/components/schemas/brickworks-service-FieldsObject"
        displayConfiguration:
          $ref: "#/components/schemas/brickworks-service-SchemaDisplayConfiguration"
        createdBy:
          $ref: "#/components/schemas/brickworks-service-CreatedBy"
        updatedBy:
          $ref: "#/components/schemas/brickworks-service-UpdatedBy"
        publishedBy:
          $ref: "#/components/schemas/brickworks-service-PublishedBy"
        deletedBy:
          $ref: "#/components/schemas/brickworks-service-DeletedBy"
        createdAt:
          $ref: "#/components/schemas/brickworks-service-CreatedAt"
        updatedAt:
          $ref: "#/components/schemas/brickworks-service-UpdatedAt"
        publishedAt:
          $ref: "#/components/schemas/brickworks-service-PublishedAt"
        deletedAt:
          $ref: "#/components/schemas/brickworks-service-DeletedAt"
        version:
          $ref: "#/components/schemas/brickworks-service-SchemaVersion"
        audience:
          $ref: "#/components/schemas/brickworks-service-Audience"
        schemaType:
          $ref: "#/components/schemas/brickworks-service-SchemaType"
        fieldContextConfig:
          $ref: "#/components/schemas/brickworks-service-FieldContextConfig"
    brickworks-service-FieldContextConfig:
      type: object
      x-class-name: FieldContextConfig
      x-interface-name-ts: FieldContextConfig
      required:
        - fields
      properties:
        fields:
          type: array
          items:
            $ref: "#/components/schemas/brickworks-service-FieldContextConfigField"
    brickworks-service-FieldContextConfigField:
      type: object
      x-class-name: FieldContextConfigField
      x-interface-name-ts: FieldContextConfigField
      required:
        - fieldName
        - descriptors
      properties:
        fieldName:
          type: string
        descriptors:
          type: array
          items:
            $ref: "#/components/schemas/brickworks-service-FieldContextDescriptor"
    brickworks-service-FieldContextDescriptor:
      type: object
      x-class-name: FieldContextDescriptor
      x-interface-name-ts: FieldContextDescriptor
      required:
        - name
        - type
      properties:
        name:
          type: string
        type:
          x-class-name: FieldContextDescriptorType
          type: string
          enum:
            - string
            - integer
            - number
            - boolean
            - unknown
    brickworks-service-SchemaType:
      type: string
      x-class-name: SchemaType
      x-interface-name-ts: SchemaType
      enum:
        - SIMPLE
        - VERSIONED
        - SINGLETON
      description: |
        - SIMPLE: a schema in which records can only have the PUBLISHED status.
        - VERSIONED: a schema in which records can be saved as drafts; and you can also access the version history.
        - SINGLETON: a schema which has no records. All fields must have default values. Values can still be inserted dynamically with Jinjava.
    brickworks-service-Audience:
      type: object
      x-class-name: Audience
      x-interface-name-ts: Audience
      description: Definition of the profiles which can access content created from this schema.
      properties:
        targetType:
          type: string
          enum:
            - SEGMENT
            - QUERY
            - ALL
          description: |
            - ALL: Available to all profiles
            - SEGMENT: Available to a segmentation or segmentations of profiles, listed in `segments`
            - QUERY: Available to a segmentation of profiles defined with `query`
        segments:
          type: array
          description: Used when `targetType` is `SEGMENT`. This is a list of existing segmentations (identified by UUID) which define the audience.
          items:
            type: string
            format: uuid
            description: Segmentation UUID
        query:
          type: string
          description: Used when `targetType` is `QUERY`. This is a raw `analysis` object sent to the Analytics service, converted into a string. For details on how to create the analysis object, see the [API reference for creating segmentations](https://developers.synerise.com/AnalyticsSuite/AnalyticsSuite.html#tag/Segmentations/operation/analytics2-segmentations-create).
          example: '{\"analysis\":{\"title\":\"notempty\",\"segments\":[{\"title\":\"notempty\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"exampleBool\"}}]}}]}}]}}'
    brickworks-service-SchemaVersion:
      type: integer
      format: int32
      description: Schema version ID. For simple schemas, this is always `1`. When a schema is updated, the ID increases by 1.
    brickworks-service-DeletedAt:
      type: string
      format: date-time
      nullable: true
      description: Time when the resource was deleted
    brickworks-service-PublishedAt:
      type: string
      format: date-time
      nullable: true
      description: Time when the resource was published
    brickworks-service-UpdatedAt:
      type: string
      format: date-time
      description: Time when the resource was last updated
    brickworks-service-CreatedAt:
      type: string
      format: date-time
      description: Time when the resource was created
    brickworks-service-DeletedBy:
      type: integer
      format: int64
      nullable: true
      description: ID of the user who deleted the resource. If deleted by a workspace, the value is `0`.
    brickworks-service-PublishedBy:
      type: integer
      format: int64
      nullable: true
      description: ID of the user who published the resource. If published by a workspace, the value is `0`.
    brickworks-service-UpdatedBy:
      type: integer
      format: int64
      description: ID of the user who last updated the resource. If last updated by a workspace, the value is `0`.
    brickworks-service-CreatedBy:
      type: integer
      format: int64
      description: ID of the user who created the resource. If created by a workspace, the value is `0`.
    brickworks-service-SchemaDisplayConfiguration:
      type: object
      x-class-name: SchemaDisplayConfiguration
      x-interface-name-ts: SchemaDisplayConfiguration
      description: The layout details of the schema
      properties:
        ordering:
          type: object
          description: Order of the fields. If not included, the backend creates the ordering in alphabetical order.
          additionalProperties:
            description: The name of the field is the key in this object and the value is its position in the schema (`0` is displayed first in the Synerise Portal).
            type: integer
            minimum: 0
            format: int32
        metadata:
          type: object
          description: Configuration of displaying the fields in the editor
          additionalProperties:
            $ref: "#/components/schemas/brickworks-service-FieldMetadata"
      required:
        - ordering
        - metadata
    brickworks-service-FieldMetadata:
      type: object
      x-class-name: FieldMetadata
      x-interface-name-ts: FieldMetadata
      description: The object name is the name of a field in the schema
      properties:
        title:
          type: string
          description: Display name of the field, shown in the editor
          default: empty title
        description:
          type: string
          nullable: true
          description: Description of the field, shown in the editor
        useAsRecordName:
          type: boolean
          nullable: true
          default: false
          description: When `true`, the value of this field can be used as the record name. This only happens when the record name is not explicitly defined in its `name` parameter.If multiple fields can be used as the record name, they are checked starting with the highest `ordering` and the first non-empty field is used.
    brickworks-service-FieldsObject:
      type: object
      x-class-name: FieldsObject
      x-interface-name-ts: FieldsObject
      description: The content of the schema.
      properties:
        type:
          type: string
          description: The root field of the schema is always an object, and it includes all the other fields.
          enum:
            - object
        properties:
          $ref: "#/components/schemas/brickworks-service-FieldFormMap"
        required:
          type: array
          description: A list of fields (field key names) that must have a value in the record.
          items:
            type: string
        allOf:
          type: array
          description: |
            
            Additional validation for the fields. To learn more about conditionals, see the [JSON Schema documentation](https://json-schema.org/understanding-json-schema/reference/conditionals#ifthenelse).

            The Synerise Web Portal only supports making a field available and required when another field meets a condition. Using other configurations works in the API, but may cause issues when trying to use the Synerise Web Portal.  

            The following example is a condition supported by the Portal: the `accountNumber` field becomes available (and must be filled) when `paymentType` is `transfer`.
            ```
            "fields": {
                "allOf": [
                    {
                        "if": {
                            "required": [
                                "paymentType"
                            ],
                            "properties": {
                                "paymentType": {
                                    "const": "transfer"
                                }
                            }
                        },
                        "then": {
                            "required": [
                                "accountNumber"
                            ],
                            "properties": {}
                        }
                    }
                ],
            ...
            }
            ```
            For Portal compatibility, you can only change the field condition (`const` in the above example) to a different one. The `pattern` condition and `else` statements are currently not supported by the Portal.  
          items:
            $ref: "#/components/schemas/brickworks-service-ValidationConditions"
        additionalProperties:
          type: boolean
          description: System parameter, generated automatically. Don't send this in requests.
      required:
        - type
        - properties
        - required
    brickworks-service-ValidationConditions:
      type: object
      description: Additional validation for the fields. To learn how to use them, see the [JSON Schema documentation](https://json-schema.org/understanding-json-schema/reference/conditionals#ifthenelse).
      x-class-name: ValidationConditions
      x-interface-name-ts: ValidationConditions
      properties:
        if:
          $ref: "#/components/schemas/brickworks-service-ValidationStatement"
        then:
          $ref: "#/components/schemas/brickworks-service-ValidationStatement"
        else:
          $ref: "#/components/schemas/brickworks-service-ValidationStatement"
      required:
        - if
        - then
    brickworks-service-ValidationStatement:
      type: object
      x-class-name: ValidationStatement
      x-interface-name-ts: ValidationStatement
      properties:
        required:
          type: array
          items:
            type: string
        properties:
          additionalProperties:
            $ref: "#/components/schemas/brickworks-service-FieldCondition"
      required:
        - required
        - properties
    brickworks-service-FieldCondition:
      type: object
      x-class-name: FieldCondition
      x-interface-name-ts: FieldCondition
      properties:
        minItems:
          type: number
          format: int32
        maxItems:
          type: number
          format: int32
        uniqueItems:
          type: boolean
        minimum:
          type: number
          format: int32
        maximum:
          type: number
          format: int32
        pattern:
          type: string
        const:
          title: FieldConditionConstant
          x-class-name: FieldConditionConstant
          x-interface-name-ts: FieldConditionConstant
          nullable: true
        enum:
          type: array
          items:
            type: string
        not:
          $ref: "#/components/schemas/brickworks-service-FieldCondition"
    brickworks-service-FieldFormMap:
      type: object
      x-class-name: FieldFormMap
      x-interface-name-ts: FieldFormMap
      description: Fields in the schema
      additionalProperties:
        $ref: "#/components/schemas/brickworks-service-FieldForm"
      x-typescript-type: "{ [key: string]: FieldForm }"
    brickworks-service-FieldForm:
      type: object
      x-class-name: FieldForm
      x-interface-name-ts: FieldForm
      description: Each key is the name of a field (called "API name" in the Synerise Portal).
      oneOf:
        - $ref: "#/components/schemas/brickworks-service-NumberForm"
        - $ref: "#/components/schemas/brickworks-service-BooleanForm"
        - $ref: "#/components/schemas/brickworks-service-StringForm"
        - $ref: "#/components/schemas/brickworks-service-IntegerForm"
        - $ref: "#/components/schemas/brickworks-service-EnumForm"
        - $ref: "#/components/schemas/brickworks-service-DateForm"
        - $ref: "#/components/schemas/brickworks-service-DateTimeForm"
        - $ref: "#/components/schemas/brickworks-service-ArrayForm"
        - $ref: "#/components/schemas/brickworks-service-UUIDForm"
        - $ref: "#/components/schemas/brickworks-service-JinJavaForm"
        - $ref: "#/components/schemas/brickworks-service-CatalogItemField"
        - $ref: "#/components/schemas/brickworks-service-KeyValueObject"
        - $ref: "#/components/schemas/brickworks-service-ExternalHttpSource"
        - $ref: "#/components/schemas/brickworks-service-ReferenceForm"
        - $ref: "#/components/schemas/brickworks-service-OneToManyForm"
        - $ref: "#/components/schemas/brickworks-service-MetricField"
        - $ref: "#/components/schemas/brickworks-service-AggregateField"
        - $ref: "#/components/schemas/brickworks-service-ExpressionField"
        - $ref: "#/components/schemas/brickworks-service-PromotionField"
        - $ref: "#/components/schemas/brickworks-service-FileField"
        - $ref: "#/components/schemas/brickworks-service-ImageField"
        - $ref: "#/components/schemas/brickworks-service-RecommendationField"
        - $ref: "#/components/schemas/brickworks-service-AiSearchField"
        - $ref: "#/components/schemas/brickworks-service-AiSearchListingField"
        - $ref: "#/components/schemas/brickworks-service-VoucherField"
        - $ref: "#/components/schemas/brickworks-service-UntypedJson"
        - $ref: "#/components/schemas/brickworks-service-UntypedArray"
        - $ref: "#/components/schemas/brickworks-service-UntypedForm"
        - $ref: "#/components/schemas/brickworks-service-ProfileAttributeField"
        - $ref: "#/components/schemas/brickworks-service-OneToManyFilterForm"
      discriminator:
        propertyName: subtype
        mapping:
          boolean: "#/components/schemas/brickworks-service-BooleanForm"
          string: "#/components/schemas/brickworks-service-StringForm"
          integer: "#/components/schemas/brickworks-service-IntegerForm"
          number: "#/components/schemas/brickworks-service-NumberForm"
          enum: "#/components/schemas/brickworks-service-EnumForm"
          date: "#/components/schemas/brickworks-service-DateForm"
          date-time: "#/components/schemas/brickworks-service-DateTimeForm"
          typed_array: "#/components/schemas/brickworks-service-ArrayForm"
          uuid: "#/components/schemas/brickworks-service-UUIDForm"
          jinjava: "#/components/schemas/brickworks-service-JinJavaForm"
          one_to_one: "#/components/schemas/brickworks-service-ReferenceForm"
          catalog_item: "#/components/schemas/brickworks-service-CatalogItemField"
          key_value: "#/components/schemas/brickworks-service-KeyValueObject"
          external_source: "#/components/schemas/brickworks-service-ExternalHttpSource"
          one_to_many: "#/components/schemas/brickworks-service-OneToManyForm"
          metric: "#/components/schemas/brickworks-service-MetricField"
          expression: "#/components/schemas/brickworks-service-ExpressionField"
          aggregate: "#/components/schemas/brickworks-service-AggregateField"
          promotion: "#/components/schemas/brickworks-service-PromotionField"
          file: "#/components/schemas/brickworks-service-FileField"
          image: "#/components/schemas/brickworks-service-ImageField"
          recommendation: "#/components/schemas/brickworks-service-RecommendationField"
          ai_search: "#/components/schemas/brickworks-service-AiSearchField"
          ai_search_listing: "#/components/schemas/brickworks-service-AiSearchListingField"
          voucher: "#/components/schemas/brickworks-service-VoucherField"
          untyped_object: "#/components/schemas/brickworks-service-UntypedJson"
          untyped_array: "#/components/schemas/brickworks-service-UntypedArray"
          json: "#/components/schemas/brickworks-service-UntypedForm"
          client_attribute: "#/components/schemas/brickworks-service-ProfileAttributeField"
          filter: "#/components/schemas/brickworks-service-OneToManyFilterForm"
    brickworks-service-OneToManyFilterForm:
      type: object
      title: Record reference filter
      x-class-name: OneToManyFilterForm
      x-interface-name-ts: OneToManyFilterForm
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-ObjectType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-OneToManyFilterSubtype"
        schemaId:
          $ref: "#/components/schemas/brickworks-service-SchemaId"
        properties:
          $ref: "#/components/schemas/brickworks-service-OneToManyFilterProperties"
        default:
          type: object
          title: One to many filter form default
          description: Default filter settings
          x-class-name: OneToManyFilterFormDefault
          x-interface-name-ts: OneToManyFilterFormDefault
          properties:
            query:
              type: string
              description: RSQL query to filter the records
            sortBy:
              type: string
              description: The property to sort by
              enum:
                - id
                - createdAt
                - updatedAt
            sortDirection:
              type: string
              description: Sorting direction
              enum:
                - asc
                - desc
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
        additionalProperties:
          type: boolean
          description: Field generated automatically, don't send in requests.
      required:
        - type
        - subtype
        - schemaId
        - properties
    brickworks-service-IsConstantField:
      type: boolean
      default: false
      description: |
        When true:
        - you must set a default value.
        - that default value applies to all records and can't be overwritten in record create/update requests.
    brickworks-service-OneToManyFilterProperties:
      type: object
      title: One to many filter properties
      description: |
        Definitions of the values allowed in the filter settings. If your integration flow involves using the Synerise Web Portal, you shouldn't use this object.  

        You can sort by these parameters:
        - `id`
        - `createdAt`
        - `updatedAt`
      x-class-name: OneToManyFilterProperties
      x-interface-name-ts: OneToManyFilterProperties
      properties:
        query:
          $ref: "#/components/schemas/brickworks-service-StringForm"
        sortBy:
          $ref: "#/components/schemas/brickworks-service-StringForm"
        sortDirection:
          $ref: "#/components/schemas/brickworks-service-StringForm"
      required:
        - query
        - sortBy
        - sortDirection
    brickworks-service-StringForm:
      type: object
      title: String
      x-class-name: StringForm
      x-interface-name-ts: StringForm
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-StringType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-StringSubtype"
        minLength:
          type: number
          format: int32
          description: Minimum number of characters in the string
        maxLength:
          type: number
          format: int32
          description: Maximum number of characters in the string
        pattern:
          type: string
          description: Regular expression that the string must match
        unique:
          $ref: "#/components/schemas/brickworks-service-FieldUnique"
        searchable:
          $ref: "#/components/schemas/brickworks-service-FieldSearchable"
        default:
          type: string
          nullable: true
          description: The default value of the field, used when no value is declared. It's not saved in the records, but is used when generating or previewing content from a record.
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
    brickworks-service-FieldSearchable:
      type: boolean
      description: When true, the value in this field can be used to search and sort records.
    brickworks-service-FieldUnique:
      type: boolean
      description: When true, the value in this field must be unique between all records created from this schema. This parameter can't be set on a field when more than 5 records exist for the schema.
    brickworks-service-StringSubtype:
      type: string
      title: String subtype
      x-class-name: StringSubtype
      x-interface-name-ts: StringSubtype
      enum:
        - string
    brickworks-service-StringType:
      type: string
      title: String type
      x-class-name: StringType
      x-interface-name-ts: StringType
      enum:
        - string
    brickworks-service-SchemaId:
      type: string
      format: uuid
      description: Unique ID of the schema, generated automatically.
    brickworks-service-OneToManyFilterSubtype:
      type: string
      x-class-name: OneToManyFilterSubtype
      x-interface-name-ts: OneToManyFilterSubtype
      enum:
        - filter
      description: This field type allows you to retrieve records from another schema and filter/sort them
    brickworks-service-ObjectType:
      type: string
      title: Object type
      x-class-name: ObjectType
      x-interface-name-ts: ObjectType
      enum:
        - object
    brickworks-service-ProfileAttributeField:
      type: object
      title: Profile attribute field
      x-class-name: ProfileAttributeField
      x-interface-name-ts: ProfileAttributeField
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-ObjectType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-ProfileAttributeSubtype"
        settings:
          $ref: "#/components/schemas/brickworks-service-ProfileAttributeSettings"
        properties:
          $ref: "#/components/schemas/brickworks-service-ProfileAttributeProperties"
        default:
          type: object
          title: ProfileAttributeFieldDefault
          x-class-name: ProfileAttributeFieldDefault
          x-interface-name-ts: ProfileAttributeFieldDefault
          description: |
            The default value of the field.
              - This object overrides the defaults from the `properties` object.
              - **To set no default, send this object empty**. `"default": null` overrides `properties` with a null value.
              - This object is required when `isConstantField = true`
          properties:
            attributeName:
              type: string
              description: The name of the profile attribute to retrieve a value from when generating content from a record
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
        additionalProperties:
          type: boolean
          description: Always false, don't send in requests
      required:
        - type
        - subtype
        - properties
    brickworks-service-ProfileAttributeProperties:
      type: object
      x-class-name: ProfileAttributeProperties
      x-interface-name-ts: ProfileAttributeProperties
      description: In `attributeName.default`, enter the default name of the profile attribute to retrieve a value from when generating content from a record
      properties:
        attributeName:
          $ref: "#/components/schemas/brickworks-service-StringForm"
        nullOnFail:
          $ref: "#/components/schemas/brickworks-service-BooleanForm"
      required:
        - attributeName
    brickworks-service-BooleanForm:
      type: object
      title: Boolean
      x-class-name: BooleanForm
      x-interface-name-ts: BooleanForm
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-BooleanType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-BooleanSubtype"
        unique:
          $ref: "#/components/schemas/brickworks-service-FieldUnique"
        searchable:
          $ref: "#/components/schemas/brickworks-service-FieldSearchable"
        default:
          nullable: true
          type: boolean
          description: The default value of the field, used when no value is declared. It's not saved in the records, but is used when generating or previewing content from a record.
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
    brickworks-service-BooleanSubtype:
      type: string
      x-class-name: BooleanSubtype
      x-interface-name-ts: BooleanSubtype
      enum:
        - boolean
    brickworks-service-BooleanType:
      type: string
      title: Boolean
      x-class-name: BooleanType
      x-interface-name-ts: BooleanType
      enum:
        - boolean
    brickworks-service-ProfileAttributeSettings:
      type: object
      x-class-name: ProfileAttributeSettings
      x-interface-name-ts: ProfileAttributeSettings
      description: Additional settings of the field
      properties:
        id:
          $ref: "#/components/schemas/brickworks-service-StringForm"
        castType:
          type: string
          description: The data type to try casting the attribute to
          enum:
            - none
            - boolean
            - number
            - integer
            - string
        strict:
          description: |
            Defines what happens when casting is not successful:
            - `true` throws an error in generating an object from a record
            - `false` sets the value to null
      required:
        - castType
        - strict
    brickworks-service-ProfileAttributeSubtype:
      type: string
      x-class-name: ProfileAttributeSubtype
      x-interface-name-ts: ProfileAttributeSubtype
      description: This type of field references an attribute by name and retrieves its value.
      enum:
        - client_attribute
    brickworks-service-UntypedForm:
      type: object
      x-class-name: UntypedForm
      x-interface-name-ts: UntypedForm
      description: Field without typed structure
      properties:
        anyOf:
          type: array
          minItems: 2
          maxItems: 2
          items:
            oneOf:
              - $ref: "#/components/schemas/brickworks-service-UntypedJson"
              - $ref: "#/components/schemas/brickworks-service-UntypedArray"
        subtype:
          $ref: "#/components/schemas/brickworks-service-UntypedFormSubtype"
        default:
          type: object
          additionalProperties: true
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - anyOf
        - subtype
    brickworks-service-UntypedFormSubtype:
      type: string
      x-class-name: UntypedFormSubtype
      x-interface-name-ts: UntypedFormSubtype
      enum:
        - json
    brickworks-service-UntypedArray:
      type: object
      title: Untyped array
      x-class-name: UntypedArray
      x-interface-name-ts: UntypedArray
      description: This type of field accepts an array of values. The values can be of any data type.
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-ArrayType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-UntypedArraySubtype"
        default:
          type: array
          nullable: true
          description: The default value of the field, used when no value is declared. It's not saved in the records, but is used when generating or previewing content from a record.
          items: {}
        maxItems:
          type: number
          format: int32
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
    brickworks-service-UntypedArraySubtype:
      type: string
      x-class-name: UntypedArraySubtype
      x-interface-name-ts: UntypedArraySubtype
      enum:
        - untyped_array
    brickworks-service-ArrayType:
      type: string
      title: ArrayType
      x-class-name: ArrayType
      x-interface-name-ts: ArrayType
      enum:
        - array
    brickworks-service-UntypedJson:
      type: object
      title: Untyped JSON
      x-class-name: UntypedJson
      x-interface-name-ts: UntypedJson
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-ObjectType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-UntypedObjectSubtype"
        default:
          type: object
          nullable: true
          description: The default value of the field, used when no value is declared. It's not saved in the records, but is used when generating or previewing content from a record.
          additionalProperties: true
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
    brickworks-service-UntypedObjectSubtype:
      type: string
      x-class-name: UntypedObjectSubtype
      x-interface-name-ts: UntypedObjectSubtype
      description: This type of field lets you save any JSON data in the record, without validating it against any schema
      enum:
        - untyped_object
    brickworks-service-VoucherField:
      type: object
      title: Voucher
      x-class-name: VoucherField
      x-interface-name-ts: VoucherField
      description: Reference to a voucher
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-ObjectType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-VoucherSubtype"
        properties:
          type: object
          title: Voucher properties
          x-class-name: VoucherFieldProperties
          x-interface-name-ts: VoucherFieldProperties
          description: |
            - in `id.default`, enter the UUID of the voucher pool. It can be changed per record.
            - in `assign.default`:
                - `false` means that once a code from a given pool is retrieved to a profile, it becomes assigned to the profile and is always returned in subsequent requests.
                - `true` means that a different code is retrieved for a profile with every request. This can't be changed per record.
          properties:
            id:
              $ref: "#/components/schemas/brickworks-service-StringForm"
            assign:
              $ref: "#/components/schemas/brickworks-service-BooleanForm"
            nullOnFail:
              $ref: "#/components/schemas/brickworks-service-BooleanForm"
          required:
            - id
            - assign
        default:
          type: object
          title: Voucher default
          x-class-name: VoucherFieldDefault
          x-interface-name-ts: VoucherFieldDefault
          nullable: true
          description: |
            The default value of the field.
              - This object overrides the defaults from the `properties` object.
              - **To set no default, send this object empty**. `"default": null` overrides `properties` with a null value.
              - This object is required when `isConstantField = true`
          properties:
            id:
              type: string
              description: ID of the voucher
            assign:
              type: boolean
              description: |
                - `false` means that once a code from a given pool is retrieved to a profile, it becomes assigned to the profile and is always returned in subsequent requests.
                - `true` means that a different code is retrieved for a profile with every request. This can't be changed per record.
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
        - properties
    brickworks-service-VoucherSubtype:
      type: string
      x-class-name: VoucherSubtype
      x-interface-name-ts: VoucherSubtype
      description: This type of fields lets you retrieve a voucher from a pool. The voucher is retrieved when you generate an object from the record.
      enum:
        - voucher
    brickworks-service-AiSearchListingField:
      type: object
      title: AI Listing
      x-class-name: AiSearchListingField
      x-interface-name-ts: AiSearchListingField
      description: Reference to an AI Search index used to retrieve a listing (no query phrase)
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-ObjectType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-AiSearchListingSubtype"
        properties:
          type: object
          title: AI Listing properties
          x-class-name: AiSearchListingFieldProperties
          x-interface-name-ts: AiSearchListingFieldProperties
          description: |
            - `id.default` defines the default AI Search index used to fetch the listing.
            - In `params`, you can declare additional query parameters supported by the AI Search listing API
              (e.g. `filters`, `facets`, `displayAttributes`, `personalize`).
          properties:
            id:
              $ref: "#/components/schemas/brickworks-service-StringForm"
            params:
              $ref: "#/components/schemas/brickworks-service-KeyValueObject"
            nullOnFail:
              $ref: "#/components/schemas/brickworks-service-BooleanForm"
          required:
            - id
        default:
          type: object
          title: AI Listing default
          x-class-name: AiSearchListingFieldDefault
          x-interface-name-ts: AiSearchListingFieldDefault
          description: |
            The default value of the field.
              - This object overrides the defaults from the `properties` object.
              - **To set no default, send this object empty**. `"default": null` overrides `properties` with a null value.
              - This object is required when `isConstantField = true`
          properties:
            id:
              type: string
              description: ID of the AI Search index
            params:
              type: object
              title: AI Listing default params
              x-class-name: AiSearchListingFieldDefaultParams
              x-interface-name-ts: AiSearchListingFieldDefaultParams
              description: Additional default query parameters
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
        - properties
    brickworks-service-KeyValueObject:
      type: object
      title: Key and value
      x-class-name: KeyValueObject
      x-interface-name-ts: KeyValueObject
      description: A key/value map.
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-ObjectType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-KeyValueSubtype"
        properties:
          $ref: "#/components/schemas/brickworks-service-FieldFormMap"
        default:
          type: object
          title: Key and value default
          x-class-name: KeyValueObjectDefault
          x-interface-name-ts: KeyValueObjectDefault
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
        additionalProperties:
          type: boolean
      required:
        - type
        - subtype
    brickworks-service-KeyValueSubtype:
      type: string
      x-class-name: KeyValueSubtype
      x-interface-name-ts: KeyValueSubtype
      description: |
        This type of field is a reference to an external source. The request to an external source is made when you generate content from a record.

        **NOTE**: The `headers`, `params`, and `body` properties are not currently supported by the Synerise Portal.
      enum:
        - key_value
    brickworks-service-AiSearchListingSubtype:
      type: string
      x-class-name: AiSearchListingSubtype
      x-interface-name-ts: AiSearchListingSubtype
      description: This type of field lets you retrieve listing results from an AI Search index (without a query phrase).
      enum:
        - ai_search_listing
    brickworks-service-AiSearchField:
      type: object
      title: AI Search
      x-class-name: AiSearchField
      x-interface-name-ts: AiSearchField
      description: Reference to an AI Search index used to perform a search query
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-ObjectType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-AiSearchSubtype"
        properties:
          type: object
          title: AI Search properties
          x-class-name: AiSearchFieldProperties
          x-interface-name-ts: AiSearchFieldProperties
          description: |
            - `id.default` defines the default AI Search index used to perform the search.
            - `query.default` defines the default search phrase (accepts a string or a Jinjava expression).
            - In `params`, you can declare additional query parameters supported by the AI Search API
              (e.g. `filters`, `facets`, `displayAttributes`, `personalize`).
          properties:
            id:
              $ref: "#/components/schemas/brickworks-service-StringForm"
            query:
              $ref: "#/components/schemas/brickworks-service-StringForm"
            params:
              $ref: "#/components/schemas/brickworks-service-KeyValueObject"
            nullOnFail:
              $ref: "#/components/schemas/brickworks-service-BooleanForm"
          required:
            - id
            - query
        default:
          type: object
          title: AI Search default
          x-class-name: AiSearchFieldDefault
          x-interface-name-ts: AiSearchFieldDefault
          description: |
            The default value of the field.
              - This object overrides the defaults from the `properties` object.
              - **To set no default, send this object empty**. `"default": null` overrides `properties` with a null value.
              - This object is required when `isConstantField = true`
          properties:
            id:
              type: string
              description: ID of the AI Search index
            query:
              type: string
              description: Default search query phrase
            params:
              type: object
              title: AI Search default params
              x-class-name: AiSearchFieldDefaultParams
              x-interface-name-ts: AiSearchFieldDefaultParams
              description: Additional default query parameters
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
        - properties
    brickworks-service-AiSearchSubtype:
      type: string
      x-class-name: AiSearchSubtype
      x-interface-name-ts: AiSearchSubtype
      description: This type of field lets you retrieve results of an AI Search query against a chosen index.
      enum:
        - ai_search
    brickworks-service-RecommendationField:
      type: object
      title: Recommendation
      x-class-name: RecommendationField
      x-interface-name-ts: RecommendationField
      description: Reference to a recommendation campaign
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-ObjectType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-RecommendationSubtype"
        properties:
          type: object
          title: Recommendation properties
          x-class-name: RecommendationFieldProperties
          x-interface-name-ts: RecommendationFieldProperties
          description: |
            - `id.default` defines the default recommendation campaign to generate a recommendation from.  
            - In `params.itemId`, you can add a default item context (required by some recommendation types):
              ```
              "itemId": {
                "type": "string",
                "subtype": "string"
                "default": "defaultItemIdForItemContext"
                }
              ```
          properties:
            id:
              $ref: "#/components/schemas/brickworks-service-StringForm"
            params:
              $ref: "#/components/schemas/brickworks-service-KeyValueObject"
            nullOnFail:
              $ref: "#/components/schemas/brickworks-service-BooleanForm"
          required:
            - id
        default:
          type: object
          title: Recommendation default
          x-class-name: RecommendationFieldDefault
          x-interface-name-ts: RecommendationFieldDefault
          description: |
            The default value of the field.
              - This object overrides the defaults from the `properties` object.
              - **To set no default, send this object empty**. `"default": null` overrides `properties` with a null value.
              - This object is required when `isConstantField = true`
          properties:
            id:
              type: string
              description: UUID of a recommendation campaign
            params:
              type: object
              title: Recommendation default params
              x-class-name: RecommendationFieldDefaultParams
              x-interface-name-ts: RecommendationFieldDefaultParams
              description: Item context
              properties:
                itemId:
                  type: string
                  description: Unique ID of an item context (required for some recommendation types)
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
        - properties
    brickworks-service-RecommendationSubtype:
      type: string
      x-class-name: RecommendationSubtype
      x-interface-name-ts: RecommendationSubtype
      description: This type of field lets you retrieve the result of a recommendation campaign.
      enum:
        - recommendation
    brickworks-service-ImageField:
      type: object
      title: Image
      x-class-name: ImageField
      x-interface-name-ts: ImageField
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-ObjectType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-ImageSubtype"
        properties:
          $ref: "#/components/schemas/brickworks-service-FileFieldProperties"
        default:
          type: object
          title: Image default
          x-class-name: ImageFieldDefault
          x-interface-name-ts: ImageFieldDefault
          description: |
            The default value of the field.
              - This object overrides the defaults from the `properties` object.
              - **To set no default, send this object empty**. `"default": null` overrides `properties` with a null value.
              - This object is required when `isConstantField = true`
          properties:
            id:
              type: string
              description: Unique identifier of an image/file in the File Explorer
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
        - properties
    brickworks-service-FileFieldProperties:
      type: object
      x-class-name: FileFieldProperties
      x-interface-name-ts: FileFieldProperties
      description: "`id` defines the unique ID of a [file uploaded to Synerise](https://hub.synerise.com/docs/assets/files-explorer/). In `default`, enter the default file ID."
      properties:
        id:
          $ref: "#/components/schemas/brickworks-service-StringForm"
    brickworks-service-ImageSubtype:
      type: string
      description: This type of field lets you store links to images.
      enum:
        - image
    brickworks-service-FileField:
      type: object
      title: File
      x-class-name: FileField
      x-interface-name-ts: FileField
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-ObjectType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-FileSubtype"
        properties:
          $ref: "#/components/schemas/brickworks-service-FileFieldProperties"
        default:
          type: object
          title: File default
          x-class-name: FileFieldDefault
          x-interface-name-ts: FileFieldDefault
          description: |
            The default value of the field.
              - This object overrides the defaults from the `properties` object.
              - **To set no default, send this object empty**. `"default": null` overrides `properties` with a null value.
              - This object is required when `isConstantField = true`
          properties:
            id:
              type: string
              description: Unique identifier of an image/file in the File Explorer
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
        - properties
    brickworks-service-FileSubtype:
      type: string
      x-class-name: FileSubtype
      x-interface-name-ts: FileSubtype
      description: This type of field lets you store links to [files uploaded to Synerise](https://hub.synerise.com/docs/assets/files-explorer/).
      enum:
        - file
    brickworks-service-PromotionField:
      type: object
      title: Promotion
      x-class-name: PromotionField
      x-interface-name-ts: PromotionField
      description: Reference to a promotion
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-ObjectType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-PromotionSubtype"
        properties:
          $ref: "#/components/schemas/brickworks-service-PromotionFieldProperties"
        default:
          type: object
          title: Promotion default
          x-class-name: PromotionFieldDefault
          x-interface-name-ts: PromotionFieldDefault
          description: |
            The default value of the field.
              - This object overrides the defaults from the `properties` object.
              - **To set no default, send this object empty**. `"default": null` overrides `properties` with a null value.
              - This object is required when `isConstantField = true`
          properties:
            id:
              type: string
              description: ID of a promotion campaign
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
        - properties
    brickworks-service-PromotionFieldProperties:
      type: object
      x-class-name: PromotionFieldProperties
      x-interface-name-ts: PromotionFieldProperties
      description: "`id` defines the promotion to access. In `default`, enter the default promotion UUID."
      properties:
        id:
          $ref: "#/components/schemas/brickworks-service-StringForm"
        nullOnFail:
          $ref: "#/components/schemas/brickworks-service-BooleanForm"
      required:
        - id
    brickworks-service-PromotionSubtype:
      type: string
      x-class-name: PromotionSubtype
      x-interface-name-ts: PromotionSubtype
      enum:
        - promotion
    brickworks-service-ExpressionField:
      type: object
      description: Reference to a Synerise analysis
      title: Expression
      x-class-name: ExpressionField
      x-interface-name-ts: ExpressionField
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-ObjectType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-ExpressionSubtype"
        properties:
          type: object
          description: |
            - `id` is the default ID of an expression.
            - `variables` is a set of variables to pass when the analysis has dynamic fields.
            - `includeDetails` defines if the generated object includes just the result of the analysis (true) or additional details such as the ID of the analysis and profile ID for which the analysis was made (false). This can't be changed per record.
          properties:
            id:
              $ref: "#/components/schemas/brickworks-service-StringForm"
            variables:
              $ref: "#/components/schemas/brickworks-service-KeyValueObject"
            includeDetails:
              $ref: "#/components/schemas/brickworks-service-BooleanForm"
            nullOnFail:
              $ref: "#/components/schemas/brickworks-service-BooleanForm"
          required:
            - id
        default:
          type: object
          x-class-name: ExpressionFieldDefault
          x-interface-name-ts: ExpressionFieldDefault
          title: Expression default
          nullable: true
          description: |
            The default value of the field.
              - This object overrides the defaults from the `properties` object.
              - **To set no default, send this object empty**. `"default": null` overrides `properties` with a null value.
              - This object is required when `isConstantField = true`
          properties:
            id:
              type: string
              description: UUID of an analysis
            variables:
              type: object
              additionalProperties:
                description: Values of dynamic keys in the analysis
            includeDetails:
              type: boolean
              description: Defines if the generated object includes just the result of the analysis (true) or additional details such as the ID of the analysis and profile ID for which the analysis was made (false). This can't be changed per record.
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
        - properties
    brickworks-service-ExpressionSubtype:
      type: string
      x-class-name: ExpressionSubtype
      x-interface-name-ts: ExpressionSubtype
      enum:
        - expression
    brickworks-service-AggregateField:
      type: object
      description: Reference to a Synerise analysis
      title: Aggregate
      x-class-name: AggregateField
      x-interface-name-ts: AggregateField
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-ObjectType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-AggregateSubtype"
        properties:
          type: object
          description: |
            - `id` is the default ID of an analysis.
            - `variables` is a set of variables to pass when the analysis has dynamic fields.
            - `includeDetails` defines if the generated object includes just the result of the analysis (true) or additional details such as the ID of the analysis and profile ID for which the analysis was made (false). This can't be changed per record.
          properties:
            id:
              $ref: "#/components/schemas/brickworks-service-StringForm"
            variables:
              $ref: "#/components/schemas/brickworks-service-KeyValueObject"
            includeDetails:
              $ref: "#/components/schemas/brickworks-service-BooleanForm"
            nullOnFail:
              $ref: "#/components/schemas/brickworks-service-BooleanForm"
          required:
            - id
        default:
          type: object
          title: Aggregate default
          x-class-name: AggregateFieldDefault
          x-interface-name-ts: AggregateFieldDefault
          nullable: true
          description: |
            The default value of the field.
              - This object overrides the defaults from the `properties` object.
              - **To set no default, send this object empty**. `"default": null` overrides `properties` with a null value.
              - This object is required when `isConstantField = true`
          properties:
            id:
              type: string
              description: UUID of an analysis
            variables:
              type: object
              additionalProperties:
                description: Values of dynamic keys in the analysis
            includeDetails:
              type: boolean
              description: Defines if the generated object includes just the result of the analysis (true) or additional details such as the ID of the analysis and profile ID for which the analysis was made (false). This can't be changed per record.
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
        - properties
    brickworks-service-AggregateSubtype:
      type: string
      x-class-name: AggregateSubtype
      x-interface-name-ts: AggregateSubtype
      enum:
        - aggregate
    brickworks-service-MetricField:
      type: object
      description: Reference to a Synerise analysis
      title: Metric
      x-class-name: MetricField
      x-interface-name-ts: MetricField
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-ObjectType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-MetricSubtype"
        properties:
          type: object
          description: |
            - `id` is the default ID of an metric.
            - `variables` is a set of variables to pass when the analysis has dynamic fields.
            - `includeDetails` defines if the generated object includes just the result of the analysis (true) or additional details such as the ID of the analysis and profile ID for which the analysis was made (false). This can't be changed per record.
          properties:
            id:
              $ref: "#/components/schemas/brickworks-service-StringForm"
            variables:
              $ref: "#/components/schemas/brickworks-service-KeyValueObject"
            includeDetails:
              $ref: "#/components/schemas/brickworks-service-BooleanForm"
            nullOnFail:
              $ref: "#/components/schemas/brickworks-service-BooleanForm"
          required:
            - id
        default:
          type: object
          title: Metric default
          x-class-name: MetricFieldDefault
          x-interface-name-ts: MetricFieldDefault
          nullable: true
          description: |
            The default value of the field.
              - This object overrides the defaults from the `properties` object.
              - **To set no default, send this object empty**. `"default": null` overrides `properties` with a null value.
              - This object is required when `isConstantField = true`
          properties:
            id:
              type: string
              description: UUID of an analysis
            variables:
              type: object
              additionalProperties:
                description: Values of dynamic keys in the analysis
            includeDetails:
              type: boolean
              description: Defines if the generated object includes just the result of the analysis (true) or additional details such as the ID of the analysis and profile ID for which the analysis was made (false). This can't be changed per record.
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
        - properties
    brickworks-service-MetricSubtype:
      type: string
      x-class-name: MetricSubtype
      x-interface-name-ts: MetricSubtype
      enum:
        - metric
    brickworks-service-OneToManyForm:
      type: object
      title: Multiple record reference
      x-class-name: OneToManyForm
      x-interface-name-ts: OneToManyForm
      description: This type of field allows you to reference multiple records from another schema. `items` defines the target schema.
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-ArrayType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-OneToManySubtype"
        items:
          $ref: "#/components/schemas/brickworks-service-ReferenceForm"
        maxItems:
          type: number
          minimum: 1
          maximum: 100
          default: 20
          description: The maximum number of records that can be referenced.
        default:
          type: array
          description: An array of default record references (record UUIDs)
          items:
            type: string
            format: uuid
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - items
        - subtype
    brickworks-service-ReferenceForm:
      type: object
      title: Record reference
      x-class-name: ReferenceForm
      x-interface-name-ts: ReferenceForm
      description: Definition of a reference to another schema
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-StringType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-OneToOneSubtype"
        referenceId:
          type: string
          description: Unique identifier of the schema you want to access a record from. When creating a record with this field, you will provide the UUID of the referenced record from that schema.
        default:
          type: string
          format: uuid
          description: The default record to reference. In "one to many" fields, use the `default` array in the parent object instead of this property.
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
    brickworks-service-OneToOneSubtype:
      type: string
      x-class-name: OneToOneSubtype
      x-interface-name-ts: OneToOneSubtype
      description: |
        This field type lets you include references to a record from another schema. To generate an object, the referenced record must be published. Its content (for example, an expression field in the referenced record) will be processed when generating an object.
      enum:
        - one_to_one
    brickworks-service-OneToManySubtype:
      type: string
      x-class-name: OneToManySubtype
      x-interface-name-ts: OneToManySubtype
      enum:
        - one_to_many
    brickworks-service-ExternalHttpSource:
      type: object
      title: External source
      x-class-name: ExternalSourceField
      x-interface-name-ts: ExternalSourceField
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-ObjectType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceSubtype"
        sourceType:
          type: string
          enum:
            - http
        sourceId:
          type: string
          description: Unique ID of the external source definition
          format: uuid
        headers:
          $ref: "#/components/schemas/brickworks-service-KeyValueObject"
        params:
          $ref: "#/components/schemas/brickworks-service-KeyValueObject"
        body:
          $ref: "#/components/schemas/brickworks-service-FieldForm"
        properties:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceFieldProperties"
        default:
          type: object
          title: External source default
          x-class-name: ExternalHttpSourceDefault
          x-interface-name-ts: ExternalHttpSourceDefault
          nullable: true
          properties:
            headers:
              type: object
              description: Request headers
              additionalProperties: true
            params:
              type: object
              description: The url parameters
              additionalProperties: true
            body:
              type: object
              description: Request body
              additionalProperties: true
            properties:
              type: object
              title: External source properties
              x-class-name: ExternalHttpSourcePropertiesValues
              x-interface-name-ts: ExternalHttpSourcePropertiesValues
              properties:
                nullOnFail:
                  type: boolean
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
        - sourceType
        - sourceId
    brickworks-service-ExternalSourceFieldProperties:
      type: object
      x-class-name: ExternalSourceFieldProperties
      x-interface-name-ts: ExternalSourceFieldProperties
      properties:
        nullOnFail:
          $ref: "#/components/schemas/brickworks-service-BooleanForm"
      required:
        - nullOnFail
    brickworks-service-ExternalSourceSubtype:
      type: string
      x-class-name: ExternalSourceSubtype
      x-interface-name-ts: ExternalSourceSubtype
      enum:
        - external_source
    brickworks-service-CatalogItemField:
      type: object
      title: Catalog
      x-class-name: CatalogItemField
      x-interface-name-ts: CatalogItemField
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-ObjectType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-CatalogItemSubtype"
        properties:
          type: object
          title: CatalogItemFieldProperties
          description: |
            The data of the catalog. `id` is the default catalogId and `itemKey` is the default unique identifier of an item. You can override both when creating/updating a record.
          properties:
            id:
              $ref: "#/components/schemas/brickworks-service-StringForm"
            itemKey:
              oneOf:
                - $ref: "#/components/schemas/brickworks-service-StringForm"
                - $ref: "#/components/schemas/brickworks-service-JinJavaForm"
              discriminator:
                propertyName: subtype
                mapping:
                  jinjava: "#/components/schemas/brickworks-service-JinJavaForm"
                  string: "#/components/schemas/brickworks-service-StringForm"
            nullOnFail:
              $ref: "#/components/schemas/brickworks-service-BooleanForm"
          required:
            - id
            - itemKey
        default:
          type: object
          title: Catalog default
          x-class-name: CatalogFieldDefault
          x-interface-name-ts: CatalogFieldDefault
          description: |
            The default value of the field.
              - This object overrides the defaults from the `properties` object.
              - **To set no default, send this object empty**. `"default": null` overrides `properties` with a null value.
              - This object is required when `isConstantField = true`
          properties:
            id:
              type: string
              description: Unique ID of a catalog
            itemKey:
              type: string
              description: Static string or Jinjava that inserts the unique ID of an item in the catalog
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
        - properties
    brickworks-service-JinJavaForm:
      type: object
      title: Jinjava
      x-class-name: JinJavaForm
      x-interface-name-ts: JinJavaForm
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-StringType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-JinJavaSubtype"
        default:
          type: string
          nullable: true
          description: The default value of the field, used when no value is declared. It's not saved in the records, but is used when generating or previewing content from a record.
        settings:
          $ref: "#/components/schemas/brickworks-service-JinJavaSettings"
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
    brickworks-service-JinJavaSettings:
      type: object
      x-class-name: JinJavaSettings
      x-interface-name-ts: JinJavaSettings
      nullable: true
      description: Settings for casting the Jinjava result to a data type. Casting may not be successful - set the `strict` setting to decide how to proceed in that case.
      properties:
        castType:
          type: string
          description: The data type to try casting the Jinjava result to
          x-class-name: JinJavaCastType
          x-interface-name-ts: JinJavaCastType
          enum:
            - boolean
            - integer
            - number
            - json
        strict:
          type: boolean
          description: |
            Defines what happens when casting is not successful:
            - `true` throws an error in generating an object from a record
            - `false` sets the value to null
        removeWhitespaces:
          type: boolean
          description: |
            When `true`, all whitespace characters (e.g. `\r`, `\n`, spaces, tabs) are removed from the Jinjava render result before casting.
      required:
        - strict
        - castType
    brickworks-service-JinJavaSubtype:
      type: string
      x-class-name: JinJavaSubtype
      x-interface-name-ts: JinJavaSubtype
      enum:
        - jinjava
    brickworks-service-CatalogItemSubtype:
      type: string
      x-class-name: CatalogItemSubtype
      x-interface-name-ts: CatalogItemSubtype
      enum:
        - catalog_item
    brickworks-service-UUIDForm:
      type: object
      title: UUID
      x-class-name: UUIDForm
      x-interface-name-ts: UUIDForm
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-StringType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-UuidSubtype"
        default:
          type: string
          format: uuid
          title: UUID default
          x-class-name: UUIDFormDefault
          x-interface-name-ts: UUIDFormDefault
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
    brickworks-service-UuidSubtype:
      type: string
      x-class-name: UUIDSubtype
      x-interface-name-ts: UUIDSubtype
      enum:
        - uuid
    brickworks-service-ArrayForm:
      type: object
      title: Array
      x-class-name: ArrayForm
      x-interface-name-ts: ArrayForm
      description: This type of field accepts an array of values. The type of values is defined in `items`
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-ArrayType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-TypedArraySubtype"
        items:
          type: object
          description: The definition of the type of value allowed in the array. All values must be of the same type.
          oneOf:
            - $ref: "#/components/schemas/brickworks-service-NumberForm"
            - $ref: "#/components/schemas/brickworks-service-IntegerForm"
            - $ref: "#/components/schemas/brickworks-service-BooleanForm"
            - $ref: "#/components/schemas/brickworks-service-StringForm"
            - $ref: "#/components/schemas/brickworks-service-EnumForm"
          discriminator:
            propertyName: subtype
            mapping:
              number: "#/components/schemas/brickworks-service-NumberForm"
              integer: "#/components/schemas/brickworks-service-IntegerForm"
              boolean: "#/components/schemas/brickworks-service-BooleanForm"
              string: "#/components/schemas/brickworks-service-StringForm"
              enum: "#/components/schemas/brickworks-service-EnumForm"
        maxItems:
          type: number
          format: int32
          description: The maximum number of items allowed in the array
        uniqueItems:
          type: boolean
          description: When `true`, the values in the array must be unique
        default:
          type: array
          nullable: true
          description: The default value of the field, used when no value is declared. It's not saved in the records, but is used when generating or previewing content from a record.
          items: {}
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - items
        - subtype
    brickworks-service-EnumForm:
      type: object
      title: Enumeration
      x-class-name: EnumForm
      x-interface-name-ts: EnumForm
      description: This type of field defines a list of strings which can be used as the value. Only one of the allowed values can be saved in the record.
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-StringType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-EnumSubtype"
        enum:
          type: array
          description: A list of strings which can be selected as the value
          items:
            type: string
        names:
          type: object
          description: |
            A mapping of the field values and their names displayed in the record.

            For example, if `enum` contains the value `exampleValue` and you want the UI to show `Example Value` on the list, set:
            ```
            "names": {
              "exampleValue": "Example Value"
            }
            ```
          additionalProperties:
            type: string
        default:
          type: string
          nullable: true
          description: The default value of the field, used when no value is declared. It's not saved in the records, but is used when generating or previewing content from a record.
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
        - enum
        - names
    brickworks-service-EnumSubtype:
      type: string
      x-class-name: EnumSubtype
      x-interface-name-ts: EnumSubtype
      enum:
        - enum
    brickworks-service-IntegerForm:
      type: object
      title: Integer
      x-class-name: IntegerForm
      x-interface-name-ts: IntegerForm
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-IntegerType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-IntegerSubtype"
        minimum:
          type: number
          format: int32
          description: Minimum value
        maximum:
          type: number
          format: int32
          description: Maximum value
        unique:
          $ref: "#/components/schemas/brickworks-service-FieldUnique"
        searchable:
          $ref: "#/components/schemas/brickworks-service-FieldSearchable"
        default:
          type: number
          nullable: true
          description: The default value of the field, used when no value is declared. It's not saved in the records, but is used when generating or previewing content from a record.
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
    brickworks-service-IntegerSubtype:
      type: string
      x-class-name: IntegerSubtype
      x-interface-name-ts: IntegerSubtype
      enum:
        - integer
    brickworks-service-IntegerType:
      type: string
      title: IntegerType
      x-class-name: IntegerType
      x-interface-name-ts: IntegerType
      enum:
        - integer
    brickworks-service-NumberForm:
      type: object
      title: Number
      x-class-name: NumberForm
      x-interface-name-ts: NumberForm
      description: This field type accepts static numeric values. `number` is used for floating-point values.
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-NumberType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-NumberSubtype"
        minimum:
          type: number
          format: float
          description: Minimum value
        maximum:
          type: number
          format: float
          description: Maximum value
        unique:
          $ref: "#/components/schemas/brickworks-service-FieldUnique"
        searchable:
          $ref: "#/components/schemas/brickworks-service-FieldSearchable"
        default:
          type: number
          nullable: true
          description: The default value of the field, used when no value is declared. It's not saved in the records, but is used when generating or previewing content from a record.
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
    brickworks-service-NumberSubtype:
      type: string
      x-class-name: NumberSubtype
      x-interface-name-ts: NumberSubtype
      enum:
        - number
    brickworks-service-NumberType:
      type: string
      title: Number type
      x-class-name: NumberType
      x-interface-name-ts: NumberType
      enum:
        - number
    brickworks-service-TypedArraySubtype:
      type: string
      x-class-name: TypedArraySubtype
      x-interface-name-ts: TypedArraySubtype
      enum:
        - typed_array
    brickworks-service-DateTimeForm:
      type: object
      title: Date and time
      x-class-name: DateTimeForm
      x-interface-name-ts: DateTimeForm
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-StringType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-DateTimeSubtype"
        default:
          type: string
          format: date-time
          nullable: true
          description: The default value of the field, used when no value is declared. It's not saved in the records, but is used when generating or previewing content from a record.
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
    brickworks-service-DateTimeSubtype:
      type: string
      x-class-name: DateTimeSubtype
      x-interface-name-ts: DateTimeSubtype
      enum:
        - date-time
    brickworks-service-DateForm:
      type: object
      title: Date
      x-class-name: DateForm
      x-interface-name-ts: DateForm
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-StringType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-DateSubtype"
        default:
          type: string
          format: date
          nullable: true
          description: The default value of the field, used when no value is declared. It's not saved in the records, but is used when generating or previewing content from a record.
        isConstantField:
          $ref: "#/components/schemas/brickworks-service-IsConstantField"
      required:
        - type
        - subtype
    brickworks-service-DateSubtype:
      type: string
      x-class-name: DateSubtype
      x-interface-name-ts: DateSubtype
      enum:
        - date
    brickworks-service-SchemaDescription:
      type: string
      description: Schema description
    brickworks-service-SchemaDisplayName:
      type: string
      description: Schema name shown to users in the Synerise Portal
    brickworks-service-SchemaAppId:
      type: string
      description: |
        App ID of the schema. This is used as the identifier of the schema and must be unique. This ID cannot be changed after the schema is created.  
        In the Synerise Portal, this parameter is called **API name**. 
    brickworks-service-Meta:
      type: object
      description: Pagination metadata
      x-class-name: Meta
      x-interface-name-ts: Meta
      properties:
        links:
          type: array
          description: Links to the neighboring pages and the first page
          items:
            $ref: "#/components/schemas/brickworks-service-Link"
        limit:
          type: integer
          format: int32
          description: Limit of items per page
        count:
          type: integer
          nullable: true
          description: Currently unused
    brickworks-service-Link:
      type: object
      x-class-name: Link
      x-interface-name-ts: Link
      required:
        - url
        - rel
      properties:
        url:
          type: string
          description: URL of the page, used for navigation
        rel:
          type: string
          description: The type of relation to the current page. `first` is always the first page.
          enum:
            - first
            - prev
            - next
    brickworks-service-CreateSchemaRequest:
      type: object
      x-class-name: CreateSchemaRequest
      x-interface-name-ts: CreateSchemaRequest
      description: Create schema request body
      required:
        - appId
        - displayName
      properties:
        appId:
          $ref: "#/components/schemas/brickworks-service-SchemaAppId"
        displayName:
          $ref: "#/components/schemas/brickworks-service-SchemaDisplayName"
        description:
          $ref: "#/components/schemas/brickworks-service-SchemaDescription"
        fields:
          $ref: "#/components/schemas/brickworks-service-FieldsObject"
        displayConfiguration:
          $ref: "#/components/schemas/brickworks-service-SchemaDisplayConfiguration"
        audience:
          $ref: "#/components/schemas/brickworks-service-Audience"
        schemaType:
          $ref: "#/components/schemas/brickworks-service-SchemaType"
    brickworks-service-UpdateSchemaRequest:
      type: object
      x-class-name: UpdateSchemaRequest
      x-interface-name-ts: UpdateSchemaRequest
      description: Schema update request body
      required:
        - displayName
      properties:
        displayName:
          $ref: "#/components/schemas/brickworks-service-SchemaDisplayName"
        description:
          $ref: "#/components/schemas/brickworks-service-SchemaDescription"
        fields:
          $ref: "#/components/schemas/brickworks-service-FieldsObject"
        displayConfiguration:
          $ref: "#/components/schemas/brickworks-service-SchemaDisplayConfiguration"
        audience:
          $ref: "#/components/schemas/brickworks-service-Audience"
    brickworks-service-RecordPagingResult:
      type: object
      x-class-name: RecordPagingResult
      x-interface-name-ts: RecordPagingResult
      required:
        - meta
        - data
      properties:
        meta:
          $ref: "#/components/schemas/brickworks-service-Meta"
        data:
          type: array
          description: Array of records
          items:
            $ref: "#/components/schemas/brickworks-service-ListRecordView"
    brickworks-service-ListRecordView:
      type: object
      x-class-name: ListRecordView
      x-interface-name-ts: RecordWithoutFields
      description: Record object
      required:
        - id
        - schemaId
        - createdBy
        - updatedBy
        - createdAt
        - updatedAt
        - status
        - recordVersion
      properties:
        id:
          $ref: "#/components/schemas/brickworks-service-RecordId"
        name:
          $ref: "#/components/schemas/brickworks-service-RecordName"
        schemaId:
          $ref: "#/components/schemas/brickworks-service-SchemaId"
        createdBy:
          $ref: "#/components/schemas/brickworks-service-CreatedBy"
        updatedBy:
          $ref: "#/components/schemas/brickworks-service-UpdatedBy"
        publishedBy:
          $ref: "#/components/schemas/brickworks-service-PublishedBy"
        deletedBy:
          $ref: "#/components/schemas/brickworks-service-DeletedBy"
        createdAt:
          $ref: "#/components/schemas/brickworks-service-CreatedAt"
        updatedAt:
          $ref: "#/components/schemas/brickworks-service-UpdatedAt"
        publishedAt:
          $ref: "#/components/schemas/brickworks-service-PublishedAt"
        deletedAt:
          $ref: "#/components/schemas/brickworks-service-DeletedAt"
        slug:
          $ref: "#/components/schemas/brickworks-service-RecordSlug"
        status:
          $ref: "#/components/schemas/brickworks-service-RecordStatus"
        values:
          $ref: "#/components/schemas/brickworks-service-RecordValues"
        schemaVersion:
          type: integer
          format: int32
          description: The ID of the schema version that was used when this record was last updated. For simple schemas, this is always `1`.
        recordVersion:
          $ref: "#/components/schemas/brickworks-service-RecordVersionNumber"
        schedule:
          $ref: "#/components/schemas/brickworks-service-ScheduleEntry"
    brickworks-service-ScheduleEntry:
      type: object
      x-class-name: ScheduleEntry
      x-interface-name-ts: ScheduleEntry
      description: Time when the record is published - for example, every Monday, from 12:00 to 14:00
      properties:
        timezone:
          type: string
          description: Timezone of the schedule, as `UTC+offset` or according to the [tz database](https://en.wikipedia.org/wiki/Tz_database).
          example: UTC+01:00
        startType:
          type: string
          description: If `NOW`, the record is published immediately upon saving.
          enum:
            - NOW
            - SCHEDULED
        startDate:
          type: string
          description: Time when the schedule becomes active. If `startType` is NOW, this field is null.
          format: date-time
        endType:
          type: string
          description: Mode of inactivating the schedule
          enum:
            - NEVER
            - DATE
        endDate:
          type: string
          description: Time when the schedule becomes inactive, if `endType = DATE`
          format: date-time
        periodType:
          type: string
          description: |
            Defines when the schedule applies within its activity period.

            - ENTIRE: schedule is applied at all time since it becomes active until it becomes inactive.
            - DAILY: schedule is active every day, at specific times
            - WEEKLY: schedule is applied at specified days of the week (and optionally at specific times during those days)
            - MONTHLY: schedule is applied at specified days of the month (and optionally at specific times during those days)
            - WEEKDAY: schedule is applied on specified weekdays of a month; for example on the second Tuesday of each month
          enum:
            - ENTIRE
            - DAILY
            - WEEKLY
            - MONTHLY
            - WEEKDAY
        parts:
          type: array
          description: |
            An array of time rules that allow more granularity. All objects must match the period type set in `periodType` (for example, you cannot mix weekly and monthly conditions).

            If `periodType` is `ENTIRE`, this array is empty.
          items:
            $ref: "#/components/schemas/brickworks-service-EntryScheduleRepeatPart"
        enabled:
          type: boolean
          description: Defines if the schedule configuration is enabled. A schedule must be enabled in order to become active at the selected time.
      required:
        - timezone
        - startType
        - startDate
        - endType
        - enabled
    brickworks-service-EntryScheduleRepeatPart:
      type: object
      x-class-name: EntryScheduleRepeatPart
      x-interface-name-ts: EntryScheduleRepeatPart
      properties:
        startDay:
          type: integer
          format: int32
          example: 1
          description: |
            If `periodType` is:

            - DAILY, the value is always 1.

            - WEEKLY or WEEKDAY, the values are 1-7 (1 is Monday).

            - MONTHLY, the values are 1-31 (days of the month).

            **Note:**  
            If you want to define two time rules for a day (for example, the schedule is active on Monday at 06:00-07:00 and 15:00-16:00), create a separate `part` object for each time period.
        startTime:
          type: string
          example: 08:18:03
          description: The hour when the schedule becomes active.
        endDay:
          type: integer
          format: int32
          example: 1
          description: Must be identical to `startDay`.
        endTime:
          type: string
          example: 12:18:03
          description: The hour when the schedule becomes inactive.
        ordinal:
          type: string
          description: |
            
            Applies only if `periodType` is WEEKDAY.

            **Example:**<br/>
            If you want a schedule to be active on every third Tuesday of the month, set `ordinal` to THIRD and `startDay` to 2. 

            **Note:**<br/>
            If you want a schedule to be active on every second and third Tuesday, you must create two separate `part` objects.
          enum:
            - FIRST
            - SECOND
            - THIRD
            - FOURTH
            - FIFTH
            - LAST
      required:
        - startDay
        - startTime
        - endDay
        - endTime
    brickworks-service-RecordVersionNumber:
      type: number
      format: int32
      description: |
        Identifier of the record version. 
        - In simple schemas, this is always `1`
        - In versioned schemas, the versions start with `1` on creation and are increased by 1 when you create a new draft. Publishing from a draft does NOT increase the version number.
    brickworks-service-RecordValues:
      type: object
      x-class-name: RecordValues
      x-interface-name-ts: RecordValues
      description: |
        Values included in the record. Each key is the name of a field. The value must match the configuration of the field in the schema.

        **Default values aren't explicitly saved in the record** or shown in GET requests which retrieve the record, but are returned when an object is generated from the record.

        Supported value types:
        - Float (number)
        - Integer
        - String
        - Boolean
        - Date (string, format: date)
        - Date-time (string, format: date-time)
        - Profile attribute (object with attributeName)
        - Typed array
        - UUID (string, format: uuid)
        - Jinjava (string)
        - Catalog (object with itemKey, id)
        - Object (free-form)
        - External source (empty object)
        - One-to-one reference (string - record ID)
        - One-to-many reference (array of record IDs)
        - Analysis (string, format: uuid)
        - Promotion (string - promotion ID)
        - File/Image (string - file ID)
        - Recommendation (object with id, params)
        - Voucher (object with id)
        - Untyped JSON (object)
        - Untyped array
      additionalProperties: true
      example:
        stringField: example string
        numberField: 123.45
        integerField: 42
        booleanField: true
        dateField: 2024-01-15
        dateTimeField: 2024-01-15T10:30:00Z
        uuidField: 550e8400-e29b-41d4-a716-446655440000
        arrayField:
          - item1
          - item2
        objectField:
          key: value
        profileAttribute:
          attributeName: email
        catalog:
          itemKey: SKU123
          id: catalog-id
        recommendation:
          id: recommendation-campaign-id
          params:
            itemId: item-123
    brickworks-service-RecordStatus:
      type: string
      x-class-name: RecordStatus
      x-interface-name-ts: RecordStatus
      description: |
        Status of the record. When generating an object from a record, the last published version is used.  
        - In simple schemas, a record can only be published. Updates overwrite the record without changing the version number.
        - In versioned schemas:
            - A published record can't be edited directly. You need to send an update which changes to the draft status (this increases the version number, and the existing published version isn't modified), and then publish again.
            - An unpublished record can't be published immediately. It must receive the draft status first.
            - When unpublishing a record, you can't edit any data in the record.
      enum:
        - DRAFT
        - SCHEDULED
        - PUBLISHED
        - UNPUBLISHED
    brickworks-service-RecordSlug:
      type: string
      minLength: 6
      maxLength: 40
      pattern: ^([a-zA-Z0-9\-]|_[a-zA-Z0-9\-])[\w\-]*
      description: |
        Unique (within a schema) identifier of a record. Can't be a UUID.

        In singleton-type schemas, use the schema's `appId` or `id` in place of record identifiers for generating content.
    brickworks-service-RecordName:
      type: string
      maxLength: 255
      minLength: 1
      nullable: true
      description: The name of the record. If not defined and there are no fields with `useAsRecordName = true`, GET requests return `Unnamed`.
    brickworks-service-RecordId:
      type: string
      format: uuid
      description: |
        Unique identifier of a record, generated by the system. Can't be changed.

        This identifier is common to all versions of the record, even when the slug changes.

        In singleton-type schemas, use the schema's `appId` or `id` in place of record identifiers for generating content.
    brickworks-service-Record:
      x-class-name: Record
      x-interface-name-ts: Record
      allOf:
        - type: object
          required:
            - id
            - schemaId
            - values
            - createdBy
            - updatedBy
            - createdAt
            - updatedAt
            - status
            - recordVersion
          properties:
            id:
              $ref: "#/components/schemas/brickworks-service-RecordId"
            name:
              $ref: "#/components/schemas/brickworks-service-RecordName"
            schemaId:
              $ref: "#/components/schemas/brickworks-service-SchemaId"
            createdBy:
              $ref: "#/components/schemas/brickworks-service-CreatedBy"
            updatedBy:
              $ref: "#/components/schemas/brickworks-service-UpdatedBy"
            publishedBy:
              $ref: "#/components/schemas/brickworks-service-PublishedBy"
            deletedBy:
              $ref: "#/components/schemas/brickworks-service-DeletedBy"
            createdAt:
              $ref: "#/components/schemas/brickworks-service-CreatedAt"
            updatedAt:
              $ref: "#/components/schemas/brickworks-service-UpdatedAt"
            publishedAt:
              $ref: "#/components/schemas/brickworks-service-PublishedAt"
            deletedAt:
              $ref: "#/components/schemas/brickworks-service-DeletedAt"
            slug:
              $ref: "#/components/schemas/brickworks-service-RecordSlug"
            status:
              $ref: "#/components/schemas/brickworks-service-RecordStatus"
            values:
              $ref: "#/components/schemas/brickworks-service-RecordValues"
            schemaVersion:
              type: integer
              format: int32
              description: The ID of the schema version that was used when this record was last updated. For simple schemas, this is always `1`.
            recordVersion:
              $ref: "#/components/schemas/brickworks-service-RecordVersionNumber"
            schedule:
              $ref: "#/components/schemas/brickworks-service-ScheduleEntry"
    brickworks-service-AddRecordToSchemaRequest:
      type: object
      x-class-name: AddRecordToSchemaRequest
      x-interface-name-ts: AddRecordToSchemaRequest
      required:
        - values
        - status
      properties:
        slug:
          $ref: "#/components/schemas/brickworks-service-RecordSlug"
        values:
          $ref: "#/components/schemas/brickworks-service-RecordValues"
        status:
          $ref: "#/components/schemas/brickworks-service-RecordStatus"
        actionOnSchedule:
          $ref: "#/components/schemas/brickworks-service-ScheduleType"
        schedule:
          $ref: "#/components/schemas/brickworks-service-ScheduleEntry"
        name:
          $ref: "#/components/schemas/brickworks-service-RecordName"
    brickworks-service-ScheduleType:
      type: string
      x-class-name: ScheduleType
      x-interface-name-ts: ScheduleType
      enum:
        - PUBLISH
    brickworks-service-UpdateRecordRequest:
      type: object
      x-class-name: UpdateRecordRequest
      x-interface-name-ts: UpdateRecordRequest
      properties:
        status:
          $ref: "#/components/schemas/brickworks-service-RecordStatus"
        values:
          $ref: "#/components/schemas/brickworks-service-RecordValues"
        actionOnSchedule:
          $ref: "#/components/schemas/brickworks-service-ScheduleType"
        schedule:
          $ref: "#/components/schemas/brickworks-service-ScheduleEntry"
        slug:
          $ref: "#/components/schemas/brickworks-service-RecordSlug"
        lastUpdatedAt:
          type: string
          description: |
            If updating a draft keeping the draft status, you can check if it was updated by another request in the meantime:
              1. Fetch a draft record.
              2. Copy the `updatedAt` property into your update request.
              3. Make other changes in the record.
              4. Send the update.
              5. If the update time you sent is different than the one in the database, it means that the record was updated since you last fetched it. Your update is ignored and error BKW-029 (HTTP 409) is returned.
          format: date-time
        name:
          $ref: "#/components/schemas/brickworks-service-RecordName"
        fromState:
          $ref: "#/components/schemas/brickworks-service-RecordStatus"
    brickworks-service-GeneratedObject:
      type: object
      x-class-name: GeneratedObject
      x-interface-name-ts: GeneratedObject
      description: Processed content of a record
      properties:
        __slug:
          $ref: "#/components/schemas/brickworks-service-RecordSlug"
        __recordVersion:
          $ref: "#/components/schemas/brickworks-service-RecordVersionNumber"
        __publishedAt:
          type: string
          format: date-time
          description: Record publishing time
        __updatedAt:
          type: string
          format: date-time
          description: Last record update time
        __schemaId:
          $ref: "#/components/schemas/brickworks-service-SchemaId"
        __id:
          $ref: "#/components/schemas/brickworks-service-RecordId"
        __schemaVersion:
          $ref: "#/components/schemas/brickworks-service-SchemaVersion"
        __createdAt:
          type: string
          format: date-time
          description: Record creation time
        __matchedAudience:
          type: boolean
          description: |
            Indicates whether the client matched the audience defined on the schema. `true` when the client belongs to the target audience (or when no audience is defined), `false` when the client does not match the top-level schema audience.
        __unmatchedAudienceRelations:
          type: array
          description: |
            List of relation field names whose referenced schemas have an audience that the client did not match. These fields are returned as `null` in the response. Only present when at least one relation is audience-restricted for the given client.
          items:
            type: string
      additionalProperties: true
      example:
        __slug: my-record-slug
        __recordVersion: 1
        __publishedAt: 2024-01-15T10:30:00Z
        __updatedAt: 2024-01-15T10:30:00Z
        __schemaId: 550e8400-e29b-41d4-a716-446655440000
        __id: 550e8400-e29b-41d4-a716-446655440001
        __schemaVersion: 1
        __createdAt: 2024-01-15T10:30:00Z
        customStringField: string value
        customNumberField: 123.45
        customBooleanField: true
        customDateField: 2024-01-15
        customArrayField:
          - item1
          - item2
        customObjectField:
          nestedKey: nestedValue
        __matchedAudience: true
        __unmatchedAudienceRelations:
          - deniedRefField
    brickworks-service-GenerateRequest:
      type: object
      x-class-name: GenerateRequest
      x-interface-name-ts: GenerateRequest
      required:
        - identifierValue
      properties:
        identifierValue:
          type: string
          description: Value of the profile identifier selected in `identifierType` (profile ID is sent as a string)
        context:
          $ref: "#/components/schemas/brickworks-service-Context"
        fieldContext:
          $ref: "#/components/schemas/brickworks-service-FieldContext"
    brickworks-service-FieldContext:
      type: object
      x-class-name: FieldContext
      x-interface-name-ts: FieldContext
      description: Additional context parameters used in recommendation and relation fields.
      additionalProperties:
        $ref: "#/components/schemas/brickworks-service-FieldContextItem"
    brickworks-service-FieldContextItem:
      type: object
      x-class-name: FieldContextItem
      x-interface-name-ts: FieldContextItem
      description: The names of the objects correspond to the names of the fields where the object's data is used
      additionalProperties: true
      example:
        page: 1
        limit: 10
        itemId: item-123
        additionalFilters: custom filter value
    brickworks-service-Context:
      type: object
      x-class-name: Context
      x-interface-name-ts: Context
      description: Additional context parameters. You can use these parameters in Jinjava fields by calling `{{ context.keyName }}`. The value will be printed as a string.
      additionalProperties:
        description: In Jinjava, you can retrieve the value of a key from this object by `{{ context.keyName }}`
    brickworks-service-GenerateRequestWithoutIdentifier:
      type: object
      x-class-name: GenerateRequestWithoutIdentifier
      x-interface-name-ts: GenerateRequestWithoutIdentifier
      properties:
        context:
          $ref: "#/components/schemas/brickworks-service-Context"
        fieldContext:
          $ref: "#/components/schemas/brickworks-service-FieldContext"
    brickworks-service-PreviewRequest:
      type: object
      x-class-name: PreviewRequest
      x-interface-name-ts: PreviewRequest
      required:
        - identifierValue
        - schema
      properties:
        identifierValue:
          type: string
          description: Value of the profile identifier selected in `identifierType` (profile ID is sent as a string)
        context:
          $ref: "#/components/schemas/brickworks-service-Context"
        fieldContext:
          $ref: "#/components/schemas/brickworks-service-FieldContext"
        values:
          $ref: "#/components/schemas/brickworks-service-PreviewValues"
        schema:
          $ref: "#/components/schemas/brickworks-service-SchemaPreviewData"
    brickworks-service-SchemaPreviewData:
      type: object
      x-class-name: SchemaPreviewData
      x-interface-name-ts: SchemaPreviewData
      description: Schema preview data
      required:
        - schemaType
      properties:
        fields:
          $ref: "#/components/schemas/brickworks-service-FieldsObject"
        audience:
          $ref: "#/components/schemas/brickworks-service-Audience"
        schemaType:
          $ref: "#/components/schemas/brickworks-service-SchemaType"
    brickworks-service-PreviewValues:
      type: object
      x-class-name: PreviewValues
      x-interface-name-ts: PreviewValues
      description: The values for fields in the record, to be used when generating the preview.
      additionalProperties:
        description: Each key in this object corresponds to a field name.
    brickworks-service-PreviewRequestWithoutIdentifier:
      type: object
      x-class-name: PreviewRequestWithoutIdentifier
      x-interface-name-ts: PreviewRequestWithoutIdentifier
      required:
        - schema
      properties:
        context:
          $ref: "#/components/schemas/brickworks-service-Context"
        fieldContext:
          $ref: "#/components/schemas/brickworks-service-FieldContext"
        values:
          $ref: "#/components/schemas/brickworks-service-PreviewValues"
        schema:
          $ref: "#/components/schemas/brickworks-service-SchemaPreviewData"
    brickworks-service-ExternalSourcePagingResult:
      type: object
      x-class-name: ExternalSourcePagingResult
      x-interface-name-ts: ExternalSourcePagingResult
      required:
        - meta
        - data
      properties:
        meta:
          $ref: "#/components/schemas/brickworks-service-Meta"
        data:
          type: array
          description: Array of external sources
          items:
            $ref: "#/components/schemas/brickworks-service-ExternalSourceSimplifiedView"
    brickworks-service-ExternalSourceSimplifiedView:
      type: object
      x-class-name: ExternalSourceSimplifiedView
      x-interface-name-ts: ExternalSourceSimplifiedView
      properties:
        id:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceId"
        name:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceName"
        method:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceMethod"
        description:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceDescription"
        sourceType:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceSourceType"
        createdBy:
          $ref: "#/components/schemas/brickworks-service-CreatedBy"
        createdAt:
          $ref: "#/components/schemas/brickworks-service-CreatedAt"
        updatedBy:
          $ref: "#/components/schemas/brickworks-service-UpdatedBy"
        updatedAt:
          $ref: "#/components/schemas/brickworks-service-UpdatedAt"
      required:
        - id
        - name
        - createdBy
        - createdAt
        - updatedAt
    brickworks-service-ExternalSourceSourceType:
      type: string
      x-class-name: ExternalSourceType
      x-interface-name-ts: ExternalSourceType
      enum:
        - http_source
    brickworks-service-ExternalSourceDescription:
      type: string
      maxLength: 255
      description: Description of the external source
    brickworks-service-ExternalSourceMethod:
      type: string
      description: The HTTP method used in the external request. The `body` and `bodySchema` properties can only be used in POST requests.
      enum:
        - post
        - get
    brickworks-service-ExternalSourceName:
      type: string
      description: Human-readable name of the external resource
      maxLength: 255
    brickworks-service-ExternalSourceId:
      type: string
      description: Unique ID of the external source definition
      format: uuid
    brickworks-service-ExternalSourceModel:
      type: object
      x-class-name: ExternalSourceModel
      x-interface-name-ts: ExternalSourceModel
      properties:
        id:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceId"
        name:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceName"
        description:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceDescription"
        properties:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceProperties"
        createdBy:
          $ref: "#/components/schemas/brickworks-service-CreatedBy"
        createdAt:
          $ref: "#/components/schemas/brickworks-service-CreatedAt"
        updatedBy:
          $ref: "#/components/schemas/brickworks-service-UpdatedBy"
        updatedAt:
          $ref: "#/components/schemas/brickworks-service-UpdatedAt"
        ttl:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceTtl"
      required:
        - id
        - name
        - properties
        - createdBy
        - createdAt
        - updatedAt
    brickworks-service-ExternalSourceTtl:
      type: number
      format: int32
      description: Cache TTL for connection response, in seconds
    brickworks-service-ExternalSourceProperties:
      type: object
      x-class-name: ExternalSourceProperties
      x-interface-name-ts: ExternalSourceProperties
      description: The details of the external source configuration
      properties:
        sourceType:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceSourceType"
        url:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceUrl"
        method:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceMethod"
        headers:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceHeaders"
        params:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceParams"
        authType:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceAuthType"
        authId:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceAuthId"
        body:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceBody"
        bodySchema:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceBodySchema"
      required:
        - sourceType
        - url
        - method
    brickworks-service-ExternalSourceBodySchema:
      type: object
      title: External source body schema
      x-class-name: ExternalSourceBodySchema
      x-interface-name-ts: ExternalSourceBodySchema
      description: A schema which defines which fields in the request body have dynamic values inserted with Jinjava. Static parameters don't need to be listed in this schema.
      properties:
        properties:
          description: |
            The properties in the request body. You only need to define dynamic values (jinjava strings), and if they are nested in an object, use the `object` schema to define that structure.
          type: object
          additionalProperties:
            $ref: "#/components/schemas/brickworks-service-BodySchemaEntity"
        type:
          type: string
          description: Objects can include or other objects (recursive schema)
          enum:
            - object
        subtype:
          $ref: "#/components/schemas/brickworks-service-KeyValueSubtype"
        additionalProperties:
          type: boolean
          description: Defines if the object can include other properties than the one listed in the schema
          enum:
            - true
      example:
        type: object
        subtype: key_value
        properties:
          someObject:
            type: object
            subtype: key_value
            properties:
              key:
                type: string
                subtype: jinjava
            additionalProperties: true
          dynamicField:
            type: string
            subtype: jinjava
        additionalProperties: true
    brickworks-service-BodySchemaEntity:
      type: object
      x-class-name: BodySchemaEntity
      x-interface-name-ts: BodySchemaEntity
      description: The object name corresponds to a key name in the request body.
      additionalProperties:
        oneOf:
          - $ref: "#/components/schemas/brickworks-service-ExternalSourceBodySchema"
          - $ref: "#/components/schemas/brickworks-service-BodySchemaString"
        discriminator:
          propertyName: subtype
          mapping:
            jinjava: "#/components/schemas/brickworks-service-BodySchemaString"
            key_value: "#/components/schemas/brickworks-service-ExternalSourceBodySchema"
      x-typescript-type: "{ [key: string]: BodySchemaEntity }"
    brickworks-service-BodySchemaString:
      type: object
      title: String
      x-class-name: BodySchemaString
      x-interface-name-ts: BodySchemaString
      properties:
        type:
          $ref: "#/components/schemas/brickworks-service-StringType"
        subtype:
          $ref: "#/components/schemas/brickworks-service-JinJavaSubtype"
        settings:
          $ref: "#/components/schemas/brickworks-service-JinJavaSettings"
    brickworks-service-ExternalSourceBody:
      type: object
      x-class-name: ExternalSourceBody
      x-interface-name-ts: ExternalSourceBody
      description: The request body sent to the external source
      additionalProperties:
        description: JSON content. If you want to use JinJava in a value, use `bodySchema` to define which fields accept Jinjava.
      example:
        someString: string
        someObject:
          key: "{% customer email %}"
        dynamicField: "{% customer id %}"
    brickworks-service-ExternalSourceAuthId:
      type: string
      format: uuid
      description: Unique identifier of a [connection](https://hub.synerise.com/docs/settings/tool/connections/) used by this external source.
    brickworks-service-ExternalSourceAuthType:
      type: string
      x-class-name: ExternalSourceAuthType
      x-interface-name-ts: ExternalSourceAuthType
      enum:
        - basic
        - api_key
        - custom
      description: The mode of authentication used by this external source
    brickworks-service-ExternalSourceParams:
      type: object
      x-class-name: ExternalSourceParams
      x-interface-name-ts: ExternalSourceParams
      description: Query parameters added to the URL
      additionalProperties:
        type: string
        description: A key/value pair
    brickworks-service-ExternalSourceHeaders:
      type: object
      x-class-name: ExternalSourceHeaders
      x-interface-name-ts: ExternalSourceHeaders
      description: Headers added to the request
      additionalProperties:
        type: string
        description: Each key is the name of the header, and the value is the header's value.
    brickworks-service-ExternalSourceUrl:
      type: string
      description: URL address of the resource, including the `https` protocol. May include Jinjava inserts.
      example: https://example.com/clients/{% customer email %}
    brickworks-service-CreateExternalSourceRequest:
      type: object
      x-class-name: CreateExternalSourceRequest
      x-interface-name-ts: CreateExternalSourceRequest
      properties:
        name:
          type: string
        description:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceDescription"
        properties:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceProperties"
        ttl:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceTtl"
      required:
        - name
        - properties
    brickworks-service-UpdateExternalSourceRequest:
      type: object
      x-class-name: UpdateExternalSourceRequest
      x-interface-name-ts: UpdateExternalSourceRequest
      properties:
        name:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceName"
        description:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceDescription"
        properties:
          $ref: "#/components/schemas/brickworks-service-ExternalSourceProperties"
        ttl:
          type: number
          format: int32
    brickworks-service-RecordVersionPagingResult:
      type: object
      x-class-name: RecordVersionPagingResult
      x-interface-name-ts: RecordVersionPagingResult
      required:
        - meta
        - data
      properties:
        meta:
          $ref: "#/components/schemas/brickworks-service-Meta"
        data:
          type: array
          description: Array of record versions
          items:
            $ref: "#/components/schemas/brickworks-service-RecordVersion"
    brickworks-service-RecordVersion:
      x-class-name: RecordVersion
      x-interface-name-ts: RecordVersion
      allOf:
        - type: object
          properties:
            versionId:
              format: uuid
              type: string
              description: Unique identifier of a record version
        - $ref: "#/components/schemas/brickworks-service-Record"
    brickworks-service-207ResponseBody:
      type: array
      x-class-name: ResponseBody207
      x-interface-name-ts: ResponseBody207
      items:
        type: object
        properties:
          identifier:
            type: object
            properties:
              name:
                type: string
                description: The name of the identifier you used
              value:
                type: string
                description: The value of the identifier
          errors:
            type: array
            description: Errors that occurred for this record
            items:
              $ref: "#/components/schemas/brickworks-service-ObjectsError"
    brickworks-service-AsyncRecordRequest:
      type: object
      x-class-name: AsyncRecordRequest
      x-interface-name-ts: AsyncRecordRequest
      description: Async record request
      required:
        - identifier
        - values
      properties:
        identifier:
          type: object
          description: Definition of a unique identifier of a record
          properties:
            name:
              type: string
              description: |
                The name of the identifier. By default, `slug` and `id` are always available. You can also use a field that was configured as `unique`.

                In this field, provide the current identifier. If you want to change the identifier with the request, send it in `values` (for unique fields) or `slug`.
            value:
              description: The value of the selected identifier (slug or a field that was configured as unique)
              oneOf:
                - type: string
                - type: number
                - type: boolean
        values:
          $ref: "#/components/schemas/brickworks-service-RecordValues"
        slug:
          $ref: "#/components/schemas/brickworks-service-RecordSlug"
        name:
          $ref: "#/components/schemas/brickworks-service-RecordName"
  parameters:
    brickworks-service-querySchemaTypes:
      name: schemaTypes
      in: query
      description: Comma-separated list of schema types to filter the results. By default, all types are retrieved.
      required: false
      style: form
      explode: false
      schema:
        type: string
        enum:
          - SIMPLE
          - VERSIONED
    brickworks-service-querySortBy:
      name: sortBy
      description: |
        You can change the default sorting. The sorting direction is selected by adding `asc` or `desc`, for example `sortBy=createdAt:desc`.

        You can sort by:
          - `appId` 
          - `displayName`
          - `createdAt`
          - `updatedAt`
      in: query
      required: false
      style: form
      explode: true
      schema:
        type: string
        example: updatedAt:asc
        default: updatedAt:desc
    brickworks-service-querySearch:
      name: search
      in: query
      required: false
      description: |
        A string to search for in:
        - `id`
        - `appId`
        - `displayName`
        - `description`
      schema:
        type: string
    brickworks-service-queryPage:
      name: page
      in: query
      required: false
      description: The number of the page to retrieve
      schema:
        type: integer
        format: int32
        minimum: 1
        default: 1
    brickworks-service-queryLimit:
      name: limit
      in: query
      required: false
      description: Limit of items per page
      schema:
        type: integer
        format: int32
        default: 50
    brickworks-service-pathSchemaIdentifier:
      name: SchemaIdentifier
      in: path
      required: true
      description: Schema identifier - can be a UUID (SchemaId) or a human-readable string (Schema AppId/API name, 3-25 characters)
      schema:
        oneOf:
          - type: string
            format: uuid
            title: Schema UUID
          - type: string
            minLength: 3
            maxLength: 25
            pattern: ^(?!__)(?![0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$)[\w\-]+$
            title: Schema AppId
      examples:
        uuid:
          value: 550e8400-e29b-41d4-a716-446655440000
          summary: Schema UUID
        appId:
          value: my-schema-app-id
          summary: Schema AppId (API name)
    brickworks-service-queryFields:
      name: fields
      in: query
      required: false
      description: A comma-separated list of fields to retrieve. If not defined, all fields are included in the response.
      schema:
        type: array
        items:
          type: string
    brickworks-service-querySlugs:
      name: slugs
      in: query
      description: Comma-separated list of slugs to filter results through
      required: false
      style: form
      explode: false
      schema:
        type: string
    brickworks-service-queryStatuses:
      name: statuses
      in: query
      description: Comma-separated list of record statuses to filter the results.
      required: false
      style: form
      explode: false
      schema:
        type: string
        enum:
          - PUBLISHED
          - DRAFT
          - UNPUBLISHED
          - SCHEDULED
    brickworks-service-queryIds:
      name: ids
      in: query
      description: Comma-separated list of IDs (in UUID format) to filter results through
      required: false
      style: form
      explode: false
      schema:
        type: string
    brickworks-service-querySortByRecords:
      name: sortBy
      description: |
        You can change the default sorting. The sorting direction is selected by adding `asc` or `desc`, for example `sortBy=__createdAt:desc`.

        System parameters are prefixed with `__` to avoid name collisions with fields you add to the schema.  

        You can sort by:
          - `__id`
          - `__createdAt`
          - `__updatedAt`
      in: query
      required: false
      style: form
      explode: true
      schema:
        type: string
        example: __updatedAt:asc
        default: __updatedAt:desc
    brickworks-service-querySearchRecords:
      name: search
      in: query
      required: false
      description: |
        A string to search for in the values of searchable fields.  
        If `filter` is used, this parameter is ignored.
      schema:
        type: string
    brickworks-service-queryRecordFilters:
      name: filters
      in: query
      required: false
      schema:
        type: string
        description: |
          An RSQL query to filter the results.  
          You can use these fields:
          - fields configured as searchable
          - `__id`
          - `__schemaId`
          - `__name`
          - `__slug`
          - `__status`
          - `__updatedAt`
          - `__createdAt`
          - `__publishedAt`
          - `__recordVersion`
    brickworks-service-pathRecordIdentifier:
      name: RecordIdentifier
      in: path
      required: true
      description: Record identifier - can be a UUID (RecordId) or a human-readable slug (RecordSlug, 6-40 characters)
      schema:
        oneOf:
          - type: string
            format: uuid
            title: Record UUID
          - type: string
            minLength: 6
            maxLength: 40
            pattern: ^(?!__)(?![0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$)[\w\-]+$
            title: Record slug
      examples:
        uuid:
          value: f6ce33ee-bdf2-4a23-87be-07de936ceeab
          summary: Record UUID
        slug:
          value: my-record-slug
          summary: Record slug
    brickworks-service-pathIdentifierType:
      name: IdentifierType
      in: path
      required: true
      description: Profile identifier type
      schema:
        type: string
        enum:
          - id
          - uuid
          - email
          - custom_identify
    brickworks-service-methodQueryParam:
      name: method
      description: |
        You can filter the results by source http method.
      in: query
      required: false
      style: form
      explode: true
      schema:
        type: string
        enum:
          - get
          - post
    brickworks-service-pathExternalDataSourceId:
      name: ExternalDataSourceId
      in: path
      required: true
      description: External source ID
      schema:
        type: string
        format: uuid
    brickworks-service-pathRecordVersionIdentifier:
      name: RecordVersionIdentifier
      in: path
      required: true
      description: Record version identifier - can be a UUID (RecordVersionId) or a version number (integer)
      schema:
        oneOf:
          - type: string
            format: uuid
            title: Record version UUID
          - type: integer
            format: int32
            minimum: 1
            title: Record version Number
      examples:
        uuid:
          value: 6da06fc3-046b-4546-8247-2ad7be652e78
          summary: Record Version UUID
        versionNumber:
          value: 1
          summary: Record version number
  responses:
    brickworks-service-GenericError:
      description: See error message for details.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/brickworks-service-ObjectsError"
    brickworks-service-GenericUnprocessableContentError:
      description: The request was well-formed but could not be processed due to semantic or domain-related constraints. See error message for details.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/brickworks-service-ObjectsError"
    brickworks-service-GenericConflictError:
      description: The request could not be completed due to a conflict with the current state of the resource. See error message for details.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/brickworks-service-ObjectsError"
    brickworks-service-GenericNotFoundError:
      description: Resource not found. See error message for details.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/brickworks-service-ObjectsError"
    brickworks-service-GenericForbiddenError:
      description: Forbidden; insufficient permissions. See error message for details.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/brickworks-service-GatewayError"
    brickworks-service-GenericUnauthorizedError:
      description: "Unauthorized: wrong consumer scope; token missing/expired/invalid; invalid API key; etc. See error message for details."
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/brickworks-service-GatewayError"
    brickworks-service-GenericBadRequestError:
      description: Incorrect request (malformed JSON, wrong parameters, etc.). See error message for details.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/brickworks-service-ObjectsError"
    brickworks-service-GeneratedObject:
      description: Processed content of a record
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/brickworks-service-GeneratedObject"
    brickworks-service-207Response:
      description: Some operations failed
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/brickworks-service-207ResponseBody"
