You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Call the endpoint URL for a REST API from workflows in Azure Logic Apps.
4
-
services: logic-apps
2
+
title: Call REST APIs from Workflows with HTTP Swagger
3
+
description: Call REST API endpoints from workflows in Azure Logic Apps by using HTTP Swagger operations.
4
+
services: azure-logic-apps
5
5
ms.suite: integration
6
6
ms.reviewers: estfan, azla
7
7
ms.topic: how-to
8
8
ms.update-cycle: 365-days
9
-
ms.date: 03/10/2026
10
-
# Customer intent: As an integration developer who works with Azure Logic Apps, I want to call a REST endpoint from my workflow.
9
+
ai-usage: ai-assisted
10
+
ms.date: 03/23/2026
11
+
# Customer intent: As an integration developer who works with Azure Logic Apps, I want to call a REST API endpoint URL from my workflow by using HTTP Swagger operations.
11
12
---
12
13
13
-
# Call endpoints for REST APIs from workflows in Azure Logic Apps
14
+
# Call REST API endpoints from workflows in Azure Logic Apps by using HTTP Swagger
To call a REST API endpoint from a logic app workflow in Azure Logic Apps, you can use the built-in **HTTP + Swagger** operations to call any REST API endpoint through a [Swagger file](https://swagger.io). The **HTTP + Swagger** trigger and action work the same as the [HTTP trigger and action](/azure/connectors/connectors-native-http) but provide a better experience in the workflow designer by exposing the API structure and outputs described by the Swagger file. To implement a polling trigger, follow the polling pattern that's described in [Create custom APIs to call other APIs, services, and systems from logic app workflows](/azure/logic-apps/logic-apps-create-api-app#polling-triggers).
18
+
To call a REST API from your workflow in Azure Logic Apps without manually building a request, add the native, built-in **HTTP + Swagger** trigger or action to your workflow. These operations call any REST API endpoint by using a [Swagger file](https://swagger.io) to discover callable operations and get structured inputs and outputs.
19
+
20
+
The **HTTP + Swagger** trigger and action work the same as the [HTTP trigger and action](/azure/connectors/connectors-native-http), but they provide a better experience in the workflow designer by exposing the API structure and outputs described by the Swagger file.
21
+
22
+
This article shows how to add and use the **HTTP + Swagger** trigger and action in your workflow.
18
23
19
24
## Limitations
20
25
21
-
The **HTTP + Swagger** built-in operations currently support only OpenAPI 2.0, not OpenAPI 3.0.
26
+
The **HTTP + Swagger** built-in operations support only OpenAPI 2.0, not OpenAPI 3.0.
22
27
23
28
## Prerequisites
24
29
25
-
* An Azure account and subscription. [Get a free Azure account](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn).
30
+
- An Azure account and subscription. [Get a free Azure account](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn).
26
31
27
-
* The URL for the Swagger file that describes the target REST API endpoint that you want to call
32
+
- The URL for the Swagger file that describes the target REST API endpoint to call.
28
33
29
-
Typically, the REST endpoint has to meet the following criteria for the trigger or action to work:
34
+
Typically, the REST endpoint needs to meet the following criteria for the trigger or action to work:
30
35
31
-
* The Swagger file must be hosted on an HTTPS URL that's publicly accessible.
36
+
- The Swagger file is hosted on a publicly accessible HTTPS URL.
32
37
33
-
* The Swagger file must contain an **operationID** property for each operation in the definition. If not, the connector only shows the last operation in the Swagger file.
34
-
35
-
* The Swagger file must have [Cross-Origin Resource Sharing (CORS)](/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services) enabled.
36
-
37
-
> [!NOTE]
38
-
>
39
-
> To reference a Swagger file that's unhosted or that doesn't meet the security and cross-origin requirements,
40
-
> you can [upload the Swagger file to a blob container in an Azure storage account](#host-swagger), and enable
41
-
> CORS on that storage account so that you can reference the file.
42
-
43
-
* The Consumption or Standard logic app workflow from where you want to call the target endpoint. To start with the **HTTP + Swagger** trigger, create a logic app resource with a blank workflow. To use the **HTTP + Swagger** action, start your workflow with any trigger that you want. This example uses the **HTTP + Swagger** trigger as the first operation.
44
-
45
-
## Add an HTTP + Swagger trigger
46
-
47
-
This built-in trigger sends an HTTP request to a URL for a Swagger file that describes a REST API. The trigger then returns a response that contains that file's content.
38
+
- The Swagger file contains an `operationID` property for each operation in the API definition. If not, the workflow designer shows only the last operation in the Swagger file.
48
39
49
-
1. In the [Azure portal](https://portal.azure.com), open your logic app resource and blank workflow in the designer.
40
+
- The Swagger file needs to turn on [Cross-Origin Resource Sharing (CORS)](/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services).
50
41
51
-
1. Based on whether you have a Consumption or Standard workflow, [follow these general steps to add the **HTTP** trigger named **HTTP + Swagger**](/azure/logic-apps/create-workflow-with-trigger-or-action#add-trigger).
42
+
> [!NOTE]
43
+
>
44
+
> To reference a Swagger file that's unhosted or doesn't meet security and cross-origin requirements, [upload the Swagger file to a blob container in an Azure storage account](#host-swagger), and enable CORS on that storage account.
52
45
53
-
1. In the **Swagger endpoint** box, enter the URL for the Swagger file that you want, and select **Add action**.
46
+
- A Consumption or Standard logic app workflow where you want to call the REST API endpoint.
54
47
55
-
The following example uses a non-functional Swagger URL. Your URL might use a different format.
48
+
To start your workflow with the **HTTP + Swagger** trigger, create a logic app resource that has a blank workflow. To use the **HTTP + Swagger** action, start your workflow with any trigger that works best for your business scenario.
56
49
57
-
:::image type="content" source="media/connectors-native-http-swagger/http-swagger-trigger-parameters.png" alt-text="Screenshot shows workflow designer with selected Add trigger shape and information pane for HTTP + Swagger trigger. The Swagger endpoint property is set to an example URL.":::
50
+
## Add an HTTP + Swagger trigger
58
51
59
-
1. After the designer shows the operations described by the Swagger file, select the operation that you want to use.
52
+
This trigger sends an HTTP request to the URL for a Swagger file that describes a REST API. The trigger returns a response that contains the Swagger file content to the workflow.
60
53
61
-
1. Provide the values for the trigger parameters, which vary based on the selected operation, that you want to include in the endpoint call.
54
+
To implement a polling trigger, follow the [polling trigger pattern](/azure/logic-apps/logic-apps-create-api-app#polling-triggers).
62
55
63
-
1.If the trigger requires that you specify a firing schedule, specify the recurrence for how often you want the trigger to call the endpoint.
56
+
1.In the [Azure portal](https://portal.azure.com), open your logic app resource.
64
57
65
-
1.To add other available parameters, open the **Advanced parameters** list, and select the parameters that you want.
58
+
1.In the designer, open your blank workflow.
66
59
67
-
For more information about authentication types available for HTTP + Swagger, see [Add authentication to outbound calls](/azure/logic-apps/logic-apps-securing-a-logic-app#add-authentication-outbound).
60
+
1. Based on whether your workflow is Consumption or Standard, follow the [general steps](/azure/logic-apps/add-trigger-action-workflow#add-trigger) to add the **HTTP** trigger named **HTTP + Swagger**.
68
61
69
-
1.Continue building your workflow with the actions that you want to run when the trigger fires.
62
+
1.In the **Swagger endpoint** box, enter the URL for the Swagger file, and select **Add action**.
70
63
71
-
1. When you're done, save your workflow. On the designer toolbar, select **Save**.
64
+
The following example shows an example Swagger URL format. Your URL might use a different format.
72
65
73
-
## Add an HTTP + Swagger action
66
+
:::image type="content" source="media/connectors-native-http-swagger/http-swagger-trigger-parameters.png" alt-text="Screenshot that shows the Azure portal, workflow designer, and HTTP + Swagger trigger pane. An example URL is entered for the Swagger endpoint parameter.":::
74
67
75
-
This built-in action sends an HTTP request to the URL for the Swagger file that describes a REST API. The action then returns a response that contains that file's content.
68
+
The trigger information pane shows the operations in the Swagger file.
76
69
77
-
1.In the [Azure portal](https://portal.azure.com), open your logic app resource and workflow in the designer.
70
+
1.Select the operation you want.
78
71
79
-
1.Based on whether you have a Consumption or Standard workflow, [follow these general steps to add the **HTTP** action named **HTTP + Swagger**](/azure/logic-apps/create-workflow-with-trigger-or-action#add-action).
72
+
1.For the selected operation, enter the parameter values to use in the REST API call.
80
73
81
-
1. In the **Swagger endpoint** box, enter the URL for the Swagger file that you want, and select **Add action**.
74
+
Parameters vary based on the selected operation.
82
75
83
-
The following example uses a non-functional Swagger URL. Your URL might use a different format.
76
+
1. If the trigger runs on a schedule, set up the recurrence to specify when the trigger calls the REST API.
84
77
85
-
:::image type="content" source="media/connectors-native-http-swagger/http-swagger-action-parameters.png" alt-text="Screenshot shows workflow designer with trigger named Fabrikam API - Create order and open information pane for HTTP + Swagger action. The Swagger endpoint property is set to a URL.":::
78
+
1. If other parameters exist, open the **Advanced parameters** list, and select the parameters you want.
86
79
87
-
1. After the designer shows the operations described by the Swagger file, select the operation that you want to use.
80
+
For more information about authentication, see [Add authentication to outbound calls](/azure/logic-apps/logic-apps-securing-a-logic-app#add-authentication-outbound).
88
81
89
-
1.Provide the values for the action parameters, which vary based on the selected operation, that you want to include in the endpoint call.
82
+
1.Continue building the workflow with actions to run when the trigger fires.
90
83
91
-
1.To add other available parameters, open the **Advanced parameters** list, and select the parameters that you want.
84
+
1.When you finish, save your workflow. On the designer toolbar, select **Save**.
92
85
93
-
For more information about authentication types available for HTTP + Swagger, see [Add authentication to outbound calls](/azure/logic-apps/logic-apps-securing-a-logic-app#add-authentication-outbound).
86
+
## Add an HTTP + Swagger action
94
87
95
-
1. Continue building your workflow with any other actions that you want to run.
88
+
This action sends an HTTP request to the URL for a Swagger file that describes a REST API. The action returns a response that contains the Swagger file content to the workflow.
96
89
97
-
1.When you're done, save your workflow. On the designer toolbar, select **Save**.
90
+
1.In the [Azure portal](https://portal.azure.com), open your logic app resource.
98
91
99
-
<aname="host-swagger"></a>
92
+
1. In the designer, open your blank workflow.
100
93
101
-
## Host Swagger in Azure Storage
94
+
1. Based on whether your workflow is Consumption or Standard, follow the [general steps](/azure/logic-apps/add-trigger-action-workflow#add-action) to add the **HTTP** action named **HTTP + Swagger**.
102
95
103
-
You can still reference a Swagger file that's not hosted or that doesn't meet the security and cross-origin requirements. Upload the Swagger file to blob container in an Azure storage account and enable CORS on that storage account. To create, set up, and store Swagger files in Azure Storage, follow these steps:
96
+
1. In the **Swagger endpoint** box, enter the URL for the Swagger file, and select **Add action**.
104
97
105
-
1.[Create an Azure storage account](/azure/storage/common/storage-account-create).
98
+
The following example shows an example Swagger URL format. Your URL might use a different format.
106
99
107
-
1. Now enable CORS for the blob. On your storage account's menu, select **CORS**. On the **Blob service** tab, specify these values, and select **Save**.
100
+
:::image type="content" source="media/connectors-native-http-swagger/http-swagger-action-parameters.png" alt-text="Screenshot that shows the Azure portal, workflow designer, and HTTP + Swagger action pane. An example URL is entered for the Swagger endpoint parameter.":::
108
101
109
-
| Property | Value |
110
-
|----------|-------|
111
-
|**Allowed origins**|`*`|
112
-
|**Allowed methods**|`GET`, `HEAD`, `PUT`|
113
-
|**Allowed headers**|`*`|
114
-
|**Exposed headers**|`*`|
115
-
|**Max age** (in seconds) |`200`|
102
+
The action information pane shows the operations in the Swagger file.
116
103
117
-
Although this example uses the [Azure portal](https://portal.azure.com), you can use a tool such as [Azure Storage Explorer](https://storageexplorer.com/), or automatically configure this setting by using this sample [PowerShell script](https://github.com/logicappsio/EnableCORSAzureBlob/blob/master/EnableCORSAzureBlob.ps1).
104
+
1. Select the operation you want.
118
105
119
-
1.[Create a blob container](/azure/storage/blobs/storage-quickstart-blobs-portal). On the container's **Overview** pane, select **Change access level**. From the **Public access level** list, select **Blob (anonymous read access for blobs only)**, and select **OK**.
106
+
1.For the selected operation, enter the parameter values to use in the REST API call.
120
107
121
-
1.[Upload the Swagger file to the blob container](/azure/storage/blobs/storage-quickstart-blobs-portal#upload-a-block-blob), either through the [Azure portal](https://portal.azure.com) or [Azure Storage Explorer](https://storageexplorer.com/).
108
+
Parameters vary based on the selected operation.
122
109
123
-
1.To reference the file in the blob container, get the HTTPS URL that follows this format, which is case-sensitive, from Azure Storage Explorer:
110
+
1.If other parameters exist, open the **Advanced parameters** list, and select the parameters you want.
For more information about authentication, see [Add authentication to outbound calls](/azure/logic-apps/logic-apps-securing-a-logic-app#add-authentication-outbound).
126
113
127
-
## Connector technical reference
114
+
1. Continue building the workflow with actions to run when the trigger fires.
128
115
129
-
This section provides more information about the outputs from an**HTTP + Swagger** trigger and action.
116
+
1. When you finish, save your workflow. On the designer toolbar, select**Save**.
130
117
131
-
###Outputs
118
+
## Outputs from HTTP + Swagger operations
132
119
133
-
The **HTTP + Swagger**call returns the following information:
120
+
This section provides more information about the outputs from the **HTTP + Swagger** trigger and action. The **HTTP + Swagger**operation returns the following information:
134
121
135
122
| Property name | Type | Description |
136
123
|---------------|------|-------------|
137
-
|**headers**| Object | The headers from the request |
138
-
|**body**| Object | The object with the body content from the request |
139
-
|**status code**| Integer | The status code from the request |
124
+
|**headers**| Object | The headers from the request.|
125
+
|**body**| Object | The object with the body content from the request.|
126
+
|**status code**| Integer | The status code from the request.|
140
127
141
128
| Status code | Description |
142
129
|-------------|-------------|
@@ -148,8 +135,47 @@ The **HTTP + Swagger** call returns the following information:
148
135
| 404 | Not Found |
149
136
| 500 | Internal server error. Unknown error occurred. |
150
137
151
-
## Related content
138
+
<aname="host-swagger"></a>
139
+
140
+
## Host the Swagger in Azure Storage
152
141
153
-
*[Managed connectors for Azure Logic Apps](/connectors/connector-reference/connector-reference-logicapps-connectors)
154
-
*[Built-in connectors for Azure Logic Apps](/azure/connectors/built-in)
142
+
You can still reference a Swagger file that's not hosted or that doesn't meet the security and cross-origin requirements. Upload the Swagger file to a blob container in an Azure storage account and turn on CORS on the storage account.
143
+
144
+
To create, set up, and store Swagger files in Azure Storage, follow these steps:
145
+
146
+
1. In the Azure portal, [create an Azure storage account](/azure/storage/common/storage-account-create).
147
+
148
+
1. Turn on CORS for the blob by following these steps:
149
+
150
+
1. On the storage account sidebar, under **Settings**, select **CORS**.
151
+
152
+
1. On the **Blob service** tab, enter the following values, and select **Save**.
153
+
154
+
| Parameter | Value |
155
+
|-----------|-------|
156
+
|**Allowed origins**|`*`|
157
+
|**Allowed methods**|`GET`, `HEAD`, `PUT`|
158
+
|**Allowed headers**|`*`|
159
+
|**Exposed headers**|`*`|
160
+
|**Max age** in seconds |`200`|
161
+
162
+
This example uses the Azure portal, but you can use a tool like [Azure Storage Explorer](https://storageexplorer.com/) to configure this setting. To automate configuration, see the [sample PowerShell script](https://github.com/logicappsio/EnableCORSAzureBlob/blob/master/EnableCORSAzureBlob.ps1).
163
+
164
+
1.[Create a blob container](/azure/storage/blobs/storage-quickstart-blobs-portal) and follow these steps:
165
+
166
+
1. On the container sidebar, select **Overview**.
167
+
168
+
1. On the **Overview** page, select **Change access level**.
169
+
170
+
1. From the **Public access level** list, select **Blob (anonymous read access for blobs only)**, and then select **OK**.
171
+
172
+
1. In the Azure portal or Azure Storage Explorer, [upload the Swagger file to the blob container](/azure/storage/blobs/storage-quickstart-blobs-portal#upload-a-block-blob).
173
+
174
+
1. To reference the file in the blob container, from Azure Storage Explorer, get the HTTPS URL that uses the following case-sensitive format:
0 commit comments