---
title: Get a single goal
slug: get-a-single-goal
docTags: 
createdAt: 2026-05-04T13:13:49.254Z
---

{
  "id": "uJgeskqXSIHq4Qb9jLg_6",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/v1/goals/{id}",
    "servers": [],
    "name": "Get a single goal",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "description": "",
          "pattern": "\\d+"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "websiteId",
          "type": "string",
          "description": "",
          "default": null,
          "pattern": "\\d+"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "bearer",
          "name": "bearer",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Returned when successful",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Goal",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "integer",
                "description": ""
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "",
                "minLength": 1,
                "maxLength": 255
              },
              {
                "name": "system",
                "kind": "optional",
                "type": "boolean",
                "description": "",
                "default": false
              },
              {
                "name": "action",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "default",
                "kind": "optional",
                "type": "boolean",
                "description": "",
                "default": false
              },
              {
                "name": "value",
                "kind": "optional",
                "type": "integer",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/Goal",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Goal not found",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "YJlJ-lRr4BybkB_8NUnDd",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url '/v1/goals/{id}?websiteId=string' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "zmO-l4y7jbNaRFhQNPPol",
          "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(\"/v1/goals/{id}?websiteId=string\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "izNww_VhSX6nrYrnQAzOA",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"/v1/goals/{id}?websiteId=string\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "KM1j36XQcI5S99NscZLH3",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"/v1/goals/{id}?websiteId=string\"\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": "YJlJ-lRr4BybkB_8NUnDd"
    },
    "results": {
      "languages": [
        {
          "id": "Sf4HYZ9tL7ICKPnf45_ML",
          "language": "200",
          "code": "// Returned when successful\n{\n  \"id\": 0,\n  \"name\": \"\",\n  \"system\": false,\n  \"action\": \"\",\n  \"default\": false,\n  \"value\": 0\n}"
        },
        {
          "id": "bHZL6rSmaUklPLxo3zkSV",
          "language": "404",
          "code": "// Goal not found\n"
        }
      ],
      "selectedLanguageId": "Sf4HYZ9tL7ICKPnf45_ML"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}