curl --request POST \
--url https://api.engini.io/v1/opa-agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"applicationSlug": "<string>",
"settings": {
"parallelTasks": 123,
"pullPeriodSeconds": 123,
"logLevel": "<string>"
}
}
'import requests
url = "https://api.engini.io/v1/opa-agents"
payload = {
"name": "<string>",
"description": "<string>",
"applicationSlug": "<string>",
"settings": {
"parallelTasks": 123,
"pullPeriodSeconds": 123,
"logLevel": "<string>"
}
}
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>',
description: '<string>',
applicationSlug: '<string>',
settings: {parallelTasks: 123, pullPeriodSeconds: 123, logLevel: '<string>'}
})
};
fetch('https://api.engini.io/v1/opa-agents', 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.engini.io/v1/opa-agents",
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>',
'description' => '<string>',
'applicationSlug' => '<string>',
'settings' => [
'parallelTasks' => 123,
'pullPeriodSeconds' => 123,
'logLevel' => '<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.engini.io/v1/opa-agents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"applicationSlug\": \"<string>\",\n \"settings\": {\n \"parallelTasks\": 123,\n \"pullPeriodSeconds\": 123,\n \"logLevel\": \"<string>\"\n }\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://api.engini.io/v1/opa-agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"applicationSlug\": \"<string>\",\n \"settings\": {\n \"parallelTasks\": 123,\n \"pullPeriodSeconds\": 123,\n \"logLevel\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engini.io/v1/opa-agents")
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 \"description\": \"<string>\",\n \"applicationSlug\": \"<string>\",\n \"settings\": {\n \"parallelTasks\": 123,\n \"pullPeriodSeconds\": 123,\n \"logLevel\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"agentId": 123,
"status": "<string>",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdDate": "2023-11-07T05:31:56Z",
"name": "<string>",
"description": "<string>",
"version": "<string>",
"lastSeenAt": "2023-11-07T05:31:56Z",
"updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedDate": "2023-11-07T05:31:56Z",
"settings": {
"parallelTasks": 123,
"pullPeriodSeconds": 123,
"logLevel": "<string>"
},
"appliedToAgent": true,
"dispatchedTaskIds": [
"<string>"
],
"token": "<string>"
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"path": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"path": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"path": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"path": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"path": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"path": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}Create an on-premise agent.
The response carries the agent’s token - the live credential it uses to authenticate to the task service - so a machine can provision a box in one round-trip. Callers who would rather not have it in shell history can omit it here and read it later from GET /v1/opa-agents//token.
Each setting is range-checked against what this agent’s connector declares it accepts - currently parallelTasks 1-100 and pullPeriodSeconds 10-9999999, the same bounds the Engini UI enforces. An out-of-range value is a 400 naming each offending field, and persists nothing. Note the DTO summaries in the published Engini.Models package still say “Minimum 1” for both; the bounds enforced here are the connector’s own metadata.
curl --request POST \
--url https://api.engini.io/v1/opa-agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"applicationSlug": "<string>",
"settings": {
"parallelTasks": 123,
"pullPeriodSeconds": 123,
"logLevel": "<string>"
}
}
'import requests
url = "https://api.engini.io/v1/opa-agents"
payload = {
"name": "<string>",
"description": "<string>",
"applicationSlug": "<string>",
"settings": {
"parallelTasks": 123,
"pullPeriodSeconds": 123,
"logLevel": "<string>"
}
}
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>',
description: '<string>',
applicationSlug: '<string>',
settings: {parallelTasks: 123, pullPeriodSeconds: 123, logLevel: '<string>'}
})
};
fetch('https://api.engini.io/v1/opa-agents', 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.engini.io/v1/opa-agents",
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>',
'description' => '<string>',
'applicationSlug' => '<string>',
'settings' => [
'parallelTasks' => 123,
'pullPeriodSeconds' => 123,
'logLevel' => '<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.engini.io/v1/opa-agents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"applicationSlug\": \"<string>\",\n \"settings\": {\n \"parallelTasks\": 123,\n \"pullPeriodSeconds\": 123,\n \"logLevel\": \"<string>\"\n }\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://api.engini.io/v1/opa-agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"applicationSlug\": \"<string>\",\n \"settings\": {\n \"parallelTasks\": 123,\n \"pullPeriodSeconds\": 123,\n \"logLevel\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engini.io/v1/opa-agents")
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 \"description\": \"<string>\",\n \"applicationSlug\": \"<string>\",\n \"settings\": {\n \"parallelTasks\": 123,\n \"pullPeriodSeconds\": 123,\n \"logLevel\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"agentId": 123,
"status": "<string>",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdDate": "2023-11-07T05:31:56Z",
"name": "<string>",
"description": "<string>",
"version": "<string>",
"lastSeenAt": "2023-11-07T05:31:56Z",
"updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedDate": "2023-11-07T05:31:56Z",
"settings": {
"parallelTasks": 123,
"pullPeriodSeconds": 123,
"logLevel": "<string>"
},
"appliedToAgent": true,
"dispatchedTaskIds": [
"<string>"
],
"token": "<string>"
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"path": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"path": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"path": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"path": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"path": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"path": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}Authorizations
Enter your JWT token
Body
The agent creation payload. name is required; each omitted setting takes its own default (2 parallel tasks, 10s pull, Information).
Request body for creating an on-premise agent.
Display name for the new agent. Required - declared non-nullable so RequiredPropertiesSchemaProcessor marks it required in the OpenAPI document and the generated client rejects an omitted name before the round-trip.
Optional description of the agent.
Which on-premise agent application to create under. Only needed when more than one exists - the 409 OPA_APPLICATION_AMBIGUOUS response lists the candidate slugs in its details so this can be retried with one of them.
Optional runtime settings. Each member defaults independently when omitted: 2 parallel tasks, 10s pull, Information.
Show child attributes
Show child attributes
Response
The newly created agent, including its token.
Response for agent creation. Carries the token so a caller can provision a box in one round-trip. The token is a live credential - callers who would rather not have it in shell history should read it later from GET /v1/opa-agents/{id}/token instead.
Identifier of the agent.
Liveness of the agent: WaitingForConnection, Online, Offline or Disabled.
Identifier of the user who created the agent.
When the agent was created.
Display name of the agent.
Optional description of the agent.
Version the agent last self-reported. Null until it first connects.
Last heartbeat received from the agent. Null when it has never connected.
Identifier of the user who last updated the agent.
When the agent was last updated.
Runtime settings currently stored for the agent.
Show child attributes
Show child attributes
False when a settings write reached the database but not the agent, because the agent was Offline. Null on reads - only set by update responses.
Cloud task identifiers dispatched to the live agent by a settings write. Empty when offline.
The newly minted agent token.