---
title: /spark/commands
slug: amberflo-api/sparkcommands
docTags: 
createdAt: 2024-11-07T15:10:16.980Z
---

{
  "id": "c3Cm0e80hyIV_LkhcRIA5",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.amberflo.io/spark/commands",
    "servers": [
      {
        "url": "https://app.amberflo.io/spark/commands"
      }
    ],
    "name": "",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "array",
          "description": "",
          "customType": "com.amberflo.spark.pipeline.SparkCommand.in[]",
          "schema": [],
          "modelRef": "#/components/schemas/com.amberflo.spark.pipeline.SparkCommand.in",
          "complexItems": [
            {
              "name": "object",
              "schema": [
                {
                  "name": "type",
                  "kind": "optional",
                  "type": "string",
                  "example": "",
                  "default": "analytics_snapshot"
                },
                {
                  "name": "accountId",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "meterApiName",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "deduplicationId",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "windowStartTimeInSeconds",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "windowEndTimeInSeconds",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                }
              ],
              "modelRef": "#/components/schemas/com.amberflo.spark.pipeline.commands.experimental.CreateAnalyticsSnapshotCommand.in",
              "customType": "com.amberflo.spark.pipeline.commands.experimental.CreateAnalyticsSnapshotCommand.in"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "type",
                  "kind": "optional",
                  "type": "string",
                  "example": "",
                  "default": "mau_bootstrap"
                },
                {
                  "name": "accountId",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "meterApiName",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "deduplicationId",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "weekToRunInSeconds",
                  "kind": "optional",
                  "type": "integer<int64>",
                  "example": 0
                }
              ],
              "modelRef": "#/components/schemas/com.amberflo.spark.pipeline.commands.experimental.MauHistoryBootstrapCommand.in",
              "customType": "com.amberflo.spark.pipeline.commands.experimental.MauHistoryBootstrapCommand.in"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "type",
                  "kind": "optional",
                  "type": "string",
                  "example": "",
                  "default": "merge_hourly_ingest_events"
                },
                {
                  "name": "accountId",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "meterApiName",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "deduplicationId",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "hourToRunInSeconds",
                  "kind": "optional",
                  "type": "integer<int64>",
                  "example": 0
                },
                {
                  "name": "meterApiNames",
                  "kind": "optional",
                  "type": "array",
                  "example": "",
                  "itemType": "string",
                  "customType": "string[]",
                  "itemExample": "",
                  "itemDefault": ""
                }
              ],
              "modelRef": "#/components/schemas/com.amberflo.spark.pipeline.commands.experimental.MergeHourlyIngestEventsCommand.in",
              "customType": "com.amberflo.spark.pipeline.commands.experimental.MergeHourlyIngestEventsCommand.in"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "type",
                  "kind": "optional",
                  "type": "string",
                  "example": "",
                  "default": "processed_hourly_events"
                },
                {
                  "name": "accountId",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "meterApiName",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "deduplicationId",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "hourToRunInSeconds",
                  "kind": "optional",
                  "type": "integer<int64>",
                  "example": 0
                }
              ],
              "modelRef": "#/components/schemas/com.amberflo.spark.pipeline.commands.experimental.ProcessedHourlyEventsCommand.in",
              "customType": "com.amberflo.spark.pipeline.commands.experimental.ProcessedHourlyEventsCommand.in"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "type",
                  "kind": "optional",
                  "type": "string",
                  "example": "",
                  "default": "spark_pi"
                },
                {
                  "name": "accountId",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "meterApiName",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "deduplicationId",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "sliceCount",
                  "kind": "optional",
                  "type": "integer<int32>",
                  "example": 0
                }
              ],
              "modelRef": "#/components/schemas/com.amberflo.spark.pipeline.commands.SparkPiCommand.in",
              "customType": "com.amberflo.spark.pipeline.commands.SparkPiCommand.in"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "type",
                  "kind": "optional",
                  "type": "string",
                  "example": "",
                  "default": "update_history"
                },
                {
                  "name": "accountId",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "meterApiName",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "deduplicationId",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "hourToRunInSeconds",
                  "kind": "optional",
                  "type": "integer<int64>",
                  "example": 0
                }
              ],
              "modelRef": "#/components/schemas/com.amberflo.spark.pipeline.commands.experimental.UpdateHistoryCommand.in",
              "customType": "com.amberflo.spark.pipeline.commands.experimental.UpdateHistoryCommand.in"
            }
          ],
          "complexType": "oneOf",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "X-API-KEY",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful request",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "com.amberflo.spark.pipeline.SparkCommand.out[]",
            "schema": [],
            "modelRef": "#/components/schemas/com.amberflo.spark.pipeline.SparkCommand.out",
            "complexItems": [
              {
                "name": "object",
                "schema": [
                  {
                    "name": "type",
                    "kind": "optional",
                    "type": "string",
                    "example": "",
                    "default": "analytics_snapshot"
                  },
                  {
                    "name": "accountId",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "meterApiName",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "deduplicationId",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "windowStartTimeInSeconds",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "windowEndTimeInSeconds",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  }
                ],
                "modelRef": "#/components/schemas/com.amberflo.spark.pipeline.commands.experimental.CreateAnalyticsSnapshotCommand.out",
                "customType": "com.amberflo.spark.pipeline.commands.experimental.CreateAnalyticsSnapshotCommand.out"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "type",
                    "kind": "optional",
                    "type": "string",
                    "example": "",
                    "default": "mau_bootstrap"
                  },
                  {
                    "name": "accountId",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "meterApiName",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "deduplicationId",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "weekToRunInSeconds",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "example": 0
                  }
                ],
                "modelRef": "#/components/schemas/com.amberflo.spark.pipeline.commands.experimental.MauHistoryBootstrapCommand.out",
                "customType": "com.amberflo.spark.pipeline.commands.experimental.MauHistoryBootstrapCommand.out"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "type",
                    "kind": "optional",
                    "type": "string",
                    "example": "",
                    "default": "merge_hourly_ingest_events"
                  },
                  {
                    "name": "accountId",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "meterApiName",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "deduplicationId",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "hourToRunInSeconds",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "example": 0
                  },
                  {
                    "name": "meterApiNames",
                    "kind": "optional",
                    "type": "array",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  }
                ],
                "modelRef": "#/components/schemas/com.amberflo.spark.pipeline.commands.experimental.MergeHourlyIngestEventsCommand.out",
                "customType": "com.amberflo.spark.pipeline.commands.experimental.MergeHourlyIngestEventsCommand.out"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "type",
                    "kind": "optional",
                    "type": "string",
                    "example": "",
                    "default": "processed_hourly_events"
                  },
                  {
                    "name": "accountId",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "meterApiName",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "deduplicationId",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "hourToRunInSeconds",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "example": 0
                  }
                ],
                "modelRef": "#/components/schemas/com.amberflo.spark.pipeline.commands.experimental.ProcessedHourlyEventsCommand.out",
                "customType": "com.amberflo.spark.pipeline.commands.experimental.ProcessedHourlyEventsCommand.out"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "type",
                    "kind": "optional",
                    "type": "string",
                    "example": "",
                    "default": "spark_pi"
                  },
                  {
                    "name": "accountId",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "meterApiName",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "deduplicationId",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "sliceCount",
                    "kind": "optional",
                    "type": "integer<int32>",
                    "example": 0
                  }
                ],
                "modelRef": "#/components/schemas/com.amberflo.spark.pipeline.commands.SparkPiCommand.out",
                "customType": "com.amberflo.spark.pipeline.commands.SparkPiCommand.out"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "type",
                    "kind": "optional",
                    "type": "string",
                    "example": "",
                    "default": "update_history"
                  },
                  {
                    "name": "accountId",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "meterApiName",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "deduplicationId",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "hourToRunInSeconds",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "example": 0
                  }
                ],
                "modelRef": "#/components/schemas/com.amberflo.spark.pipeline.commands.experimental.UpdateHistoryCommand.out",
                "customType": "com.amberflo.spark.pipeline.commands.experimental.UpdateHistoryCommand.out"
              }
            ],
            "complexType": "oneOf",
            "isExpanded": true
          }
        ]
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "Zlu9ftnsvW-611sxEkB5o",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://app.amberflo.io/spark/commands \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '[\n     {\n     \"type\": \"analytics_snapshot\"\n     }\n     ]'"
        },
        {
          "id": "boWzJbJbDw3d2zbyyNy7q",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify([\n   {\n      \"type\": \"analytics_snapshot\"\n   }\n]);\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://app.amberflo.io/spark/commands\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "OKjt8nY6jXkYIAyTpKujn",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://app.amberflo.io/spark/commands\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump([\n   {\n      \"type\": \"analytics_snapshot\"\n   }\n])\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "A7fTevRYOC4sijwcYrtJ6",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/spark/commands\"\n\npayload = json.dumps([\n   {\n      \"type\": \"analytics_snapshot\"\n   }\n])\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "Zlu9ftnsvW-611sxEkB5o"
    },
    "results": {
      "languages": [
        {
          "id": "CZLaJYeO83jilLKpZTkWL",
          "language": "200",
          "code": "// Successful request\n[\n  \"\"\n]"
        }
      ],
      "selectedLanguageId": "CZLaJYeO83jilLKpZTkWL"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}