RequestRocketRequestRocketDocs
ConnectTargets

Targets API

Create the base URL a proxy calls.

Targets live under the client.

Endpoints

MethodPathWhat it does
GET/api/clients/:clientId/targetsList organisation targets
POST/api/clients/:clientId/targetsCreate an organisation target
GET/api/clients/:clientId/targets/:targetIdRead a target
PUT/api/clients/:clientId/targets/:targetIdUpdate a target
DELETE/api/clients/:clientId/targets/:targetIdDelete 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": "Unauthorized"
}
{
  "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

ParameterTypeRequiredDescription
targetNamestring✓Display name, 3–256 characters.
targetBaseURLstring✓Origin the proxy calls, including the scheme, such as https://httpbin.org.
targetRegionstring✓Region that stores the target, such as us-east-2. It cannot be changed later.
targetTestPathstring—Path used when testing the target, such as /get.
targetDefaultRuleEffectstring—"allow" or "deny". Applied when no rule matches.
targetNotesstring—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

AttributeTypeDescription
targetsarrayOne or more target objects.
targets[].sKeystringTarget id. Pass this as targetId on other endpoints.
targets[].pKey / parentIdstringOrganisation id.
targets[].targetNamestringDisplay name.
targets[].targetBaseURLstringOrigin the proxy calls, including the scheme.
targets[].targetRegionstringDeployment region.
targets[].targetTestPathstring or nullPath appended when testing the target.
targets[].targetDefaultRuleEffectstring or null"allow" or "deny".
targets[].targetNotesstring or nullFree-text note.
targets[].targetCreatedAtstringISO 8601 creation time.
targets[].targetUpdatedAtstringISO 8601 last update time.
messagestring"Success".

Update a target

PUT /api/clients/:clientId/targets/:targetId changes the target. The stored region does not change.

Request body

ParameterTypeRequiredDescription
targetNamestring✓Display name, 3–256 characters.
targetBaseURLstring✓Origin the proxy calls, including the scheme.
targetRegionstring✓Required by validation. Send the current region. The stored region does not change.
targetTestPathstring—Path used when testing the target. Omit it to leave the stored path unchanged.
targetDefaultRuleEffectstring—"allow" or "deny".
targetNotesstring—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.

Next

On this page