ConnectTargets
Targets API
Create the base URL a proxy calls.
Targets live under the client.
Endpoints
| Method | Path | What it does |
|---|---|---|
| GET | /api/clients/:clientId/targets | List organisation targets |
| POST | /api/clients/:clientId/targets | Create an organisation target |
| GET | /api/clients/:clientId/targets/:targetId | Read a target |
| PUT | /api/clients/:clientId/targets/:targetId | Update a target |
| DELETE | /api/clients/:clientId/targets/:targetId | Delete a target |
Create a target
POST /api/clients/:clientId/targets creates the target in one region.
Request
curl -X POST "https://api.requestrocket.com/api/clients/:clientId/targets" \
-H "Authorization: u-your-token" \
-H "Content-Type: application/json" \
-d '{
"targetName": "HTTPBin",
"targetBaseURL": "https://httpbin.org",
"targetTestPath": "/get",
"targetRegion": "us-east-2"
}'import axios from "axios";
const response = await axios.request({
method: "POST",
url: "https://api.requestrocket.com/api/clients/:clientId/targets",
headers: {
"Authorization": "u-your-token",
"Content-Type": "application/json",
},
data: {
"targetName": "HTTPBin",
"targetBaseURL": "https://httpbin.org",
"targetTestPath": "/get",
"targetRegion": "us-east-2"
}
});
console.log(response.status, response.data);import requests
response = requests.request(
"POST",
"https://api.requestrocket.com/api/clients/:clientId/targets",
headers={
"Authorization": "u-your-token",
"Content-Type": "application/json",
},
data="{\n \"targetName\": \"HTTPBin\",\n \"targetBaseURL\": \"https://httpbin.org\",\n \"targetTestPath\": \"/get\",\n \"targetRegion\": \"us-east-2\"\n}"
)
print(response.status_code, response.json())package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader(`{
"targetName": "HTTPBin",
"targetBaseURL": "https://httpbin.org",
"targetTestPath": "/get",
"targetRegion": "us-east-2"
}`)
req, _ := http.NewRequest("POST", "https://api.requestrocket.com/api/clients/:clientId/targets", payload)
req.Header.Set("Authorization", "u-your-token")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(body))
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.requestrocket.com/api/clients/:clientId/targets"))
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"targetName\": \"HTTPBin\",\n \"targetBaseURL\": \"https://httpbin.org\",\n \"targetTestPath\": \"/get\",\n \"targetRegion\": \"us-east-2\"\n}"))
.header("Authorization", "u-your-token")
.header("Content-Type", "application/json")
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}Responses
{
"targets": [
{
"targetName": "HTTPBin",
"targetBaseURL": "https://httpbin.org",
"targetTestPath": "/get",
"targetRegion": "us-east-2",
"clientId": "b3a1c7d2-5e44-4f0a-9c1e-7d2f8a6b1c90",
"userId": "0f8e6c1a-2b7d-4c3e-9a55-1d2e3f4a5b6c",
"parentId": "b3a1c7d2-5e44-4f0a-9c1e-7d2f8a6b1c90",
"targetCreatedAt": "2026-11-02T07:30:00.000Z",
"targetUpdatedAt": "2026-11-02T07:30:00.000Z",
"targetDefaultRuleEffect": null,
"targetNotes": null
}
],
"message": "Target created successfully"
}{
"message": "Input failed data validation",
"errors": [
"/targetRegion: must have required property 'targetRegion'"
]
}{
"Message": "User is not authorized to access this resource with an explicit deny in an identity-based policy"
}{
"message": "method / endpoint not supported"
}Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
targetName | string | ✓ | Display name, 3–256 characters. |
targetBaseURL | string | ✓ | Origin the proxy calls, including the scheme, such as https://httpbin.org. |
targetRegion | string | ✓ | Region that stores the target, such as us-east-2. It cannot be changed later. |
targetTestPath | string | — | Path used when testing the target, such as /get. |
targetDefaultRuleEffect | string | — | "allow" or "deny". Applied when no rule matches. |
targetNotes | string | — | Free-text note stored on the target. |
Returns a targets array with message set to "Target created successfully". On create, pKey is the new target id. On list and read, sKey is the target id. See Read a target for response attributes.
List targets
GET /api/clients/:clientId/targets returns every target for the organisation in one response. Each item matches Read a target.
Read a target
GET /api/clients/:clientId/targets/:targetId returns one target.
Response attributes
| Attribute | Type | Description |
|---|---|---|
targets | array | One or more target objects. |
targets[].sKey | string | Target id. Pass this as targetId on other endpoints. |
targets[].pKey / parentId | string | Organisation id. |
targets[].targetName | string | Display name. |
targets[].targetBaseURL | string | Origin the proxy calls, including the scheme. |
targets[].targetRegion | string | Deployment region. |
targets[].targetTestPath | string or null | Path appended when testing the target. |
targets[].targetDefaultRuleEffect | string or null | "allow" or "deny". |
targets[].targetNotes | string or null | Free-text note. |
targets[].targetCreatedAt | string | ISO 8601 creation time. |
targets[].targetUpdatedAt | string | ISO 8601 last update time. |
message | string | "Success". |
Update a target
PUT /api/clients/:clientId/targets/:targetId changes the target. The stored region does not change.
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
targetName | string | ✓ | Display name, 3–256 characters. |
targetBaseURL | string | ✓ | Origin the proxy calls, including the scheme. |
targetRegion | string | ✓ | Required by validation. Send the current region. The stored region does not change. |
targetTestPath | string | — | Path used when testing the target. Omit it to leave the stored path unchanged. |
targetDefaultRuleEffect | string | — | "allow" or "deny". |
targetNotes | string | — | Free-text note. Omit it to leave the stored note unchanged. |
Returns a targets array with message set to "Target updated successfully". The attributes match Read a target.