Update an employee
curl --request PATCH \
--url https://api.vori.com/v1/employees/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"authentication_rule": {
"methods": []
},
"badge_barcode": null,
"deactivated_at": "2023-11-07T05:31:56Z",
"email_address": null,
"first_name": "<string>",
"last_name": "<string>",
"pin": null,
"roles": [
{
"name": "manager",
"store_id": "<string>"
}
]
}
'import requests
url = "https://api.vori.com/v1/employees/{id}"
payload = {
"authentication_rule": { "methods": [] },
"badge_barcode": None,
"deactivated_at": "2023-11-07T05:31:56Z",
"email_address": None,
"first_name": "<string>",
"last_name": "<string>",
"pin": None,
"roles": [
{
"name": "manager",
"store_id": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
authentication_rule: {methods: []},
badge_barcode: null,
deactivated_at: '2023-11-07T05:31:56Z',
email_address: null,
first_name: '<string>',
last_name: '<string>',
pin: null,
roles: [{name: 'manager', store_id: '<string>'}]
})
};
fetch('https://api.vori.com/v1/employees/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vori.com/v1/employees/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'authentication_rule' => [
'methods' => [
]
],
'badge_barcode' => null,
'deactivated_at' => '2023-11-07T05:31:56Z',
'email_address' => null,
'first_name' => '<string>',
'last_name' => '<string>',
'pin' => null,
'roles' => [
[
'name' => 'manager',
'store_id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vori.com/v1/employees/{id}"
payload := strings.NewReader("{\n \"authentication_rule\": {\n \"methods\": []\n },\n \"badge_barcode\": null,\n \"deactivated_at\": \"2023-11-07T05:31:56Z\",\n \"email_address\": null,\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"pin\": null,\n \"roles\": [\n {\n \"name\": \"manager\",\n \"store_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.vori.com/v1/employees/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"authentication_rule\": {\n \"methods\": []\n },\n \"badge_barcode\": null,\n \"deactivated_at\": \"2023-11-07T05:31:56Z\",\n \"email_address\": null,\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"pin\": null,\n \"roles\": [\n {\n \"name\": \"manager\",\n \"store_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vori.com/v1/employees/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"authentication_rule\": {\n \"methods\": []\n },\n \"badge_barcode\": null,\n \"deactivated_at\": \"2023-11-07T05:31:56Z\",\n \"email_address\": null,\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"pin\": null,\n \"roles\": [\n {\n \"name\": \"manager\",\n \"store_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"authentication_rule": {
"methods": [
"barcode"
],
"operator": "and"
},
"created_at": "2023-11-07T05:31:56Z",
"deactivated_at": "2023-11-07T05:31:56Z",
"editable": true,
"email_address": "jsmith@example.com",
"first_name": "<string>",
"last_name": "<string>",
"roles": [
{
"id": "<string>",
"name": "everyone",
"store_id": "<string>"
}
],
"updated_at": "2023-11-07T05:31:56Z",
"virtual": true,
"badge_barcode": "<string>",
"pin": "<string>"
}{
"error_code": "pin_already_assigned"
}{
"error_code": "insufficient_permissions",
"error_details": {
"action": "*",
"resource": "*"
}
}Employees
Update an employee
Updates an employee. Properties the request does not name are left unchanged, and passing null clears one. Supplying roles replaces every role the employee holds.
PATCH
/
v1
/
employees
/
{id}
Update an employee
curl --request PATCH \
--url https://api.vori.com/v1/employees/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"authentication_rule": {
"methods": []
},
"badge_barcode": null,
"deactivated_at": "2023-11-07T05:31:56Z",
"email_address": null,
"first_name": "<string>",
"last_name": "<string>",
"pin": null,
"roles": [
{
"name": "manager",
"store_id": "<string>"
}
]
}
'import requests
url = "https://api.vori.com/v1/employees/{id}"
payload = {
"authentication_rule": { "methods": [] },
"badge_barcode": None,
"deactivated_at": "2023-11-07T05:31:56Z",
"email_address": None,
"first_name": "<string>",
"last_name": "<string>",
"pin": None,
"roles": [
{
"name": "manager",
"store_id": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
authentication_rule: {methods: []},
badge_barcode: null,
deactivated_at: '2023-11-07T05:31:56Z',
email_address: null,
first_name: '<string>',
last_name: '<string>',
pin: null,
roles: [{name: 'manager', store_id: '<string>'}]
})
};
fetch('https://api.vori.com/v1/employees/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vori.com/v1/employees/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'authentication_rule' => [
'methods' => [
]
],
'badge_barcode' => null,
'deactivated_at' => '2023-11-07T05:31:56Z',
'email_address' => null,
'first_name' => '<string>',
'last_name' => '<string>',
'pin' => null,
'roles' => [
[
'name' => 'manager',
'store_id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vori.com/v1/employees/{id}"
payload := strings.NewReader("{\n \"authentication_rule\": {\n \"methods\": []\n },\n \"badge_barcode\": null,\n \"deactivated_at\": \"2023-11-07T05:31:56Z\",\n \"email_address\": null,\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"pin\": null,\n \"roles\": [\n {\n \"name\": \"manager\",\n \"store_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.vori.com/v1/employees/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"authentication_rule\": {\n \"methods\": []\n },\n \"badge_barcode\": null,\n \"deactivated_at\": \"2023-11-07T05:31:56Z\",\n \"email_address\": null,\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"pin\": null,\n \"roles\": [\n {\n \"name\": \"manager\",\n \"store_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vori.com/v1/employees/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"authentication_rule\": {\n \"methods\": []\n },\n \"badge_barcode\": null,\n \"deactivated_at\": \"2023-11-07T05:31:56Z\",\n \"email_address\": null,\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"pin\": null,\n \"roles\": [\n {\n \"name\": \"manager\",\n \"store_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"authentication_rule": {
"methods": [
"barcode"
],
"operator": "and"
},
"created_at": "2023-11-07T05:31:56Z",
"deactivated_at": "2023-11-07T05:31:56Z",
"editable": true,
"email_address": "jsmith@example.com",
"first_name": "<string>",
"last_name": "<string>",
"roles": [
{
"id": "<string>",
"name": "everyone",
"store_id": "<string>"
}
],
"updated_at": "2023-11-07T05:31:56Z",
"virtual": true,
"badge_barcode": "<string>",
"pin": "<string>"
}{
"error_code": "pin_already_assigned"
}{
"error_code": "insufficient_permissions",
"error_details": {
"action": "*",
"resource": "*"
}
}Authorizations
Body
application/json
Values for updating an employee. An omitted property is left unchanged, and an explicit null clears a property that permits one.
Response
A staff member at a store, to whom point-of-sale activity can be attributed.
Was this page helpful?