{"openapi":"3.0.0","info":{"title":"HairDora API","version":"1.0.0","description":"Public REST API for HairDora. Authenticate with an API key created in the HairDora dashboard: send the base64-encoded key secret with HTTP Basic auth. Each key carries per-resource scopes like `appointments:read` or `clients:write`."},"servers":[{"url":"https://api.hairdora.com"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"basic","description":"HTTP Basic auth carrying only the API key secret: `Authorization: Basic base64(<key secret>)`."},"accessToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Operator session token issued by the HairDora dashboard: `Authorization: Token <access token>`."}}},"paths":{"/api/appointments":{"get":{"tags":["Appointments"],"summary":"List appointments","description":"Lists the appointments of your organization. Requires the `appointments:read` scope. Optionally filter by `salonId`, `clientId` and a `startTime`/`endTime` window.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"query","name":"salonId","schema":{"type":"string"}},{"in":"query","name":"clientId","schema":{"type":"string"}},{"in":"query","name":"startTime","schema":{"type":"string"}},{"in":"query","name":"endTime","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"type":"integer","default":0}},{"in":"query","name":"skip","schema":{"type":"integer","default":0}},{"in":"query","name":"sortField","schema":{"type":"string","example":"startTime"}},{"in":"query","name":"sortDirection","schema":{"type":"string","enum":["ASC","DESC"]}},{"in":"query","name":"fields","description":"Comma-separated projection of fields to return","schema":{"type":"string"}}],"responses":{"200":{"description":"Array of appointments"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"API key is missing the `appointments:read` scope"},"429":{"description":"API key rate limit exceeded"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.hairdora.com/api/appointments',\n  qs: {\n    salonId: 'SOME_STRING_VALUE',\n    clientId: 'SOME_STRING_VALUE',\n    startTime: 'SOME_STRING_VALUE',\n    endTime: 'SOME_STRING_VALUE',\n    limit: 'SOME_INTEGER_VALUE',\n    skip: 'SOME_INTEGER_VALUE',\n    sortField: 'startTime',\n    sortDirection: 'SOME_STRING_VALUE',\n    fields: 'SOME_STRING_VALUE'\n  },\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url 'https://api.hairdora.com/api/appointments?salonId=SOME_STRING_VALUE&clientId=SOME_STRING_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE&sortField=startTime&sortDirection=SOME_STRING_VALUE&fields=SOME_STRING_VALUE' \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http GET 'https://api.hairdora.com/api/appointments?salonId=SOME_STRING_VALUE&clientId=SOME_STRING_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE&sortField=startTime&sortDirection=SOME_STRING_VALUE&fields=SOME_STRING_VALUE' \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"GET\", \"/api/appointments?salonId=SOME_STRING_VALUE&clientId=SOME_STRING_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE&sortField=startTime&sortDirection=SOME_STRING_VALUE&fields=SOME_STRING_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/appointments?salonId=SOME_STRING_VALUE&clientId=SOME_STRING_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE&sortField=startTime&sortDirection=SOME_STRING_VALUE&fields=SOME_STRING_VALUE\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/appointments');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n  'salonId' => 'SOME_STRING_VALUE',\n  'clientId' => 'SOME_STRING_VALUE',\n  'startTime' => 'SOME_STRING_VALUE',\n  'endTime' => 'SOME_STRING_VALUE',\n  'limit' => 'SOME_INTEGER_VALUE',\n  'skip' => 'SOME_INTEGER_VALUE',\n  'sortField' => 'startTime',\n  'sortDirection' => 'SOME_STRING_VALUE',\n  'fields' => 'SOME_STRING_VALUE'\n]);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.hairdora.com/api/appointments');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n  'salonId' => 'SOME_STRING_VALUE',\n  'clientId' => 'SOME_STRING_VALUE',\n  'startTime' => 'SOME_STRING_VALUE',\n  'endTime' => 'SOME_STRING_VALUE',\n  'limit' => 'SOME_INTEGER_VALUE',\n  'skip' => 'SOME_INTEGER_VALUE',\n  'sortField' => 'startTime',\n  'sortDirection' => 'SOME_STRING_VALUE',\n  'fields' => 'SOME_STRING_VALUE'\n]));\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"post":{"tags":["Appointments"],"summary":"Create an appointment","description":"Creates an appointment. Requires the `appointments:write` scope. Fires the `appointment.created` webhook.\n","security":[{"apiKey":[]},{"accessToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"The created appointment"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'POST',\n  url: 'https://api.hairdora.com/api/appointments',\n  headers: {'content-type': 'application/json', Authorization: 'Basic REPLACE_BASIC_AUTH'},\n  body: {},\n  json: true\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.hairdora.com/api/appointments \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{}'"},{"lang":"Shell + Httpie","source":"echo '{}' |  \\\n  http POST https://api.hairdora.com/api/appointments \\\n  Authorization:'Basic REPLACE_BASIC_AUTH' \\\n  content-type:application/json"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\npayload = \"{}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'Authorization': \"Basic REPLACE_BASIC_AUTH\"\n    }\n\nconn.request(\"POST\", \"/api/appointments\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/appointments\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n  CURLOPT_POSTFIELDS => \"{}\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\",\n    \"content-type: application/json\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/appointments');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$request->setBody('{}');\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{}');\n\n$request->setRequestUrl('https://api.hairdora.com/api/appointments');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/appointments/{appointmentId}":{"get":{"tags":["Appointments"],"summary":"Get an appointment","description":"Returns a single appointment by id. Appointments belonging to another organization respond 404. Requires the `appointments:read` scope.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"appointmentId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The appointment"},"404":{"description":"Not found (or owned by another organization)"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.hairdora.com/api/appointments/%7BappointmentId%7D',\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url https://api.hairdora.com/api/appointments/%7BappointmentId%7D \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http GET https://api.hairdora.com/api/appointments/%7BappointmentId%7D \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"GET\", \"/api/appointments/%7BappointmentId%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/appointments/%7BappointmentId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/appointments/%7BappointmentId%7D');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.hairdora.com/api/appointments/%7BappointmentId%7D');\n$request->setRequestMethod('GET');\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"put":{"tags":["Appointments"],"summary":"Update an appointment","description":"Updates an appointment. Requires the `appointments:write` scope. Appointments owned by another organization respond 404. Fires the `appointment.updated` webhook.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"appointmentId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The updated appointment"},"404":{"description":"Not found (or owned by another organization)"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'PUT',\n  url: 'https://api.hairdora.com/api/appointments/%7BappointmentId%7D',\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request PUT \\\n  --url https://api.hairdora.com/api/appointments/%7BappointmentId%7D \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http PUT https://api.hairdora.com/api/appointments/%7BappointmentId%7D \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"PUT\", \"/api/appointments/%7BappointmentId%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/appointments/%7BappointmentId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"PUT\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/appointments/%7BappointmentId%7D');\n$request->setMethod(HTTP_METH_PUT);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.hairdora.com/api/appointments/%7BappointmentId%7D');\n$request->setRequestMethod('PUT');\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"delete":{"tags":["Appointments"],"summary":"Delete an appointment","description":"Deletes an appointment by id. Requires the `appointments:write` scope. Appointments owned by another organization respond 404. Fires the `appointment.deleted` webhook.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"appointmentId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The deleted appointment id"},"404":{"description":"Not found (or owned by another organization)"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'DELETE',\n  url: 'https://api.hairdora.com/api/appointments/%7BappointmentId%7D',\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request DELETE \\\n  --url https://api.hairdora.com/api/appointments/%7BappointmentId%7D \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http DELETE https://api.hairdora.com/api/appointments/%7BappointmentId%7D \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"DELETE\", \"/api/appointments/%7BappointmentId%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/appointments/%7BappointmentId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"DELETE\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/appointments/%7BappointmentId%7D');\n$request->setMethod(HTTP_METH_DELETE);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.hairdora.com/api/appointments/%7BappointmentId%7D');\n$request->setRequestMethod('DELETE');\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/clients":{"get":{"tags":["Clients"],"summary":"List clients","description":"Lists the clients of your organization. Requires the `clients:read` scope. Optionally filter by `salonId`, `_id`, `_ids`, `email` or `userId`, and bound the result with `limit`/`skip`.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"query","name":"salonId","schema":{"type":"string"}},{"in":"query","name":"email","schema":{"type":"string"}},{"in":"query","name":"fields","description":"Comma-separated projection of fields to return","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"type":"integer","default":0}},{"in":"query","name":"skip","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"Array of clients"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"API key is missing the `clients:read` scope"},"429":{"description":"API key rate limit exceeded"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.hairdora.com/api/clients',\n  qs: {\n    salonId: 'SOME_STRING_VALUE',\n    email: 'SOME_STRING_VALUE',\n    fields: 'SOME_STRING_VALUE',\n    limit: 'SOME_INTEGER_VALUE',\n    skip: 'SOME_INTEGER_VALUE'\n  },\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url 'https://api.hairdora.com/api/clients?salonId=SOME_STRING_VALUE&email=SOME_STRING_VALUE&fields=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE' \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http GET 'https://api.hairdora.com/api/clients?salonId=SOME_STRING_VALUE&email=SOME_STRING_VALUE&fields=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE' \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"GET\", \"/api/clients?salonId=SOME_STRING_VALUE&email=SOME_STRING_VALUE&fields=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/clients?salonId=SOME_STRING_VALUE&email=SOME_STRING_VALUE&fields=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/clients');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n  'salonId' => 'SOME_STRING_VALUE',\n  'email' => 'SOME_STRING_VALUE',\n  'fields' => 'SOME_STRING_VALUE',\n  'limit' => 'SOME_INTEGER_VALUE',\n  'skip' => 'SOME_INTEGER_VALUE'\n]);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.hairdora.com/api/clients');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n  'salonId' => 'SOME_STRING_VALUE',\n  'email' => 'SOME_STRING_VALUE',\n  'fields' => 'SOME_STRING_VALUE',\n  'limit' => 'SOME_INTEGER_VALUE',\n  'skip' => 'SOME_INTEGER_VALUE'\n]));\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"post":{"tags":["Clients"],"summary":"Create a client","description":"Creates a client. Requires the `clients:write` scope. Fires the `client.created` webhook.\n","security":[{"apiKey":[]},{"accessToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"The created client"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'POST',\n  url: 'https://api.hairdora.com/api/clients',\n  headers: {'content-type': 'application/json', Authorization: 'Basic REPLACE_BASIC_AUTH'},\n  body: {},\n  json: true\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.hairdora.com/api/clients \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{}'"},{"lang":"Shell + Httpie","source":"echo '{}' |  \\\n  http POST https://api.hairdora.com/api/clients \\\n  Authorization:'Basic REPLACE_BASIC_AUTH' \\\n  content-type:application/json"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\npayload = \"{}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'Authorization': \"Basic REPLACE_BASIC_AUTH\"\n    }\n\nconn.request(\"POST\", \"/api/clients\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/clients\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n  CURLOPT_POSTFIELDS => \"{}\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\",\n    \"content-type: application/json\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/clients');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$request->setBody('{}');\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{}');\n\n$request->setRequestUrl('https://api.hairdora.com/api/clients');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/clients/{clientId}":{"get":{"tags":["Clients"],"summary":"Get a client","description":"Returns a single client by id. Clients belonging to another organization respond 404. Requires the `clients:read` scope.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"clientId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The client"},"404":{"description":"Not found (or owned by another organization)"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.hairdora.com/api/clients/%7BclientId%7D',\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url https://api.hairdora.com/api/clients/%7BclientId%7D \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http GET https://api.hairdora.com/api/clients/%7BclientId%7D \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"GET\", \"/api/clients/%7BclientId%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/clients/%7BclientId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/clients/%7BclientId%7D');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.hairdora.com/api/clients/%7BclientId%7D');\n$request->setRequestMethod('GET');\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"put":{"tags":["Clients"],"summary":"Update a client","description":"Updates a client. Requires the `clients:write` scope. Clients owned by another organization respond 404. Fires the `client.updated` webhook.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"clientId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The updated client"},"404":{"description":"Not found (or owned by another organization)"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'PUT',\n  url: 'https://api.hairdora.com/api/clients/%7BclientId%7D',\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request PUT \\\n  --url https://api.hairdora.com/api/clients/%7BclientId%7D \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http PUT https://api.hairdora.com/api/clients/%7BclientId%7D \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"PUT\", \"/api/clients/%7BclientId%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/clients/%7BclientId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"PUT\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/clients/%7BclientId%7D');\n$request->setMethod(HTTP_METH_PUT);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.hairdora.com/api/clients/%7BclientId%7D');\n$request->setRequestMethod('PUT');\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"delete":{"tags":["Clients"],"summary":"Delete a client","description":"Deletes a client by id. Requires the `clients:write` scope. Clients owned by another organization respond 404.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"clientId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The deleted client id"},"404":{"description":"Not found (or owned by another organization)"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'DELETE',\n  url: 'https://api.hairdora.com/api/clients/%7BclientId%7D',\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request DELETE \\\n  --url https://api.hairdora.com/api/clients/%7BclientId%7D \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http DELETE https://api.hairdora.com/api/clients/%7BclientId%7D \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"DELETE\", \"/api/clients/%7BclientId%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/clients/%7BclientId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"DELETE\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/clients/%7BclientId%7D');\n$request->setMethod(HTTP_METH_DELETE);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.hairdora.com/api/clients/%7BclientId%7D');\n$request->setRequestMethod('DELETE');\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/keys":{"get":{"tags":["Keys"],"summary":"List API keys","description":"Lists the API keys of your organization. The signing `secret` is never included — it is returned only once, in the create response. Managed with an operator access token, not an API key.\n","security":[{"accessToken":[]}],"parameters":[{"in":"query","name":"fields","description":"Comma-separated projection of fields to return","schema":{"type":"string"}}],"responses":{"200":{"description":"Array of keys (without secrets)"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.hairdora.com/api/keys',\n  qs: {fields: 'SOME_STRING_VALUE'},\n  headers: {Authorization: 'REPLACE_KEY_VALUE'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url 'https://api.hairdora.com/api/keys?fields=SOME_STRING_VALUE' \\\n  --header 'Authorization: REPLACE_KEY_VALUE'"},{"lang":"Shell + Httpie","source":"http GET 'https://api.hairdora.com/api/keys?fields=SOME_STRING_VALUE' \\\n  Authorization:REPLACE_KEY_VALUE"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\nheaders = { 'Authorization': \"REPLACE_KEY_VALUE\" }\n\nconn.request(\"GET\", \"/api/keys?fields=SOME_STRING_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/keys?fields=SOME_STRING_VALUE\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: REPLACE_KEY_VALUE\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/keys');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n  'fields' => 'SOME_STRING_VALUE'\n]);\n\n$request->setHeaders([\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.hairdora.com/api/keys');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n  'fields' => 'SOME_STRING_VALUE'\n]));\n\n$request->setHeaders([\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/salons":{"get":{"tags":["Salons"],"summary":"List salons","description":"Lists the salons of your organization. Requires the `salons:read` scope.\n","security":[{"apiKey":[]},{"accessToken":[]}],"responses":{"200":{"description":"Array of salons"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"API key is missing the `salons:read` scope"},"429":{"description":"API key rate limit exceeded"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.hairdora.com/api/salons',\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url https://api.hairdora.com/api/salons \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http GET https://api.hairdora.com/api/salons \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"GET\", \"/api/salons\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/salons\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/salons');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.hairdora.com/api/salons');\n$request->setRequestMethod('GET');\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/salons/{salonId}":{"get":{"tags":["Salons"],"summary":"Get a salon","description":"Returns a single salon by id. Salons belonging to another organization respond 404. Requires the `salons:read` scope.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"salonId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The salon"},"404":{"description":"Not found (or owned by another organization)"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.hairdora.com/api/salons/%7BsalonId%7D',\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url https://api.hairdora.com/api/salons/%7BsalonId%7D \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http GET https://api.hairdora.com/api/salons/%7BsalonId%7D \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"GET\", \"/api/salons/%7BsalonId%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/salons/%7BsalonId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/salons/%7BsalonId%7D');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.hairdora.com/api/salons/%7BsalonId%7D');\n$request->setRequestMethod('GET');\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/services":{"get":{"tags":["Services"],"summary":"List services","description":"Lists the services of your organization. Requires the `services:read` scope. Optionally filter by `salonId`.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"query","name":"salonId","schema":{"type":"string"}},{"in":"query","name":"fields","description":"Comma-separated projection of fields to return","schema":{"type":"string"}}],"responses":{"200":{"description":"Array of services"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"API key is missing the `services:read` scope"},"429":{"description":"API key rate limit exceeded"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.hairdora.com/api/services',\n  qs: {salonId: 'SOME_STRING_VALUE', fields: 'SOME_STRING_VALUE'},\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url 'https://api.hairdora.com/api/services?salonId=SOME_STRING_VALUE&fields=SOME_STRING_VALUE' \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http GET 'https://api.hairdora.com/api/services?salonId=SOME_STRING_VALUE&fields=SOME_STRING_VALUE' \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"GET\", \"/api/services?salonId=SOME_STRING_VALUE&fields=SOME_STRING_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/services?salonId=SOME_STRING_VALUE&fields=SOME_STRING_VALUE\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/services');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n  'salonId' => 'SOME_STRING_VALUE',\n  'fields' => 'SOME_STRING_VALUE'\n]);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.hairdora.com/api/services');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n  'salonId' => 'SOME_STRING_VALUE',\n  'fields' => 'SOME_STRING_VALUE'\n]));\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"post":{"tags":["Services"],"summary":"Create a service","description":"Creates a service. Requires the `services:write` scope. Fires the `service.created` webhook.\n","security":[{"apiKey":[]},{"accessToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"The created service"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'POST',\n  url: 'https://api.hairdora.com/api/services',\n  headers: {'content-type': 'application/json', Authorization: 'Basic REPLACE_BASIC_AUTH'},\n  body: {},\n  json: true\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.hairdora.com/api/services \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{}'"},{"lang":"Shell + Httpie","source":"echo '{}' |  \\\n  http POST https://api.hairdora.com/api/services \\\n  Authorization:'Basic REPLACE_BASIC_AUTH' \\\n  content-type:application/json"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\npayload = \"{}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'Authorization': \"Basic REPLACE_BASIC_AUTH\"\n    }\n\nconn.request(\"POST\", \"/api/services\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/services\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n  CURLOPT_POSTFIELDS => \"{}\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\",\n    \"content-type: application/json\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/services');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$request->setBody('{}');\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{}');\n\n$request->setRequestUrl('https://api.hairdora.com/api/services');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/services/{serviceId}":{"get":{"tags":["Services"],"summary":"Get a service","description":"Returns a single service by id. Services belonging to another organization respond 404. Requires the `services:read` scope.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"serviceId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The service"},"404":{"description":"Not found (or owned by another organization)"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.hairdora.com/api/services/%7BserviceId%7D',\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url https://api.hairdora.com/api/services/%7BserviceId%7D \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http GET https://api.hairdora.com/api/services/%7BserviceId%7D \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"GET\", \"/api/services/%7BserviceId%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/services/%7BserviceId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/services/%7BserviceId%7D');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.hairdora.com/api/services/%7BserviceId%7D');\n$request->setRequestMethod('GET');\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"put":{"tags":["Services"],"summary":"Update a service","description":"Updates a service. Requires the `services:write` scope. Services owned by another organization respond 404. Fires the `service.updated` webhook.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"serviceId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The updated service"},"404":{"description":"Not found (or owned by another organization)"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'PUT',\n  url: 'https://api.hairdora.com/api/services/%7BserviceId%7D',\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request PUT \\\n  --url https://api.hairdora.com/api/services/%7BserviceId%7D \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http PUT https://api.hairdora.com/api/services/%7BserviceId%7D \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"PUT\", \"/api/services/%7BserviceId%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/services/%7BserviceId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"PUT\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/services/%7BserviceId%7D');\n$request->setMethod(HTTP_METH_PUT);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.hairdora.com/api/services/%7BserviceId%7D');\n$request->setRequestMethod('PUT');\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"delete":{"tags":["Services"],"summary":"Delete a service","description":"Deletes a service by id. Requires the `services:write` scope. Services owned by another organization respond 404.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"serviceId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The deleted service id"},"404":{"description":"Not found (or owned by another organization)"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'DELETE',\n  url: 'https://api.hairdora.com/api/services/%7BserviceId%7D',\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request DELETE \\\n  --url https://api.hairdora.com/api/services/%7BserviceId%7D \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http DELETE https://api.hairdora.com/api/services/%7BserviceId%7D \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"DELETE\", \"/api/services/%7BserviceId%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/services/%7BserviceId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"DELETE\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/services/%7BserviceId%7D');\n$request->setMethod(HTTP_METH_DELETE);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.hairdora.com/api/services/%7BserviceId%7D');\n$request->setRequestMethod('DELETE');\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/webhooksubscriptions":{"get":{"tags":["Webhook subscriptions"],"summary":"List webhook subscriptions","description":"Webhook subscriptions deliver `appointment.created`, `appointment.updated`, `appointment.deleted`, `client.created`, `client.updated`, `service.created` and `service.updated` events to your server as signed POST requests (`X-Hairdora-Signature: t=<timestamp>,v1=<hex HMAC-SHA256 of \"timestamp.body\">`). An endpoint failing 20 times in a row is disabled automatically. Subscriptions are managed with an operator access token; the `secret` is only returned once, on create.\n","security":[{"accessToken":[]}],"responses":{"200":{"description":"Array of webhook subscriptions (without secrets)"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.hairdora.com/api/webhooksubscriptions',\n  headers: {Authorization: 'REPLACE_KEY_VALUE'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url https://api.hairdora.com/api/webhooksubscriptions \\\n  --header 'Authorization: REPLACE_KEY_VALUE'"},{"lang":"Shell + Httpie","source":"http GET https://api.hairdora.com/api/webhooksubscriptions \\\n  Authorization:REPLACE_KEY_VALUE"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\nheaders = { 'Authorization': \"REPLACE_KEY_VALUE\" }\n\nconn.request(\"GET\", \"/api/webhooksubscriptions\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/webhooksubscriptions\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: REPLACE_KEY_VALUE\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/webhooksubscriptions');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setHeaders([\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.hairdora.com/api/webhooksubscriptions');\n$request->setRequestMethod('GET');\n$request->setHeaders([\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"post":{"tags":["Webhook subscriptions"],"summary":"Create a webhook subscription","description":"The response includes the signing `secret` exactly once — store it; it cannot be retrieved again.\n","security":[{"accessToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["salonId","url"],"properties":{"salonId":{"type":"string"},"url":{"type":"string","example":"https://example.com/hairdora-webhook"},"events":{"type":"array","description":"Empty array subscribes to all events","items":{"type":"string","enum":["appointment.created","appointment.updated","appointment.deleted","client.created","client.updated","service.created","service.updated"]}}}}}}},"responses":{"200":{"description":"The created subscription, including its secret"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'POST',\n  url: 'https://api.hairdora.com/api/webhooksubscriptions',\n  headers: {'content-type': 'application/json', Authorization: 'REPLACE_KEY_VALUE'},\n  body: {\n    salonId: 'string',\n    url: 'https://example.com/hairdora-webhook',\n    events: ['appointment.created']\n  },\n  json: true\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.hairdora.com/api/webhooksubscriptions \\\n  --header 'Authorization: REPLACE_KEY_VALUE' \\\n  --header 'content-type: application/json' \\\n  --data '{\"salonId\":\"string\",\"url\":\"https://example.com/hairdora-webhook\",\"events\":[\"appointment.created\"]}'"},{"lang":"Shell + Httpie","source":"echo '{\"salonId\":\"string\",\"url\":\"https://example.com/hairdora-webhook\",\"events\":[\"appointment.created\"]}' |  \\\n  http POST https://api.hairdora.com/api/webhooksubscriptions \\\n  Authorization:REPLACE_KEY_VALUE \\\n  content-type:application/json"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\npayload = \"{\\\"salonId\\\":\\\"string\\\",\\\"url\\\":\\\"https://example.com/hairdora-webhook\\\",\\\"events\\\":[\\\"appointment.created\\\"]}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'Authorization': \"REPLACE_KEY_VALUE\"\n    }\n\nconn.request(\"POST\", \"/api/webhooksubscriptions\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/webhooksubscriptions\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n  CURLOPT_POSTFIELDS => \"{\\\"salonId\\\":\\\"string\\\",\\\"url\\\":\\\"https://example.com/hairdora-webhook\\\",\\\"events\\\":[\\\"appointment.created\\\"]}\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: REPLACE_KEY_VALUE\",\n    \"content-type: application/json\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/webhooksubscriptions');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\n$request->setBody('{\"salonId\":\"string\",\"url\":\"https://example.com/hairdora-webhook\",\"events\":[\"appointment.created\"]}');\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{\"salonId\":\"string\",\"url\":\"https://example.com/hairdora-webhook\",\"events\":[\"appointment.created\"]}');\n\n$request->setRequestUrl('https://api.hairdora.com/api/webhooksubscriptions');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/webhooksubscriptions/{webhookSubscriptionId}":{"put":{"tags":["Webhook subscriptions"],"summary":"Update a webhook subscription","description":"`url`, `events` and `active` are editable; the secret and salon are immutable. Re-enabling an auto-disabled endpoint is done by setting `active` back to true.\n","security":[{"accessToken":[]}],"parameters":[{"in":"path","name":"webhookSubscriptionId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"The updated subscription (without secret)"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'PUT',\n  url: 'https://api.hairdora.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D',\n  headers: {'content-type': 'application/json', Authorization: 'REPLACE_KEY_VALUE'},\n  body: {},\n  json: true\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request PUT \\\n  --url https://api.hairdora.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D \\\n  --header 'Authorization: REPLACE_KEY_VALUE' \\\n  --header 'content-type: application/json' \\\n  --data '{}'"},{"lang":"Shell + Httpie","source":"echo '{}' |  \\\n  http PUT https://api.hairdora.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D \\\n  Authorization:REPLACE_KEY_VALUE \\\n  content-type:application/json"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\npayload = \"{}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'Authorization': \"REPLACE_KEY_VALUE\"\n    }\n\nconn.request(\"PUT\", \"/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"PUT\",\n  CURLOPT_POSTFIELDS => \"{}\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: REPLACE_KEY_VALUE\",\n    \"content-type: application/json\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D');\n$request->setMethod(HTTP_METH_PUT);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\n$request->setBody('{}');\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{}');\n\n$request->setRequestUrl('https://api.hairdora.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D');\n$request->setRequestMethod('PUT');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"delete":{"tags":["Webhook subscriptions"],"summary":"Delete a webhook subscription","security":[{"accessToken":[]}],"parameters":[{"in":"path","name":"webhookSubscriptionId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'DELETE',\n  url: 'https://api.hairdora.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D',\n  headers: {Authorization: 'REPLACE_KEY_VALUE'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request DELETE \\\n  --url https://api.hairdora.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D \\\n  --header 'Authorization: REPLACE_KEY_VALUE'"},{"lang":"Shell + Httpie","source":"http DELETE https://api.hairdora.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D \\\n  Authorization:REPLACE_KEY_VALUE"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.hairdora.com\")\n\nheaders = { 'Authorization': \"REPLACE_KEY_VALUE\" }\n\nconn.request(\"DELETE\", \"/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.hairdora.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"DELETE\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: REPLACE_KEY_VALUE\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.hairdora.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D');\n$request->setMethod(HTTP_METH_DELETE);\n\n$request->setHeaders([\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.hairdora.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D');\n$request->setRequestMethod('DELETE');\n$request->setHeaders([\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}}},"tags":[]}