API contract to implement
The API contract for flow extension (version v1).
Download the OpenAPI definition (YAML)
Security schemes
BasicAuth: HTTP basic
BearerAuth: HTTP bearer
ApiKeyAuth: API key in header "X-API-Key"
Other
handle flow extension events
POST /
WSO2 Identity Platform sends an HTTP POST request with a JSON envelope to the service at the flow extension step. The service runs its logic and responds with an actionStatus that determines what happens next:
SUCCESS: Apply the returned operations and continue the flow.FAILED: Stop the flow for a business or policy reason. The reason is surfaced to the end user as a flow error.ERROR: The service hit a processing or server-side error. Return HTTP 400, 401, or 500; WSO2 Identity Platform aborts the flow.
Values of attributes marked as encrypted in the extension's access configuration travel as JWE compact strings (RSA-OAEP-256 key encryption with A256GCM content encryption): WSO2 Identity Platform encrypts exposed values with the certificate uploaded for the extension, and the service must encrypt returned values for WSO2 Identity Platform.
Request body (required): application/json
Schema: RequestBody
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
actionType | string | Yes | The action type being executed. Always Allowed values: |
event | Event | Yes | A snapshot of the flow state, carrying context about the flow and the organization. Each field appears only when the corresponding attribute is marked as readable in the extension's access configuration; fields with empty values are omitted. |
allowedOperations | array of AllowedOperation | Yes | The whitelist of changes the service may emit. If the response references anything outside this whitelist, WSO2 Identity Platform rejects it. |
requestId | string | Yes | A unique identifier for this invocation. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | Returned for both SUCCESS and FAILED outcomes. The | one of: SuccessResponse, FailedResponse |
400 | Bad request. WSO2 Identity Platform treats this as a failure to execute the action and aborts the flow. | ErrorResponse |
401 | Unauthorized. WSO2 Identity Platform treats this as a failure to execute the action and aborts the flow. | ErrorResponse |
500 | Internal server error. WSO2 Identity Platform treats this as a failure to execute the action and aborts the flow. | ErrorResponse |
Schemas
RequestBody
Type: object
The request envelope sent to the external service.
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
actionType | string | Yes | The action type being executed. Always Allowed values: |
event | Event | Yes | A snapshot of the flow state, carrying context about the flow and the organization. Each field appears only when the corresponding attribute is marked as readable in the extension's access configuration; fields with empty values are omitted. |
allowedOperations | array of AllowedOperation | Yes | The whitelist of changes the service may emit. If the response references anything outside this whitelist, WSO2 Identity Platform rejects it. |
requestId | string | Yes | A unique identifier for this invocation. |
Event
Type: object
A snapshot of the flow state, carrying context about the flow and the organization. Each field appears only when the corresponding attribute is marked as readable in the extension's access configuration; fields with empty values are omitted.
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
flow | Flow | The flow being executed. | |
application | Application | The application context. | |
tenant | Tenant | The root organization context. | |
organization | Organization | The organization context. |
Flow
Type: object
The flow being executed.
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
flowType | string | The flow being executed. Allowed values: | |
flowId | string | The identifier for this single flow execution. | |
portalUrl | string (uri) | The URL of the WSO2 Identity Platform portal page. | |
user | User | The user being acted on. |
User
Type: object
The user being acted on.
5 properties
| Name | Type | Required | Description |
|---|---|---|---|
id | string | The user's unique identifier. | |
username | string | The username, without the user store domain prefix. | |
userStoreDomain | string | The user store the user belongs to. An empty string ("") denotes the primary user store. | |
claims | array of Claim | The current claims of the user. | |
credentials | object | The user's credentials, keyed by credential name (for example, |
Credential
Type: object
A typed credential value.
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
type | string | The format of the credential value. Allowed values: | |
value | string | The credential value. |
Tenant
Type: object
The root organization context.
1 property
| Name | Type | Required | Description |
|---|---|---|---|
domain | string | The domain of the root organization. |
Organization
Type: object
The organization context.
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
id | string | The organization UUID. | |
name | string | The organization name. | |
orgHandle | string | The organization handle. | |
depth | integer | The depth of the organization in the organization hierarchy. |
Claim
Type: object
A single user claim, represented as a URI and value pair.
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
uri | string | The claim URI. | |
value | one of: string, array of string | The claim value. A single-valued claim carries a string; a multi-valued claim carries an array of strings. When the claim is marked as encrypted, the value is a JWE compact string; an encrypted multi-valued claim carries a single-element array holding one JWE compact string of the comma-joined values. |
Application
Type: object
The application context.
1 property
| Name | Type | Required | Description |
|---|---|---|---|
id | string | The application UUID. Only available for flows initiated with the |
AllowedOperation
Type: object
An entry that defines a change the service is permitted to make.
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
op | string | Yes | The permitted operation. Allowed values: |
paths | array of string | The paths the operation may target. The service may only target paths listed here. |
SuccessResponse
Type: object
Returned when the service completes successfully.
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
actionStatus | string | Yes | Indicates that the operations should be applied and the flow should continue. Allowed values: |
operations | array of ReplaceOperation | The operations to apply to the flow. Optional; omit it when there is nothing to change but the flow should still proceed. |
ReplaceOperation
Type: object
Creates or replaces a value at the given path.
3 properties
| Name | Type | Required | Description |
|---|---|---|---|
op | string | Yes | The operation to perform. Allowed values: |
path | string | Yes | The path to create or replace, targeting a claim or a credential. Must match one of the paths listed against the |
value | one of: string, array of string | Yes | The value to set. The claim is created if absent and set to empty if the value is an empty string. When the path is marked as encrypted, the value must be a JWE compact string encrypted for WSO2 Identity Platform; an encrypted multi-valued claim must be a single-element array holding one JWE compact string of the comma-joined values. |
FailedResponse
Type: object
Returned when the service decides, on business or policy grounds, that the flow should not continue.
3 properties
| Name | Type | Required | Description |
|---|---|---|---|
actionStatus | string | Yes | Indicates that the flow should stop for a business or policy reason. Allowed values: |
failureReason | string | Yes | A short, user-facing reason for the failure. You can also send an i18n key to show a localized message to the user. |
failureDescription | string | Yes | A longer, user-facing description of the failure. You can also send an i18n key to show a localized message to the user. |
ErrorResponse
Type: object
Returned with HTTP 400, 401, or 500 when the service itself fails to process the request.
3 properties
| Name | Type | Required | Description |
|---|---|---|---|
actionStatus | string | Yes | Indicates that the service hit a processing or server-side error. Allowed values: |
errorMessage | string | Yes | A short error message. Published to diagnostic logs. |
errorDescription | string | Yes | A longer description of the error. Published to diagnostic logs. |
Was this page helpful?