Loading…
Loading…
Manage and test backend profiles for API services. Includes endpoints for CRUD operations, connectivity tests, application tests, and synthetic monitoring.
The Backend Profile Management API provides administrative endpoints for configuring how the platform connects to backend services. A backend profile is a collection of settings that defines a specific backend endpoint, including its URL, authentication method, timeout and retry policies, and routing information.
API publishers use these endpoints to create, view, update, and delete backend profiles associated with their services. The API also provides powerful testing capabilities to validate connectivity and application-level behavior against a backend before or after deploying changes. This includes running tests with temporary "preview" configurations that override a saved profile's settings.
This controller is a key component of the Admin API. It interacts with the persistence layer to manage profile records and coordinates with various testing and configuration services. When OAuth2 client credentials are updated, it automatically triggers a flush of the runtime's in-memory token cache to ensure new credentials are used immediately.
Backend profiles are managed on a per-service basis. The core lifecycle is handled by standard CRUD (Create, Read, Update, Delete) operations. The update (PATCH) operation includes a specific mechanism to handle authentication credential changes securely and efficiently.
When an API publisher updates a backend profile that uses OAuth2 client credentials, the system must ensure that any in-memory access tokens in the runtime are invalidated. Stale tokens could otherwise remain in use until they expire.
The following diagram illustrates the sequence for updating a profile and flushing the OAuth2 token cache:
sequenceDiagram
participant API Publisher
participant Admin API
participant Backend Profile Repository
participant Runtime OAuth2 Cache
API Publisher->>+Admin API: PATCH /admin/v1/backend-profiles/{profileId}
Admin API->>+Backend Profile Repository: findById(profileId)
Backend Profile Repository-->>-Admin API: Return existing profile
Admin API->>+Backend Profile Repository: update(profileId, changes)
Backend Profile Repository-->>-Admin API: Return updated profile
alt OAuth2 credentials changed
Admin API->>Admin API: shouldFlushOauth2() is true
Admin API-->>Runtime OAuth2 Cache: flushAsync(profileId)
end
Admin API-->>-API Publisher: 200 OK with updated profileThis process is triggered by the PATCH /admin/v1/backend-profiles/{profileId} endpoint.
BackendProfileRepository.backendProfileRepository.update().shouldFlushOauth2() internal check determines if a cache flush is needed. A flush is triggered if the profile's authType is or was oauth2_client_credentials and any of the following are true:
credentials field.authType was changed.oauth2TokenEndpoint, oauth2ClientId, oauth2Scope, or oauth2ExtraParams fields were modified.flushAsync request to the runtime component responsible for caching OAuth2 tokens. This is a "fire-and-forget" operation.This example shows how to create a new backend profile for a service. The request defines the backend's URL, authentication type, and connection settings.
Send a POST request to /admin/v1/services/{serviceId}/backend-profiles:
{
"profileName": "Primary SOAP Backend",
"endpointUrl": "https://backend.example.com/service/v2",
"wsdlUrl": "https://backend.example.com/service/v2?wsdl",
"authType": "http_basic",
"soapVersion": "1.2",
"connectionTimeoutMs": 5000,
"readTimeoutMs": 30000,
"retryCount": 2,
"active": true,
"credentials": {
"username": "service-user",
"password": "<SECRET_PASSWORD>"
},
"setAsDefault": true
}
A successful request will return a 200 OK status code and a JSON body containing the newly created backend profile object, including its system-generated id.
GET /admin/v1/services/{serviceId}/backend-profiles
Retrieves a list of all backend profiles for a given service.
Path Parameters
| Name | Type | Description |
|---|---|---|
serviceId | UUID | The unique identifier of the service. |
Responses
200 OK: Returns a JSON array of backend profile objects.POST /admin/v1/services/{serviceId}/backend-profiles
Creates a new backend profile for a service.
Path Parameters
| Name | Type | Description |
|---|---|---|
serviceId | UUID | The unique identifier of the service. |
Request Body
CreateBackendProfileRequest: A JSON object containing the profile's configuration. See the CreateBackendProfileRequest table for details.Responses
200 OK: Returns the created backend profile object.400 Bad Request: If the request is invalid (e.g., bad OAuth2 configuration). See S2R-VAL-0405 and S2R-VAL-0401 in the Troubleshooting section.PATCH /admin/v1/backend-profiles/{profileId}
Updates an existing backend profile. Only the fields provided in the request body are modified.
IMPORTANT
When updating a profile that uses oauth2_client_credentials, any change to authType, oauth2TokenEndpoint, oauth2ClientId, oauth2Scope, oauth2ExtraParams, or providing new credentials will trigger an asynchronous flush of the runtime's OAuth2 token cache.
Path Parameters
| Name | Type | Description |
|---|---|---|
profileId | UUID | The unique identifier of the backend profile. |
Request Body
PatchBackendProfileRequest: A JSON object containing the fields to update. See the PatchBackendProfileRequest table for details.Responses
200 OK: Returns the updated backend profile object.400 Bad Request: If the request is invalid. See S2R-VAL-0405 and S2R-VAL-0401 in the Troubleshooting section.404 Not Found: If the profileId does not exist.DELETE /admin/v1/backend-profiles/{profileId}
Deletes a backend profile.
Path Parameters
| Name | Type | Description |
|---|---|---|
profileId | UUID | The unique identifier of the backend profile. |
Responses
200 OK: Returns a DeleteBackendProfileResponse object confirming the deletion.400 Bad Request: If the deletion is not possible (e.g., profile is in use).404 Not Found: If the profileId does not exist.POST /admin/v1/backend-profiles/{profileId}:test-connection
Performs a basic connectivity test against the backend profile's endpointUrl. It can also optionally fetch and parse the wsdlUrl for SOAP services.
Path Parameters
| Name | Type | Description |
|---|---|---|
profileId | UUID | The unique identifier of the backend profile. |
Request Body
ConnectivityTestRequest (optional): A JSON object specifying test options.Responses
200 OK: Returns a JSON object with the results of the connectivity test.404 Not Found: If the profileId does not exist.POST /admin/v1/backend-profiles/{profileId}:test-application
Executes a full application-level test against a specific operation, sending a request to the backend and capturing the response. This endpoint allows previewing changes to the backend profile, operation settings, validation rules, and transformations without saving them.
Path Parameters
| Name | Type | Description |
|---|---|---|
profileId | UUID | The unique identifier of the backend profile. |
Request Body
ApplicationTestRequest: A JSON object containing the test parameters and preview configurations.Responses
200 OK: Returns a JSON object with the detailed results of the application test.400 Bad Request: If required fields like operationId are missing.404 Not Found: If the profileId does not exist.POST /admin/v1/backend-profiles/{profileId}:test-rest
A variant of the application test, tailored for REST operations. If requestFormat is not provided, it defaults to json.
Path Parameters
| Name | Type | Description |
|---|---|---|
profileId | UUID | The unique identifier of the backend profile. |
Request Body
ApplicationTestRequest: A JSON object containing the test parameters.Responses
200 OK: Returns a JSON object with the test results.400 Bad Request: If required fields are missing.404 Not Found: If the profileId does not exist.POST /admin/v1/backend-profiles/{profileId}:test-generated-samples
Runs tests using system-generated sample request data. This can target a specific operation or an entire API version. It also supports previewing configuration changes.
Path Parameters
| Name | Type | Description |
|---|---|---|
profileId | UUID | The unique identifier of the backend profile. |
Request Body
GeneratedSampleTestRequest (optional): A JSON object to customize the sample generation and test execution.Responses
200 OK: Returns a JSON object with the results of the sample-based tests.400 Bad Request: If the request contains invalid arguments.404 Not Found: If the profileId does not exist.GET /admin/v1/backend-profiles/{profileId}/test-previews
Retrieves a list of recent test previews executed against a backend profile.
Path Parameters
| Name | Type | Description |
|---|---|---|
profileId | UUID | The unique identifier of the backend profile. |
Query Parameters
| Name | Type | Default | Description |
|---|---|---|---|
limit | Integer | 20 | The maximum number of recent previews to return. |
Responses
200 OK: Returns a JSON array of test preview results.404 Not Found: If the profileId does not exist.GET /admin/v1/services/{serviceId}/synthetic-monitor
Retrieves the synthetic monitoring configuration for a service.
Path Parameters
| Name | Type | Description |
|---|---|---|
serviceId | UUID | The unique identifier of the service. |
Responses
200 OK: Returns the synthetic monitor configuration object, or null if not configured.POST /admin/v1/services/{serviceId}/synthetic-monitor
Creates or updates the synthetic monitoring configuration for a service.
Path Parameters
| Name | Type | Description |
|---|---|---|
serviceId | UUID | The unique identifier of the service. |
Request Body
SaveSyntheticMonitorRequest: A JSON object defining the monitor's settings.Responses
200 OK: Returns the saved synthetic monitor configuration object.400 Bad Request: If backendProfileId or operationId are missing.GET /admin/v1/services/{serviceId}/test-datasets
Retrieves all test datasets for a service.
Path Parameters
| Name | Type | Description |
|---|---|---|
serviceId | UUID | The unique identifier of the service. |
Responses
200 OK: Returns a JSON array of test dataset objects.400 Bad Request: If the service ID is invalid.POST /admin/v1/services/{serviceId}/test-datasets
Creates or updates a named test dataset for a service.
Path Parameters
| Name | Type | Description |
|---|---|---|
serviceId | UUID | The unique identifier of the service. |
Request Body
SaveTestDatasetRequest: A JSON object defining the dataset.Responses
200 OK: Returns the saved test dataset object.400 Bad Request: If datasetName is missing or the request is otherwise invalid.DELETE /admin/v1/test-datasets/{datasetId}
Deletes a test dataset.
Path Parameters
| Name | Type | Description |
|---|---|---|
datasetId | UUID | The unique identifier of the test dataset. |
Responses
200 OK: Returns the deleted test dataset object.400 Bad Request: If the deletion fails.This is the primary object representing a backend profile, returned by GET, POST, and PATCH endpoints.
| Field | Type | Description |
|---|---|---|
id | UUID | The unique identifier of the backend profile. |
serviceId | UUID | The ID of the service this profile belongs to. |
profileName | String | A human-readable name for the profile. |
endpointUrl | String | The base URL for the backend service. |
wsdlUrl | String | The URL to the WSDL document for SOAP services. |
healthcheckUrl | String | A specific URL for health checks. |
healthCheckMode | String | The mode for health checks. |
hostHeader | String | A custom Host header to send to the backend. |
authType | String | The authentication method (e.g., http_basic, oauth2_client_credentials). |
mtlsEnabled | Boolean | Whether mutual TLS is enabled for this backend. |
soapNamespace | String | The SOAP namespace to use. |
soapVersion | String | The SOAP version (e.g., 1.1, 1.2). |
connectionTimeoutMs | Integer | Timeout for establishing a connection, in milliseconds. |
readTimeoutMs | Integer | Timeout for waiting for data, in milliseconds. |
retryCount | Integer | The number of times to retry a failed request. |
retryBackoffMs | Integer | The delay between retries, in milliseconds. |
routingPriority | Integer | The priority for routing decisions. |
routingWeight | Integer | The weight for load-balancing decisions. |
active | Boolean | Whether this profile is active for routing. |
extraHeaders | List<ExtraHeader> | A list of custom static headers to add to requests. |
oauth2TokenEndpoint | String | The URL of the OAuth2 token endpoint. |
oauth2ClientId | String | The client ID for OAuth2 authentication. |
oauth2Scope | String | The scope(s) to request for the OAuth2 token. |
oauth2ExtraParams | List<OAuth2ExtraParam> | Extra parameters to include in the OAuth2 token request. |
credentials | Map<String, Object> | Metadata about the stored credentials. Contains set (boolean), lastUpdatedAt (timestamp), and lastUpdatedBy (string). Plaintext credentials are never returned. |
createdAt | OffsetDateTime | The timestamp when the profile was created. |
updatedAt | OffsetDateTime | The timestamp when the profile was last updated. |
CreateBackendProfileRequest / PatchBackendProfileRequestThese payloads are used for creating and updating backend profiles. All fields are optional for PATCH.
| Field | Type | Required (Create) | Description |
|---|---|---|---|
profileName | String | Yes | A human-readable name for the profile. |
endpointUrl | String | Yes | The base URL for the backend service. |
wsdlUrl | String | No | The URL to the WSDL document for SOAP services. |
healthcheckUrl | String | No | A specific URL for health checks. |
healthCheckMode | String | No | The mode for health checks. |
hostHeader | String | No | A custom Host header to send to the backend. |
authType | String | No | The authentication method (e.g., http_basic). |
mtlsEnabled | Boolean | No | Whether mutual TLS is enabled. |
soapNamespace | String | No | The SOAP namespace. |
soapVersion | String | No | The SOAP version (e.g., 1.1, 1.2). |
connectionTimeoutMs | Integer | No | Connection timeout in milliseconds. |
readTimeoutMs | Integer | No | Read timeout in milliseconds. |
retryCount | Integer | No | Number of retries. |
retryBackoffMs | Integer | No | Delay between retries in milliseconds. |
routingPriority | Integer | No | Routing priority. |
routingWeight | Integer | No | Routing weight. |
active | Boolean | No | Whether the profile is active. |
extraHeaders | List<ExtraHeader> | No | Custom static headers. |
oauth2TokenEndpoint | String | No | URL of the OAuth2 token endpoint. |
oauth2ClientId | String | No | The client ID for OAuth2. |
oauth2Scope | String | No | The scope(s) for the OAuth2 token. |
oauth2ExtraParams | List<OAuth2ExtraParam> | No | Extra parameters for the OAuth2 token request. |
credentials | Map<String, Object> | No | A map containing plaintext credentials (e.g., {"username": "...", "password": "..."}). This field is write-only and is stripped before the record is persisted. |
setAsDefault | Boolean | No | If true, sets this profile as the default for the service. |
ExtraHeader Object| Field | Type | Description |
|---|---|---|
name | String | The name of the HTTP header. |
value | String | The value of the HTTP header. |
OAuth2ExtraParam Object| Field | Type | Description |
|---|---|---|
name | String | The name of the parameter to send to the token endpoint. |
value | String | The value of the parameter. |
ApplicationTestRequest Object| Field | Type | Required | Description |
|---|---|---|---|
operationId | UUID | Yes | The ID of the operation to test. |
requestFormat | String | No | The format of the request body (e.g., json, xml). Defaults to json for :test-rest. |
requestBody | String | No | The raw request body to send to the backend. |
savePreview | Boolean | No | If true (the default), saves the results of this test run for later review. |
previewBackendProfile | PreviewBackendProfileRequest | No | A temporary backend profile configuration to use for this test only. |
previewOperation | PreviewOperationRequest | No | Temporary operation settings to use for this test only. |
previewValidationRules | List<PreviewValidationRuleRequest> | No | Temporary validation rule overrides for this test only. |
previewRequestTransformRules | List<OperationTransformRuleRecord> | No | Temporary request transformation rules. |
previewResponseTransformRules | List<OperationTransformRuleRecord> | No | Temporary response transformation rules. |
DeleteBackendProfileResponse Object| Field | Type | Description |
|---|---|---|
id | UUID | The ID of the deleted profile. |
deleted | Boolean | A confirmation flag, always true on success. |
| Error Code | Status | Trigger | Description |
|---|---|---|---|
S2R-ADM-0404 | 404 Not Found | A profileId specified in the URL path does not exist or does not belong to the caller's organization. | The requested backend profile could not be found. |
S2R-VAL-0401 | 400 Bad Request | An IllegalArgumentException was caught, typically due to missing required fields (e.g., operationId in a test request, datasetName when saving a dataset) or other invalid input. | The request was malformed or contained invalid data. The error message provides more detail. |
S2R-VAL-0405 | 400 Bad Request | A BackendProfileRepository.OAuth2ConfigException was caught during profile creation or update. | The provided OAuth2 configuration is invalid or incomplete. Check the oauth2* fields. |
previewValidationRules field.previewRequestTransformRules and previewResponseTransformRules fields.