---
title: Get customer lifecycle stage history by id
slug: amberflo-api/get-customer-lifecycle-stage-history-by-id
docTags: 
createdAt: 2024-11-07T15:10:16.978Z
---

{
  "id": "71joWhxsRay_gDuAKVyRb",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://app.amberflo.io/customers/stage/history/{customerId}",
    "servers": [
      {
        "url": "https://app.amberflo.io/customers/stage/history/{customerId}"
      }
    ],
    "name": "Get customer lifecycle stage history by id",
    "description": "Returns the lifecycle stage history of the selected customer.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "customerId",
          "type": "string",
          "description": "Id of the target customer"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [],
      "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": "metadata.customer.CustomerLifecycleStageRecord.out[]",
            "schema": [
              {
                "name": "customerId",
                "kind": "optional",
                "type": "string",
                "description": "Customer id, as used when creating the customer.",
                "example": ""
              },
              {
                "name": "startTimeInMillis",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "Start time of current lifecycle stage.",
                "example": 0
              },
              {
                "name": "lifecycleStage",
                "kind": "optional",
                "type": "string",
                "description": "Lifecycle stage of the customer.",
                "modelRef": "#/components/schemas/metadata.customer.CustomerLifecycleStage.out",
                "customType": "metadata.customer.CustomerLifecycleStage.out",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/metadata.customer.CustomerLifecycleStageRecord.out",
            "isExpanded": true
          }
        ]
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "U7LMS5jclFlK_4FHKcDXS",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://app.amberflo.io/customers/stage/history/{customerId} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "ZpQOqBSlt-NSYgDMMPmWA",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://app.amberflo.io/customers/stage/history/{customerId}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "u5XP1fdDsKvoNHNUS2SI9",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://app.amberflo.io/customers/stage/history/{customerId}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "POFv7_5kWpbadc9A904YB",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/customers/stage/history/{customerId}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "U7LMS5jclFlK_4FHKcDXS"
    },
    "results": {
      "languages": [
        {
          "id": "LcC4-vbf7GI-TTlPOKmDt",
          "language": "200",
          "code": "// Successful request\n[\n  {\n    \"customerId\": \"\",\n    \"startTimeInMillis\": \"\",\n    \"lifecycleStage\": \"\"\n  }\n]"
        }
      ],
      "selectedLanguageId": "LcC4-vbf7GI-TTlPOKmDt"
    }
  },
  "children": [
    {
      "id": "Tmo4l78o7fd-amBWVK_eL",
      "type": "paragraph",
      "children": [
        {
          "text": "Returns the lifecycle stage history of the selected customer."
        }
      ]
    }
  ]
}