---
title: List relations
slug: data-platform/api/list-relations
docTags: 
createdAt: 2026-09-02T14:41:00.110Z
---

{
  "id": "yqCZdEB9ZV6inLukt1QR_",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.us1.odp.optimizely.com/v3/schema/objects/{object_name}/relations",
    "servers": [
      {
        "url": "https://api.us1.odp.optimizely.com/v3/schema/objects/{object_name}/relations",
        "description": "United States"
      },
      {
        "url": "https://api.eu1.odp.optimizely.com/v3/schema/objects/{object_name}/relations",
        "description": "Europe"
      },
      {
        "url": "https://api.au1.odp.optimizely.com/v3/schema/objects/{object_name}/relations",
        "description": "Asia-Pacific"
      }
    ],
    "name": "List relations",
    "description": "List the details of all relationships of a specific object.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "object_name",
          "type": "string",
          "description": "The name of the object."
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "x-api-key",
          "name": "x-api-key",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "example": "[{\"name\":\"my_relation\",\"display_name\":\"My Relationship\",\"child_object\":\"child\",\"join_fields\":[{\"parent\":\"child_id\",\"child\":\"child_id\"}]},{\"name\":\"my_relation2\",\"display_name\":\"My Relationship 2\",\"child_object\":\"child\",\"join_fields\":[{\"parent\":\"child_id\",\"child\":\"child_id\"}]}]",
            "description": "",
            "customType": "Relation[]",
            "schema": [
              {
                "name": "child_object",
                "kind": "required",
                "type": "string",
                "description": "The name of the child object.",
                "example": "child"
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "<p>The name of the relationship (for example, ticket).</p>",
                "example": "relation_name"
              },
              {
                "name": "display_name",
                "kind": "required",
                "type": "string",
                "description": "<p>The human-readable name of the field (for example, Ticket).</p>",
                "example": "Relation Display Name"
              },
              {
                "name": "public_read",
                "kind": "required",
                "type": "string",
                "description": "Enable access with the API public key.",
                "example": false,
                "default": false
              },
              {
                "name": "join_fields",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "parent",
                    "kind": "required",
                    "type": "string",
                    "description": "<p>The name of the object that links to the child object (for example, id).</p>",
                    "example": "id"
                  },
                  {
                    "name": "child",
                    "kind": "optional",
                    "type": "string",
                    "description": "<p>The name of the child object that links to this object (for example, ticket_id).</p>",
                    "example": "child_id"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/Relation",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Bad Request",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "403",
        "description": "Forbidden",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "SJ8xUCCHTsQobk9HJ715a",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.us1.odp.optimizely.com/v3/schema/objects/{object_name}/relations \\\n     --header 'accept: application/json'"
        },
        {
          "id": "i8lv2l0egnKQg-wrLudKV",
          "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://api.us1.odp.optimizely.com/v3/schema/objects/{object_name}/relations\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "ON9dlOQhQ-DVBmYymObRO",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.us1.odp.optimizely.com/v3/schema/objects/{object_name}/relations\")\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": "73eAkSz0Za7948IZz3x-m",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.us1.odp.optimizely.com/v3/schema/objects/{object_name}/relations\"\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": "SJ8xUCCHTsQobk9HJ715a"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// OK\n[\n  {\n    \"child_object\": \"child\",\n    \"name\": \"relation_name\",\n    \"display_name\": \"Relation Display Name\",\n    \"public_read\": \"\",\n    \"join_fields\": [\n      {\n        \"parent\": \"id\",\n        \"child\": \"child_id\"\n      }\n    ]\n  }\n]"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Bad Request\n{}"
        },
        {
          "id": "response-2-403",
          "language": "403",
          "code": "// Forbidden\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}