curl --request POST \
--url https://us.infisical.com/api/v1/agent-vault/access-bundles/{accessBundleId}/services \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"hostPattern": "<string>",
"credential": {
"type": "bearer",
"value": "<string>",
"headerName": "<string>",
"headerPrefix": "<string>"
},
"allowedMethods": [],
"allowedPathPrefixes": [
"<string>"
],
"customHeaders": [
{
"name": "<string>",
"value": "<string>",
"prefix": "<string>"
}
],
"substitutions": [
{
"placeholder": "<string>",
"surfaces": [],
"value": "<string>"
}
]
}
'import requests
url = "https://us.infisical.com/api/v1/agent-vault/access-bundles/{accessBundleId}/services"
payload = {
"name": "<string>",
"hostPattern": "<string>",
"credential": {
"type": "bearer",
"value": "<string>",
"headerName": "<string>",
"headerPrefix": "<string>"
},
"allowedMethods": [],
"allowedPathPrefixes": ["<string>"],
"customHeaders": [
{
"name": "<string>",
"value": "<string>",
"prefix": "<string>"
}
],
"substitutions": [
{
"placeholder": "<string>",
"surfaces": [],
"value": "<string>"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
hostPattern: '<string>',
credential: {
type: 'bearer',
value: '<string>',
headerName: '<string>',
headerPrefix: '<string>'
},
allowedMethods: [],
allowedPathPrefixes: ['<string>'],
customHeaders: [{name: '<string>', value: '<string>', prefix: '<string>'}],
substitutions: [{placeholder: '<string>', surfaces: [], value: '<string>'}]
})
};
fetch('https://us.infisical.com/api/v1/agent-vault/access-bundles/{accessBundleId}/services', 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://us.infisical.com/api/v1/agent-vault/access-bundles/{accessBundleId}/services",
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>',
'hostPattern' => '<string>',
'credential' => [
'type' => 'bearer',
'value' => '<string>',
'headerName' => '<string>',
'headerPrefix' => '<string>'
],
'allowedMethods' => [
],
'allowedPathPrefixes' => [
'<string>'
],
'customHeaders' => [
[
'name' => '<string>',
'value' => '<string>',
'prefix' => '<string>'
]
],
'substitutions' => [
[
'placeholder' => '<string>',
'surfaces' => [
],
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"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://us.infisical.com/api/v1/agent-vault/access-bundles/{accessBundleId}/services"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"hostPattern\": \"<string>\",\n \"credential\": {\n \"type\": \"bearer\",\n \"value\": \"<string>\",\n \"headerName\": \"<string>\",\n \"headerPrefix\": \"<string>\"\n },\n \"allowedMethods\": [],\n \"allowedPathPrefixes\": [\n \"<string>\"\n ],\n \"customHeaders\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"prefix\": \"<string>\"\n }\n ],\n \"substitutions\": [\n {\n \"placeholder\": \"<string>\",\n \"surfaces\": [],\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://us.infisical.com/api/v1/agent-vault/access-bundles/{accessBundleId}/services")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"hostPattern\": \"<string>\",\n \"credential\": {\n \"type\": \"bearer\",\n \"value\": \"<string>\",\n \"headerName\": \"<string>\",\n \"headerPrefix\": \"<string>\"\n },\n \"allowedMethods\": [],\n \"allowedPathPrefixes\": [\n \"<string>\"\n ],\n \"customHeaders\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"prefix\": \"<string>\"\n }\n ],\n \"substitutions\": [\n {\n \"placeholder\": \"<string>\",\n \"surfaces\": [],\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.infisical.com/api/v1/agent-vault/access-bundles/{accessBundleId}/services")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"hostPattern\": \"<string>\",\n \"credential\": {\n \"type\": \"bearer\",\n \"value\": \"<string>\",\n \"headerName\": \"<string>\",\n \"headerPrefix\": \"<string>\"\n },\n \"allowedMethods\": [],\n \"allowedPathPrefixes\": [\n \"<string>\"\n ],\n \"customHeaders\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"prefix\": \"<string>\"\n }\n ],\n \"substitutions\": [\n {\n \"placeholder\": \"<string>\",\n \"surfaces\": [],\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"service": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accessBundleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"hostPattern": "<string>",
"allowedMethods": [
"GET"
],
"allowedPathPrefixes": [
"<string>"
],
"credential": {
"type": "bearer",
"headerName": "<string>",
"headerPrefix": "<string>"
},
"customHeaders": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"prefix": "<string>"
}
],
"substitutions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"placeholder": "<string>",
"surfaces": [
"path"
]
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"reqId": "<string>",
"statusCode": 400,
"message": "<string>",
"error": "<string>",
"details": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 401,
"message": "<string>",
"error": "<string>"
}{
"reqId": "<string>",
"statusCode": 403,
"message": "<string>",
"error": "<string>",
"details": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 404,
"message": "<string>",
"error": "<string>"
}{
"reqId": "<string>",
"statusCode": 422,
"error": "<string>",
"message": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 500,
"message": "<string>",
"error": "<string>"
}Create service
Create a service in an Agent Vault access bundle
curl --request POST \
--url https://us.infisical.com/api/v1/agent-vault/access-bundles/{accessBundleId}/services \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"hostPattern": "<string>",
"credential": {
"type": "bearer",
"value": "<string>",
"headerName": "<string>",
"headerPrefix": "<string>"
},
"allowedMethods": [],
"allowedPathPrefixes": [
"<string>"
],
"customHeaders": [
{
"name": "<string>",
"value": "<string>",
"prefix": "<string>"
}
],
"substitutions": [
{
"placeholder": "<string>",
"surfaces": [],
"value": "<string>"
}
]
}
'import requests
url = "https://us.infisical.com/api/v1/agent-vault/access-bundles/{accessBundleId}/services"
payload = {
"name": "<string>",
"hostPattern": "<string>",
"credential": {
"type": "bearer",
"value": "<string>",
"headerName": "<string>",
"headerPrefix": "<string>"
},
"allowedMethods": [],
"allowedPathPrefixes": ["<string>"],
"customHeaders": [
{
"name": "<string>",
"value": "<string>",
"prefix": "<string>"
}
],
"substitutions": [
{
"placeholder": "<string>",
"surfaces": [],
"value": "<string>"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
hostPattern: '<string>',
credential: {
type: 'bearer',
value: '<string>',
headerName: '<string>',
headerPrefix: '<string>'
},
allowedMethods: [],
allowedPathPrefixes: ['<string>'],
customHeaders: [{name: '<string>', value: '<string>', prefix: '<string>'}],
substitutions: [{placeholder: '<string>', surfaces: [], value: '<string>'}]
})
};
fetch('https://us.infisical.com/api/v1/agent-vault/access-bundles/{accessBundleId}/services', 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://us.infisical.com/api/v1/agent-vault/access-bundles/{accessBundleId}/services",
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>',
'hostPattern' => '<string>',
'credential' => [
'type' => 'bearer',
'value' => '<string>',
'headerName' => '<string>',
'headerPrefix' => '<string>'
],
'allowedMethods' => [
],
'allowedPathPrefixes' => [
'<string>'
],
'customHeaders' => [
[
'name' => '<string>',
'value' => '<string>',
'prefix' => '<string>'
]
],
'substitutions' => [
[
'placeholder' => '<string>',
'surfaces' => [
],
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"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://us.infisical.com/api/v1/agent-vault/access-bundles/{accessBundleId}/services"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"hostPattern\": \"<string>\",\n \"credential\": {\n \"type\": \"bearer\",\n \"value\": \"<string>\",\n \"headerName\": \"<string>\",\n \"headerPrefix\": \"<string>\"\n },\n \"allowedMethods\": [],\n \"allowedPathPrefixes\": [\n \"<string>\"\n ],\n \"customHeaders\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"prefix\": \"<string>\"\n }\n ],\n \"substitutions\": [\n {\n \"placeholder\": \"<string>\",\n \"surfaces\": [],\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://us.infisical.com/api/v1/agent-vault/access-bundles/{accessBundleId}/services")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"hostPattern\": \"<string>\",\n \"credential\": {\n \"type\": \"bearer\",\n \"value\": \"<string>\",\n \"headerName\": \"<string>\",\n \"headerPrefix\": \"<string>\"\n },\n \"allowedMethods\": [],\n \"allowedPathPrefixes\": [\n \"<string>\"\n ],\n \"customHeaders\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"prefix\": \"<string>\"\n }\n ],\n \"substitutions\": [\n {\n \"placeholder\": \"<string>\",\n \"surfaces\": [],\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.infisical.com/api/v1/agent-vault/access-bundles/{accessBundleId}/services")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"hostPattern\": \"<string>\",\n \"credential\": {\n \"type\": \"bearer\",\n \"value\": \"<string>\",\n \"headerName\": \"<string>\",\n \"headerPrefix\": \"<string>\"\n },\n \"allowedMethods\": [],\n \"allowedPathPrefixes\": [\n \"<string>\"\n ],\n \"customHeaders\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"prefix\": \"<string>\"\n }\n ],\n \"substitutions\": [\n {\n \"placeholder\": \"<string>\",\n \"surfaces\": [],\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"service": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accessBundleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"hostPattern": "<string>",
"allowedMethods": [
"GET"
],
"allowedPathPrefixes": [
"<string>"
],
"credential": {
"type": "bearer",
"headerName": "<string>",
"headerPrefix": "<string>"
},
"customHeaders": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"prefix": "<string>"
}
],
"substitutions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"placeholder": "<string>",
"surfaces": [
"path"
]
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"reqId": "<string>",
"statusCode": 400,
"message": "<string>",
"error": "<string>",
"details": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 401,
"message": "<string>",
"error": "<string>"
}{
"reqId": "<string>",
"statusCode": 403,
"message": "<string>",
"error": "<string>",
"details": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 404,
"message": "<string>",
"error": "<string>"
}{
"reqId": "<string>",
"statusCode": 422,
"error": "<string>",
"message": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 500,
"message": "<string>",
"error": "<string>"
}Path Parameters
The ID of the access bundle.
Body
The name of the service.
1 - 64A comma-separated set of hosts this service covers, each optionally with a port (defaults to 443). A leading *. wildcard matches exactly one label. Paths are not supported.
1024- Bearer
- Basic Auth
- Pass-through
Show child attributes
Show child attributes
The HTTP methods this service allows. Null allows every method. Anything else is refused by the proxy with a 403.
1 - 7 elementsGET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS The path prefixes this service allows, matched on whole segments, so /repos covers /repos/octo but not /repositories. null allows every path. A path-restricted service also refuses any request whose path would have to be normalised to judge.
1 - 20 elementsAdditional headers the proxy attaches to every request to this service, on top of the credential. Send the full list. A header you leave out is deleted. Send a header's id to change it in place and keep its stored value. Without an id, a header is matched by name.
20Show child attributes
Show child attributes
Placeholders the proxy swaps for a real secret before forwarding. Send the full list. A substitution you leave out is deleted. Send a substitution's id to change it in place and keep its stored value. Without an id, it is matched by its placeholder.
20Show child attributes
Show child attributes
Response
Default Response
Show child attributes
Show child attributes
Was this page helpful?