> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/stackai-api/rest-api-v2/providers-and-actions/post-v2-providers-provider_id-actions-action_id-run.md).

# POST /v2/providers/{provider\_id}/actions/{action\_id}/run

## Run Provider Action

> Run a provider action synchronously and return its outputs.\
> \
> \*\*How to use\*\*\
> \
> Select a compatible accessible connection and submit inputs matching this action. Omit connection\_id only when supported by that action. This synchronous call can change a third-party system; do not automatically repeat an ambiguous write.\
> \
> \*\*Authentication and permissions\*\*\
> \
> Required permissions: \`connections.use\`. Resource and owner access checks also apply.\
> \
> \*\*Prepare request.json\*\*\
> \
> Save the example body below as \`request.json\` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\
> \
> \`\`\`json\
> {\
> &#x20; "connection\_id": "00000000-0000-4000-8000-000000000001",\
> &#x20; "inputs": {\
> &#x20;   "ACTION\_SPECIFIC\_FIELD": "VALUE"\
> &#x20; }\
> }\
> \`\`\`

````json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"tags":[{"name":"endpoint-runProviderActionV2"}],"servers":[{"url":"https://api.stack-ai.com","description":"Hosted API. Use your deployment-specific origin for private installations."}],"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer","description":"Personal API key (sk_...) or supported user access JWT. See Authentication and authorization for endpoint restrictions and scopes. Use exactly one Authorization header."}},"schemas":{"RunProviderActionRequestV2":{"properties":{"connection_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Connection Id"},"inputs":{"additionalProperties":true,"type":"object","title":"Inputs"}},"additionalProperties":false,"type":"object","required":["inputs"],"title":"RunProviderActionRequest","description":"Body for running a provider action; `inputs` is validated against the action's own schema."},"StackAIAPIDataResponse_RunProviderActionResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided."},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{}},"data":{"$ref":"#/components/schemas/RunProviderActionResponseV2","description":"Data returned by the API service"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[RunProviderActionResponseV2]"},"RunProviderActionResponseV2":{"properties":{"outputs":{"additionalProperties":true,"type":"object","title":"Outputs"}},"type":"object","required":["outputs"],"title":"RunProviderActionResponse","description":"The result of running a provider action, keyed by the action's own output parameter names."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v2/providers/{provider_id}/actions/{action_id}/run":{"post":{"tags":["endpoint-runProviderActionV2"],"summary":"Run Provider Action","description":"Run a provider action synchronously and return its outputs.\n\n**How to use**\n\nSelect a compatible accessible connection and submit inputs matching this action. Omit connection_id only when supported by that action. This synchronous call can change a third-party system; do not automatically repeat an ambiguous write.\n\n**Authentication and permissions**\n\nRequired permissions: `connections.use`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"connection_id\": \"00000000-0000-4000-8000-000000000001\",\n  \"inputs\": {\n    \"ACTION_SPECIFIC_FIELD\": \"VALUE\"\n  }\n}\n```","operationId":"runProviderActionV2","parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","title":"Provider Id"}},{"name":"action_id","in":"path","required":true,"schema":{"type":"string","title":"Action Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunProviderActionRequestV2"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_RunProviderActionResponseV2_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
````


---

# 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.stackai.com/stackai-api/rest-api-v2/providers-and-actions/post-v2-providers-provider_id-actions-action_id-run.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.
