---
title: Logout
slug: kron-pam-api-collection-340/logout
docTags: 
createdAt: 2024-07-12T13:38:00.272Z
---

{
  "id": "rZ2l4MUbS-BANVkPiGBP_",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "{{url}}/aioc-rest-web/rest/logout",
    "name": "",
    "description": "<h3>Overview</h3>\n<p>This method allows the currently logged-in user to log out from KRON PAM.</p>\n<p>Upon successful logout, the system returns a confirmation.</p>",
    "contentType": "application/json",
    "request": {
      "headerParameters": [
        {
          "name": "Content-Type",
          "description": "",
          "default": "application/json",
          "value": "application/json",
          "type": "string"
        },
        {
          "name": "X-XSRF-TOKEN",
          "description": "",
          "default": "{{csrftoken}}",
          "value": "{{csrftoken}}",
          "type": "string"
        }
      ],
      "queryParameters": [],
      "pathParameters": [
        {
          "name": "url",
          "description": "",
          "default": "url",
          "value": "url",
          "type": "string"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Logout",
        "jsonExample": "OK"
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "ljRwwvEJaj84Zbh-asD9m",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/logout \\\n     --header 'accept: application/json' \\\n     --header 'x-xsrf-token: {{csrftoken}}'"
        },
        {
          "id": "MRyRo9lpvNV71axSZtlZf",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-xsrf-token\", \"{{csrftoken}}\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/logout\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "9LMZ11DsCCniYZGWmOwyQ",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/logout\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-xsrf-token\"] = \"{{csrftoken}}\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "qayFilOxeClZL17ynYuWy",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/aioc-rest-web/rest/logout\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-xsrf-token': '{{csrftoken}}'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "ljRwwvEJaj84Zbh-asD9m"
    },
    "results": {
      "languages": [
        {
          "id": "yj2pC42ul6wPsvHik4UiV",
          "language": "200",
          "code": "OK"
        }
      ],
      "selectedLanguageId": "yj2pC42ul6wPsvHik4UiV"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}