Create API access key
curl --request POST \
--url https://api.us-east-1.livingsecurity.ai/api/v1/access-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"name": "SIEM Export Integration",
"expiresAt": "2027-01-01T00:00:00Z",
"keyType": "user_bound",
"scopes": [
"*"
]
}
'import requests
url = "https://api.us-east-1.livingsecurity.ai/api/v1/access-keys"
payload = {
"name": "SIEM Export Integration",
"expiresAt": "2027-01-01T00:00:00Z",
"keyType": "user_bound",
"scopes": ["*"]
}
headers = {
"x-organization-id": "<x-organization-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-organization-id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'SIEM Export Integration',
expiresAt: '2027-01-01T00:00:00Z',
keyType: 'user_bound',
scopes: ['*']
})
};
fetch('https://api.us-east-1.livingsecurity.ai/api/v1/access-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://api.us-east-1.livingsecurity.ai/api/v1/access-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' => 'SIEM Export Integration',
'expiresAt' => '2027-01-01T00:00:00Z',
'keyType' => 'user_bound',
'scopes' => [
'*'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-organization-id: <x-organization-id>"
],
]);
$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.us-east-1.livingsecurity.ai/api/v1/access-keys"
payload := strings.NewReader("{\n \"name\": \"SIEM Export Integration\",\n \"expiresAt\": \"2027-01-01T00:00:00Z\",\n \"keyType\": \"user_bound\",\n \"scopes\": [\n \"*\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-organization-id", "<x-organization-id>")
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://api.us-east-1.livingsecurity.ai/api/v1/access-keys")
.header("x-organization-id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"SIEM Export Integration\",\n \"expiresAt\": \"2027-01-01T00:00:00Z\",\n \"keyType\": \"user_bound\",\n \"scopes\": [\n \"*\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us-east-1.livingsecurity.ai/api/v1/access-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-organization-id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"SIEM Export Integration\",\n \"expiresAt\": \"2027-01-01T00:00:00Z\",\n \"keyType\": \"user_bound\",\n \"scopes\": [\n \"*\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"keyType": "user_bound",
"boundEmail": "<string>",
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"createdByUserId": "<string>",
"scopes": [
"*"
],
"secret": "<string>",
"lastUsedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z"
}Access Keys
Create API access key
Creates a new API access key credential in the current organization. The secret access key value is returned only once.
POST
/
access-keys
Create API access key
curl --request POST \
--url https://api.us-east-1.livingsecurity.ai/api/v1/access-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"name": "SIEM Export Integration",
"expiresAt": "2027-01-01T00:00:00Z",
"keyType": "user_bound",
"scopes": [
"*"
]
}
'import requests
url = "https://api.us-east-1.livingsecurity.ai/api/v1/access-keys"
payload = {
"name": "SIEM Export Integration",
"expiresAt": "2027-01-01T00:00:00Z",
"keyType": "user_bound",
"scopes": ["*"]
}
headers = {
"x-organization-id": "<x-organization-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-organization-id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'SIEM Export Integration',
expiresAt: '2027-01-01T00:00:00Z',
keyType: 'user_bound',
scopes: ['*']
})
};
fetch('https://api.us-east-1.livingsecurity.ai/api/v1/access-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://api.us-east-1.livingsecurity.ai/api/v1/access-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' => 'SIEM Export Integration',
'expiresAt' => '2027-01-01T00:00:00Z',
'keyType' => 'user_bound',
'scopes' => [
'*'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-organization-id: <x-organization-id>"
],
]);
$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.us-east-1.livingsecurity.ai/api/v1/access-keys"
payload := strings.NewReader("{\n \"name\": \"SIEM Export Integration\",\n \"expiresAt\": \"2027-01-01T00:00:00Z\",\n \"keyType\": \"user_bound\",\n \"scopes\": [\n \"*\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-organization-id", "<x-organization-id>")
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://api.us-east-1.livingsecurity.ai/api/v1/access-keys")
.header("x-organization-id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"SIEM Export Integration\",\n \"expiresAt\": \"2027-01-01T00:00:00Z\",\n \"keyType\": \"user_bound\",\n \"scopes\": [\n \"*\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us-east-1.livingsecurity.ai/api/v1/access-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-organization-id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"SIEM Export Integration\",\n \"expiresAt\": \"2027-01-01T00:00:00Z\",\n \"keyType\": \"user_bound\",\n \"scopes\": [\n \"*\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"keyType": "user_bound",
"boundEmail": "<string>",
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"createdByUserId": "<string>",
"scopes": [
"*"
],
"secret": "<string>",
"lastUsedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z"
}承認
ボディ
application/json
レスポンス
201 - application/json
このページは役に立ちましたか?

