> For the complete documentation index, see [llms.txt](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/policies-workflows/actions/send-xml-payload.md).

# Send XML Payload

Send XML or SOAP payloads to external endpoints as part of a provisioning workflow.

Sends an XML or SOAP-over-HTTP payload to an external endpoint as a workflow step. Use it to integrate with legacy applications that expose XML or SOAP APIs instead of REST or SCIM.

The action reuses the [Send REST Payload](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/policies-workflows/actions/send-rest-request.md) credential model and captures values from the response via XPath for use by downstream actions.

**Example use cases:**

* Provision users in an on-premises application with a SOAP web service
* Submit payloads to legacy HR or payroll systems
* Trigger an XML webhook in an internal ticketing system
* Capture an identifier from a SOAP response and pass it to a downstream action

## Settings

| Setting                                         | Description                                                                                                                                                                                                                                                                                                                                                                        |
| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| URL                                             | Target endpoint URL. Supports `{attribute_name}` substitution in the path and query string.                                                                                                                                                                                                                                                                                        |
| HTTP Method                                     | Request method. POST is typical for SOAP; GET, PUT, PATCH, DELETE, HEAD, and OPTIONS are also supported.                                                                                                                                                                                                                                                                           |
| Auth Credentials                                | (Required) Stored REST authentication credential. For endpoints that need no authentication, select a credential of type `NONE`. Same model as [Send REST Payload](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/policies-workflows/actions/send-rest-request.md): `HEADER`, `BASIC`, `BEARER`, `LOGIN_TO_BEARER`, `OAUTH2`, `NONE`, `OAUTH2_PASSWORD`. |
| Request Headers                                 | (Optional) Additional request headers. Applied last, so entries here override defaults: including `Content-Type` (see [Content-Type](#content-type)).                                                                                                                                                                                                                              |
| SOAPAction (Optional)                           | Value for the `SOAPAction` HTTP header, required by some SOAP 1.1 services.                                                                                                                                                                                                                                                                                                        |
| XML Payload                                     | Request body. Supports `{attribute_name}` substitution; substituted values are XML-escaped automatically.                                                                                                                                                                                                                                                                          |
| Timeout in seconds                              | Request timeout in seconds. Range: 0–3600. `0` uses the driver default.                                                                                                                                                                                                                                                                                                            |
| Only send if prior actions resulted in a change | When enabled, the request runs only if a prior action in the workflow modified or created resources. Cannot be combined with [Insight Point execution](#insight-point-execution).                                                                                                                                                                                                  |
| Add response to output entities                 | Extract XPath-selected values from the response and expose them as entity attributes for downstream actions.                                                                                                                                                                                                                                                                       |
| Output Entity Type                              | Entity type created from the response. Required when **Add response to output entities** is enabled.                                                                                                                                                                                                                                                                               |
| Response Entity XPath                           | XPath selecting the parent node that contains the result data.                                                                                                                                                                                                                                                                                                                     |
| Response ID XPath                               | XPath selecting the entity identifier within the response.                                                                                                                                                                                                                                                                                                                         |
| Response Name XPath                             | XPath selecting the entity display name within the response.                                                                                                                                                                                                                                                                                                                       |
| Capture all child elements as attributes        | (Advanced) Flatten every direct child element and XML attribute under the response entity node into the output entity's attribute map.                                                                                                                                                                                                                                             |

## Content-Type

`Content-Type` is hard-coded to `text/xml`. There is no Content-Type field in the action settings.

To send a different media type, override the header through **Request Headers**. Entries in that map are applied last, so they win over the default. For example, to send SOAP 1.2:

| Header key     | Header value                                               |
| -------------- | ---------------------------------------------------------- |
| `Content-Type` | `application/soap+xml; action="urn:example:hr:CreateUser"` |

## Variable substitution

The URL and XML Payload fields accept `{attribute_name}` placeholders. Sources include the source of identity and any prior action in the workflow (including a preceding [Provision Account](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/policies-workflows/actions/sync-identities.md) action).

```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <CreateUser xmlns="urn:example:hr">
      <EmployeeId>{employee_id}</EmployeeId>
      <Email>{email}</Email>
      <Department>{department}</Department>
    </CreateUser>
  </soap:Body>
</soap:Envelope>
```

Transformer expressions (`UPPER`, `LOWER`, `TRIM`, dot notation for nested attributes) work the same way as in Send REST Payload. See [Transformers](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/transformers.md).

{% hint style="info" %}
**Substituted values are XML-escaped automatically.** `<`, `>`, `&`, and quote characters are escaped in identity-derived values, and the substituted document is re-checked for well-formedness before send. No manual escaping is required.
{% endhint %}

## Form field substitution (Access Requests only)

When a Send XML Payload action is configured as part of an Access Request [catalog definition](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/features/access-hub/configuration.md), the XML Payload can reference values submitted on the request form. The requester provides values (such as a username or role identifier) at request time, and those values are inserted into the payload at execution.

Use the `{$form_field.field_name}` syntax inside element or attribute content, where `field_name` matches a field defined on the catalog definition.

To configure form field substitution:

1. Author the XML Payload with `{$form_field.*}` placeholders in each element or attribute that takes a requester-supplied value:

   ```xml
   <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
     <soap:Body>
       <CreateUser xmlns="urn:example:hr">
         <Email>{$form_field.email}</Email>
         <RoleName>{$form_field.role_name}</RoleName>
       </CreateUser>
     </soap:Body>
   </soap:Envelope>
   ```
2. On the matching catalog definition, add form fields whose names match the placeholders (`email` and `role_name` in the example above).
3. When a user submits an access request, the value entered for each form field replaces the corresponding `{$form_field.*}` placeholder in the XML Payload before the request is sent.

Form field substitution applies to the XML Payload only. It does not apply to the URL or Request Headers.

Substituted form-field values are XML-escaped automatically, and the substituted document is re-checked for well-formedness before send. Placeholders inside XML comments or `CDATA` sections cannot be safely escaped: a value containing `--` or `]]` can fail the well-formedness recheck, and the action will error.

Field names must contain only letters, numbers, and underscores (`role_name` is valid, `role-name` is not). A field whose name contains an unsupported character might be accepted at catalog-definition save time but is not substituted at execution time, and the literal `{$form_field.*}` placeholder is emitted in the payload. If a placeholder references a field that was not provided on the access request, the placeholder is likewise left unchanged.

## XPath response capture

When **Add response to output entities** is enabled, the action parses the XML response and runs the configured XPath expressions:

| Mapping field         | Example                |
| --------------------- | ---------------------- |
| Output Entity Type    | `LegacyAppUser`        |
| Response Entity XPath | `//CreateUserResponse` |
| Response ID XPath     | `UserId/text()`        |
| Response Name XPath   | `DisplayName/text()`   |

The extracted entity is added to the workflow context. Downstream actions reference it as `{LegacyAppUser.id}` and similar `{EntityType.attribute}` expressions.

For SOAP responses wrapped in a standard envelope, traverse the envelope inline and declare namespace prefixes directly in each XPath expression. There is no separate namespace-registration step: prefixes in your XPath must match the prefixes in the response document as-is.

{% hint style="info" %}
**Capture all child elements as attributes** flattens every direct child element and XML attribute under the response entity node into the output entity's attribute map, alongside the explicit `id` and `name`. Use it when the returned field set varies and enumerating each one isn't practical.
{% endhint %}

## Authentication

The action uses the [Send REST Payload](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/policies-workflows/actions/send-rest-request.md) credential model. Select a stored credential in **Auth Credentials**. The field is required:

* **None** (`NONE`): no authentication header is added; for internal services or pre-authenticated URLs.
* **Header** (`HEADER`): a complete header value, such as an API key, sent as the `Authorization` header.
* **Basic** (`BASIC`): username and password, base64-encoded.
* **Bearer** (`BEARER`): `Bearer <token>`.
* **Login to Bearer** (`LOGIN_TO_BEARER`): exchange credentials at a login endpoint for a Bearer token.
* **OAuth2** (`OAUTH2`): client credentials or other OAuth2 flow.
* **OAuth2 (Password Grant)** (`OAUTH2_PASSWORD`): resource owner password credentials grant, for targets that offer no other machine-to-machine grant.

The **Login to Bearer**, **OAuth2**, and **OAuth2 (Password Grant)** types fetch a token for each job, so a policy that touches many identities makes that many requests to the token endpoint. To reuse one token across the jobs in a policy run, set a [token reuse window](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/policies-workflows/rest-auth-credentials.md#token-reuse-window) on the credential. Veza does not reuse tokens unless you set one.

## Insight Point execution

Set **Data Source** to route execution through an Insight Point instead of the control plane. Use this when the target endpoint is unreachable from the Veza control plane.

| Setting     | Description                                                                                                                                                           |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Data Source | (Optional) Custom Provider data source to route through. Must be configured as an Insight Point Custom Application. When empty, the action runs on the control plane. |

{% hint style="warning" %}
Insight Point execution cannot be combined with **Only send if prior actions resulted in a change**. Setting both `datasource_id` and the upstream-changes flag is rejected at validation.
{% endhint %}

## Test the connection

**Test Connection** checks whether Veza can reach the action's endpoint before the policy is saved. The button is the last item in the action's **Credentials** section, below **Auth Credentials**. It is enabled when the action has a **URL** or the selected credential has a default URL. Without a URL, the button is disabled.

When **Test Connection** is selected, Veza sends an HTTP `HEAD` request to the URL with a 10-second timeout:

* If **Data Source** is empty, Veza sends the request from the Veza control plane.
* If **Data Source** is set, Veza sends the request from that data source's Insight Point, as a job.

The test always uses `HEAD`, regardless of the action's **HTTP Method**. It does not send the action's request headers or payload, and it does not use the action's **Timeout in seconds** setting. Redirects are not followed, and `{attribute_name}` placeholders in the URL are not substituted during the test.

The result appears below the button.

{% hint style="warning" %}
Any HTTP response from the endpoint counts as reachable, including `401`, `403`, and `500`. A successful test confirms only that Veza can reach the endpoint from where the action runs. It does not confirm that the endpoint accepts the credentials, the HTTP method, the headers, or the payload.
{% endhint %}

How the test uses the selected credential:

* **Header**, **Basic**, and **Bearer** credentials are sent as-is and are not verified. For these types, the success message states that the credentials were not verified.
* If the credential has a URL, the tested URL must use the same host and port, and must not change the scheme from HTTPS to HTTP. Otherwise, Veza rejects the test and shows an error.
* If the credential has no URL, the test runs without the credential.

If the endpoint is reachable only from a private network and **Data Source** is empty, the test fails with a message that begins `Connection failed: unable to reach the endpoint from Veza's cloud`. Set **Data Source** to a data source whose Insight Point can reach the endpoint, then test again.

For Send XML Payload, the test does not send the `SOAPAction` header or the XML payload.

## Save-time validation

The XML payload is checked for well-formedness at save time. Common rejections:

* Multiple root elements
* Non-whitespace text outside the root
* Unbalanced or improperly nested tags

Validation runs again on the substituted payload at execution time, so a body that becomes ill-formed because of a substituted value fails safely instead of being sent.

## Configuration

Add the action through the Policy Editor or the policy update API:

* **Policy Editor**: open the policy, choose **Add New Action**, then select **Send XML Payload**.
* **API**: include the action in the policy's `actions` array. The action type identifier is `SEND_XML_PAYLOAD`. See [Update Policy Configuration](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/developers/api/lifecycle-management/policies/updatepolicyconfiguration.md).

## Limitations

* XML only. Use [Send REST Payload](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/policies-workflows/actions/send-rest-request.md) for JSON payloads.
* `Content-Type` is fixed to `text/xml`; override via Request Headers for a different media type.
* No separate XML namespace registration: declare prefixes inline in each XPath expression.
* Response parsing requires well-formed XML when **Add response to output entities** is enabled.
* Streaming, multipart, and MTOM responses are not supported.
* Timeout applies to the entire request; failed requests are not retried automatically.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.veza.com/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/policies-workflows/actions/send-xml-payload.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
