Crear una exportación de auditoría
curl --request POST \
--url https://sta.sandbox.lerian.net/v1/audit/exports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entityType": "credential_access",
"periodFrom": "2026-01-01T00:00:00Z",
"periodTo": "2026-02-01T00:00:00Z",
"format": "CSV"
}
'import requests
url = "https://sta.sandbox.lerian.net/v1/audit/exports"
payload = {
"entityType": "credential_access",
"periodFrom": "2026-01-01T00:00:00Z",
"periodTo": "2026-02-01T00:00:00Z",
"format": "CSV"
}
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({
entityType: 'credential_access',
periodFrom: '2026-01-01T00:00:00Z',
periodTo: '2026-02-01T00:00:00Z',
format: 'CSV'
})
};
fetch('https://sta.sandbox.lerian.net/v1/audit/exports', 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://sta.sandbox.lerian.net/v1/audit/exports",
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([
'entityType' => 'credential_access',
'periodFrom' => '2026-01-01T00:00:00Z',
'periodTo' => '2026-02-01T00:00:00Z',
'format' => 'CSV'
]),
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://sta.sandbox.lerian.net/v1/audit/exports"
payload := strings.NewReader("{\n \"entityType\": \"credential_access\",\n \"periodFrom\": \"2026-01-01T00:00:00Z\",\n \"periodTo\": \"2026-02-01T00:00:00Z\",\n \"format\": \"CSV\"\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://sta.sandbox.lerian.net/v1/audit/exports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entityType\": \"credential_access\",\n \"periodFrom\": \"2026-01-01T00:00:00Z\",\n \"periodTo\": \"2026-02-01T00:00:00Z\",\n \"format\": \"CSV\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sta.sandbox.lerian.net/v1/audit/exports")
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 \"entityType\": \"credential_access\",\n \"periodFrom\": \"2026-01-01T00:00:00Z\",\n \"periodTo\": \"2026-02-01T00:00:00Z\",\n \"format\": \"CSV\"\n}"
response = http.request(request)
puts response.read_body{
"entityType": "<string>",
"format": "<string>",
"id": "<string>",
"periodFrom": "2023-11-07T05:31:56Z",
"periodTo": "2023-11-07T05:31:56Z",
"requestedAt": "2023-11-07T05:31:56Z",
"requestedBy": "<string>",
"status": "<string>",
"completedAt": "2023-11-07T05:31:56Z",
"failureReason": "<string>",
"recordCount": 123,
"sha256Hash": "<string>",
"sizeBytes": 123
}{
"code": "ERR-0001",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Crear una exportación de auditoría
Encola una exportación de auditoría asíncrona (status GENERATING) para el entity type, el format y la ventana RFC3339 indicados. El rango de fechas está limitado a 365 días; una segunda exportación concurrente para el mismo entity type devuelve 409. El worker generador de exportaciones materializa el objeto.
POST
/
v1
/
audit
/
exports
Crear una exportación de auditoría
curl --request POST \
--url https://sta.sandbox.lerian.net/v1/audit/exports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entityType": "credential_access",
"periodFrom": "2026-01-01T00:00:00Z",
"periodTo": "2026-02-01T00:00:00Z",
"format": "CSV"
}
'import requests
url = "https://sta.sandbox.lerian.net/v1/audit/exports"
payload = {
"entityType": "credential_access",
"periodFrom": "2026-01-01T00:00:00Z",
"periodTo": "2026-02-01T00:00:00Z",
"format": "CSV"
}
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({
entityType: 'credential_access',
periodFrom: '2026-01-01T00:00:00Z',
periodTo: '2026-02-01T00:00:00Z',
format: 'CSV'
})
};
fetch('https://sta.sandbox.lerian.net/v1/audit/exports', 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://sta.sandbox.lerian.net/v1/audit/exports",
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([
'entityType' => 'credential_access',
'periodFrom' => '2026-01-01T00:00:00Z',
'periodTo' => '2026-02-01T00:00:00Z',
'format' => 'CSV'
]),
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://sta.sandbox.lerian.net/v1/audit/exports"
payload := strings.NewReader("{\n \"entityType\": \"credential_access\",\n \"periodFrom\": \"2026-01-01T00:00:00Z\",\n \"periodTo\": \"2026-02-01T00:00:00Z\",\n \"format\": \"CSV\"\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://sta.sandbox.lerian.net/v1/audit/exports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entityType\": \"credential_access\",\n \"periodFrom\": \"2026-01-01T00:00:00Z\",\n \"periodTo\": \"2026-02-01T00:00:00Z\",\n \"format\": \"CSV\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sta.sandbox.lerian.net/v1/audit/exports")
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 \"entityType\": \"credential_access\",\n \"periodFrom\": \"2026-01-01T00:00:00Z\",\n \"periodTo\": \"2026-02-01T00:00:00Z\",\n \"format\": \"CSV\"\n}"
response = http.request(request)
puts response.read_body{
"entityType": "<string>",
"format": "<string>",
"id": "<string>",
"periodFrom": "2023-11-07T05:31:56Z",
"periodTo": "2023-11-07T05:31:56Z",
"requestedAt": "2023-11-07T05:31:56Z",
"requestedBy": "<string>",
"status": "<string>",
"completedAt": "2023-11-07T05:31:56Z",
"failureReason": "<string>",
"recordCount": 123,
"sha256Hash": "<string>",
"sizeBytes": 123
}{
"code": "ERR-0001",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Autorizaciones
JWT bearer token issued by the identity provider.
Cuerpo
application/json
Audit export creation payload
Audit entity to export (credential_access | transfer_history)
Ejemplo:
"credential_access"
Inclusive lower bound of the export window (RFC3339)
Ejemplo:
"2026-01-01T00:00:00Z"
Exclusive upper bound of the export window (RFC3339)
Ejemplo:
"2026-02-01T00:00:00Z"
Export format (CSV | JSON_GZIP); defaults to CSV
Ejemplo:
"CSV"
Respuesta
Accepted
¿Esta página le ayudó?

