Creates or updates security licenses for a single employee. Pass licenseId to update an existing license; omit it (or pass null) to create a new one. Requires an API key with KeyType=developer.
POST
/
api
/
external
/
staffs
/
{employeeId}
/
licenses
Upsert a staff member's security licenses
curl --request POST \
--url https://gateway-api.guardhousehq.com/api/external/staffs/{employeeId}/licenses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'external-gh-apim-sub-key: <api-key>' \
--data '
{
"licenses": [
{
"licenseId": 123,
"stateCode": "<string>",
"licenseType": "<string>",
"licenseNumber": "<string>",
"expiryDate": "2023-11-07T05:31:56Z",
"attachments": [
{
"attachmentBase64": "aSDinaTvuI8gbWludGxpZnk=",
"attachmentFileName": "<string>"
}
]
}
]
}
'import requests
url = "https://gateway-api.guardhousehq.com/api/external/staffs/{employeeId}/licenses"
payload = { "licenses": [
{
"licenseId": 123,
"stateCode": "<string>",
"licenseType": "<string>",
"licenseNumber": "<string>",
"expiryDate": "2023-11-07T05:31:56Z",
"attachments": [
{
"attachmentBase64": "aSDinaTvuI8gbWludGxpZnk=",
"attachmentFileName": "<string>"
}
]
}
] }
headers = {
"Authorization": "Bearer <token>",
"external-gh-apim-sub-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'external-gh-apim-sub-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
licenses: [
{
licenseId: 123,
stateCode: '<string>',
licenseType: '<string>',
licenseNumber: '<string>',
expiryDate: '2023-11-07T05:31:56Z',
attachments: [{attachmentBase64: 'aSDinaTvuI8gbWludGxpZnk=', attachmentFileName: '<string>'}]
}
]
})
};
fetch('https://gateway-api.guardhousehq.com/api/external/staffs/{employeeId}/licenses', 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://gateway-api.guardhousehq.com/api/external/staffs/{employeeId}/licenses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'licenses' => [
[
'licenseId' => 123,
'stateCode' => '<string>',
'licenseType' => '<string>',
'licenseNumber' => '<string>',
'expiryDate' => '2023-11-07T05:31:56Z',
'attachments' => [
[
'attachmentBase64' => 'aSDinaTvuI8gbWludGxpZnk=',
'attachmentFileName' => '<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"external-gh-apim-sub-key: <api-key>"
],
]);
$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://gateway-api.guardhousehq.com/api/external/staffs/{employeeId}/licenses"
payload := strings.NewReader("{\n \"licenses\": [\n {\n \"licenseId\": 123,\n \"stateCode\": \"<string>\",\n \"licenseType\": \"<string>\",\n \"licenseNumber\": \"<string>\",\n \"expiryDate\": \"2023-11-07T05:31:56Z\",\n \"attachments\": [\n {\n \"attachmentBase64\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"attachmentFileName\": \"<string>\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("external-gh-apim-sub-key", "<api-key>")
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.post("https://gateway-api.guardhousehq.com/api/external/staffs/{employeeId}/licenses")
.header("Authorization", "Bearer <token>")
.header("external-gh-apim-sub-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"licenses\": [\n {\n \"licenseId\": 123,\n \"stateCode\": \"<string>\",\n \"licenseType\": \"<string>\",\n \"licenseNumber\": \"<string>\",\n \"expiryDate\": \"2023-11-07T05:31:56Z\",\n \"attachments\": [\n {\n \"attachmentBase64\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"attachmentFileName\": \"<string>\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway-api.guardhousehq.com/api/external/staffs/{employeeId}/licenses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["external-gh-apim-sub-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"licenses\": [\n {\n \"licenseId\": 123,\n \"stateCode\": \"<string>\",\n \"licenseType\": \"<string>\",\n \"licenseNumber\": \"<string>\",\n \"expiryDate\": \"2023-11-07T05:31:56Z\",\n \"attachments\": [\n {\n \"attachmentBase64\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"attachmentFileName\": \"<string>\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": "<unknown>",
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": "<unknown>",
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": "<unknown>",
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": "<unknown>",
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}Authorizations
JWT issued by POST /api/external/token/request. Send as Authorization: Bearer <token>.
Guardhouse API Management subscription key. Required on every request. The same value is used by all API consumers within a region — contact Guardhouse Support for the subscription key.
Path Parameters
Employee ID.
Body
application/json
Show child attributes
Show child attributes
⌘I
Upsert a staff member's security licenses
curl --request POST \
--url https://gateway-api.guardhousehq.com/api/external/staffs/{employeeId}/licenses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'external-gh-apim-sub-key: <api-key>' \
--data '
{
"licenses": [
{
"licenseId": 123,
"stateCode": "<string>",
"licenseType": "<string>",
"licenseNumber": "<string>",
"expiryDate": "2023-11-07T05:31:56Z",
"attachments": [
{
"attachmentBase64": "aSDinaTvuI8gbWludGxpZnk=",
"attachmentFileName": "<string>"
}
]
}
]
}
'import requests
url = "https://gateway-api.guardhousehq.com/api/external/staffs/{employeeId}/licenses"
payload = { "licenses": [
{
"licenseId": 123,
"stateCode": "<string>",
"licenseType": "<string>",
"licenseNumber": "<string>",
"expiryDate": "2023-11-07T05:31:56Z",
"attachments": [
{
"attachmentBase64": "aSDinaTvuI8gbWludGxpZnk=",
"attachmentFileName": "<string>"
}
]
}
] }
headers = {
"Authorization": "Bearer <token>",
"external-gh-apim-sub-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'external-gh-apim-sub-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
licenses: [
{
licenseId: 123,
stateCode: '<string>',
licenseType: '<string>',
licenseNumber: '<string>',
expiryDate: '2023-11-07T05:31:56Z',
attachments: [{attachmentBase64: 'aSDinaTvuI8gbWludGxpZnk=', attachmentFileName: '<string>'}]
}
]
})
};
fetch('https://gateway-api.guardhousehq.com/api/external/staffs/{employeeId}/licenses', 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://gateway-api.guardhousehq.com/api/external/staffs/{employeeId}/licenses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'licenses' => [
[
'licenseId' => 123,
'stateCode' => '<string>',
'licenseType' => '<string>',
'licenseNumber' => '<string>',
'expiryDate' => '2023-11-07T05:31:56Z',
'attachments' => [
[
'attachmentBase64' => 'aSDinaTvuI8gbWludGxpZnk=',
'attachmentFileName' => '<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"external-gh-apim-sub-key: <api-key>"
],
]);
$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://gateway-api.guardhousehq.com/api/external/staffs/{employeeId}/licenses"
payload := strings.NewReader("{\n \"licenses\": [\n {\n \"licenseId\": 123,\n \"stateCode\": \"<string>\",\n \"licenseType\": \"<string>\",\n \"licenseNumber\": \"<string>\",\n \"expiryDate\": \"2023-11-07T05:31:56Z\",\n \"attachments\": [\n {\n \"attachmentBase64\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"attachmentFileName\": \"<string>\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("external-gh-apim-sub-key", "<api-key>")
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.post("https://gateway-api.guardhousehq.com/api/external/staffs/{employeeId}/licenses")
.header("Authorization", "Bearer <token>")
.header("external-gh-apim-sub-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"licenses\": [\n {\n \"licenseId\": 123,\n \"stateCode\": \"<string>\",\n \"licenseType\": \"<string>\",\n \"licenseNumber\": \"<string>\",\n \"expiryDate\": \"2023-11-07T05:31:56Z\",\n \"attachments\": [\n {\n \"attachmentBase64\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"attachmentFileName\": \"<string>\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway-api.guardhousehq.com/api/external/staffs/{employeeId}/licenses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["external-gh-apim-sub-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"licenses\": [\n {\n \"licenseId\": 123,\n \"stateCode\": \"<string>\",\n \"licenseType\": \"<string>\",\n \"licenseNumber\": \"<string>\",\n \"expiryDate\": \"2023-11-07T05:31:56Z\",\n \"attachments\": [\n {\n \"attachmentBase64\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"attachmentFileName\": \"<string>\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": "<unknown>",
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": "<unknown>",
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": "<unknown>",
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": "<unknown>",
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}