Create an API key
curl --request POST \
--url https://app.ezyshield.com.au/api/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"abilities": []
}
'import requests
url = "https://app.ezyshield.com.au/api/api-keys"
payload = {
"name": "<string>",
"abilities": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', abilities: []})
};
fetch('https://app.ezyshield.com.au/api/api-keys', 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://app.ezyshield.com.au/api/api-keys",
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([
'name' => '<string>',
'abilities' => [
]
]),
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://app.ezyshield.com.au/api/api-keys"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"abilities\": []\n}")
req, _ := http.NewRequest("POST", 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.post("https://app.ezyshield.com.au/api/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"abilities\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.ezyshield.com.au/api/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"abilities\": []\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "api-keys",
"attributes": {
"name": "<string>",
"token": "<string>",
"abilities": [
"<string>"
],
"created_at": "<string>",
"last_used_at": "<string>",
"expires_at": "<string>"
},
"relationships": {
"creator": {
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "users"
}
}
}
},
"included": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "users",
"attributes": {
"name": "<string>",
"email": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
}
]
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}API Keys
Create an API key
The plain text token is only returned once and should be stored securely.
Requires the api_key:write ability.
POST
/
api-keys
Create an API key
curl --request POST \
--url https://app.ezyshield.com.au/api/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"abilities": []
}
'import requests
url = "https://app.ezyshield.com.au/api/api-keys"
payload = {
"name": "<string>",
"abilities": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', abilities: []})
};
fetch('https://app.ezyshield.com.au/api/api-keys', 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://app.ezyshield.com.au/api/api-keys",
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([
'name' => '<string>',
'abilities' => [
]
]),
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://app.ezyshield.com.au/api/api-keys"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"abilities\": []\n}")
req, _ := http.NewRequest("POST", 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.post("https://app.ezyshield.com.au/api/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"abilities\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.ezyshield.com.au/api/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"abilities\": []\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "api-keys",
"attributes": {
"name": "<string>",
"token": "<string>",
"abilities": [
"<string>"
],
"created_at": "<string>",
"last_used_at": "<string>",
"expires_at": "<string>"
},
"relationships": {
"creator": {
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "users"
}
}
}
},
"included": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "users",
"attributes": {
"name": "<string>",
"email": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
}
]
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Available options:
creator Available options:
name, token, abilities, created_at, last_used_at, expires_at Available options:
name, email, created_at, updated_at Body
application/json
The name of the API key.
Maximum string length:
255The abilities/permissions granted to the API key.
A single API key ability.
Available options:
api_key:read, api_key:write, verification:read, verification:write, check:read, check:write, webhook_subscription:read, webhook_subscription:write, webhook_event:read, aba_check:read, aba_check:write, invoice:read, invoice:write ⌘I