{"_id":"574feca78b8fc60e00937b8b","project":"5633ebff7e9e880d00af1a53","__v":1,"parentDoc":null,"category":{"_id":"564503082c74cf1900da48b4","__v":13,"project":"5633ebff7e9e880d00af1a53","version":"5633ec007e9e880d00af1a56","pages":["564503117f1fff210078e707","564504a8b360ea0d00914852","564504aeb360ea0d00914854","564504b32229d7170010926d","564504bf6b0ca50d00f6bd6b","564504c62c74cf1900da48b9","564504ccd608df0d00d26a21","564504d72c74cf1900da48bb","564504df7f1fff210078e70b","564504e66b0ca50d00f6bd6e","564504ebb360ea0d00914858","568ade3697d8960d0012ab4c","568b2c687a42220d004982bf"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-11-12T21:22:16.300Z","from_sync":false,"order":6,"slug":"troubleshooting-common-errors","title":"Troubleshooting"},"user":"5636bfbf0441020d0000ea03","version":{"_id":"5633ec007e9e880d00af1a56","project":"5633ebff7e9e880d00af1a53","__v":15,"createdAt":"2015-10-30T22:15:28.105Z","releaseDate":"2015-10-30T22:15:28.105Z","categories":["5633ec007e9e880d00af1a57","5633f072737ea01700ea329d","5637a37d0704070d00f06cf4","5637cf4e7ca5de0d00286aeb","564503082c74cf1900da48b4","564503cb7f1fff210078e70a","567af26cb56bac0d0019d87d","567afeb8802b2b17005ddea0","567aff47802b2b17005ddea1","567b0005802b2b17005ddea3","568adfffcbd4ca0d00aebf7e","56ba80078cf7c9210009673e","574d127f6f075519007da3d0","574fde60aef76a0e00840927","57a22ba6cd51b22d00f623a0"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-06-02T08:21:59.414Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"The most common reason that users receive a 401 response is the authentication credentials are missing from the request. All Bonsai cluster URLs follow this format:\n\n```\nhttps://username:password:::at:::sub-domain.region.bonsai.io\n``` \n\nThe username and password in this URL are not the credentials used for logging in to Bonsai, but are randomly generated alphanumeric strings. Your URL might look something like:\n\n```\nhttps://kjh4k3j:lv9pngn9fs@my-awesome-cluster.us-east-1.bonsai.io\n```\n\nThe credentials `kjh4k3j:lv9pngn9fs` **must** be present with all requests to the cluster in order for them to be processed. This is a security precaution to protect your data (on that note, we strongly recommend keeping your full URL a secret, as anyone with the credentials can view or modify your data).\n\n**tl;dr: If you get an HTTP 401 Authorization Required response, make sure that your randomly-generated cluster credentials are being passed along in the request.**\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"I'm including credentials and still getting a 401\"\n}\n[/block]\nSome Elasticsearch actions have been limited for administrative use only within our shared clusters. This includes accessing and modifying cluster-level settings and behaviors. The admin-only actions are a very small subset of the official API, so most users should not be affected. A notable exception is if you receive this error when you try to `PUT` a new mapping to the root of your index. Users should instead use the `_mapping` action within their index.\n\nIf you're positive that your randomly-generated cluster credentials are being properly passed with the request, and the 401s are occurring on \"safe\" endpoints (like searching, checking cluster health, etc), please [let us know](mailto:support@bonsai.io) and we'll look into it.","excerpt":"","slug":"http-401-authorization-required-2","type":"basic","title":"HTTP 401: Authorization Required"}

HTTP 401: Authorization Required


The most common reason that users receive a 401 response is the authentication credentials are missing from the request. All Bonsai cluster URLs follow this format: ``` https://username:password@sub-domain.region.bonsai.io ``` The username and password in this URL are not the credentials used for logging in to Bonsai, but are randomly generated alphanumeric strings. Your URL might look something like: ``` https://kjh4k3j:lv9pngn9fs@my-awesome-cluster.us-east-1.bonsai.io ``` The credentials `kjh4k3j:lv9pngn9fs` **must** be present with all requests to the cluster in order for them to be processed. This is a security precaution to protect your data (on that note, we strongly recommend keeping your full URL a secret, as anyone with the credentials can view or modify your data). **tl;dr: If you get an HTTP 401 Authorization Required response, make sure that your randomly-generated cluster credentials are being passed along in the request.** [block:api-header] { "type": "basic", "title": "I'm including credentials and still getting a 401" } [/block] Some Elasticsearch actions have been limited for administrative use only within our shared clusters. This includes accessing and modifying cluster-level settings and behaviors. The admin-only actions are a very small subset of the official API, so most users should not be affected. A notable exception is if you receive this error when you try to `PUT` a new mapping to the root of your index. Users should instead use the `_mapping` action within their index. If you're positive that your randomly-generated cluster credentials are being properly passed with the request, and the 401s are occurring on "safe" endpoints (like searching, checking cluster health, etc), please [let us know](mailto:support@bonsai.io) and we'll look into it.