---
title: Get All Tenants
slug: single-connect-api-3-0-3/get-all-tenants
description: Learn how to retrieve a comprehensive list of tenants using a curl code example in this document. Discover the necessary headers to include in your GET request, allowing you to seamlessly send and accept JSON data. Enhance your coding skills and effortles
docTags: 
createdAt: 2022-11-10T14:21:49.000Z
---

{
  "id": "FQcsqL35r14t_Ke0P0WDm",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/Multitenancy/getAllTenants",
    "method": "GET",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [
        {
          "name": "X-XSRF-TOKEN",
          "type": "string",
          "example": "{{csrftoken}}",
          "description": ""
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This API lists existing tenants in the platform.",
    "examples": {
      "languages": [
        {
          "id": "YdanO9TgvkesfsXpIaxoq",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url {{url}}/aioc-rest-web/rest/Multitenancy/getAllTenants \\\n     --header 'accept: application/json'"
        },
        {
          "id": "OnTGgwaoeVKizDEB-zTcK",
          "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(\"{{url}}/aioc-rest-web/rest/Multitenancy/getAllTenants\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "Z2DsUc8Qs4QIim1CE30M1",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/Multitenancy/getAllTenants\")\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": "OL6ianbgjCgI7tpfF9SEU",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/aioc-rest-web/rest/Multitenancy/getAllTenants\"\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": "YdanO9TgvkesfsXpIaxoq"
    },
    "results": {
      "languages": [
        {
          "id": "SiottHdvUVIhos9EIZO-W",
          "language": "200",
          "code": ""
        }
      ],
      "selectedLanguageId": "SiottHdvUVIhos9EIZO-W"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}