> 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/stackai-api-developer-guide/providers-connections-and-actions.md).

# Providers, connections, and actions

A **provider** describes an integration, an **action** describes an operation it can perform, and a **connection** is an authorized instance of that integration in your organization. A trigger descriptor explains an event source; reading it does not activate a trigger.

#### Discover before invoking

1. GET `/v2/providers` and choose a returned provider ID.
2. GET `/v2/providers/{provider_id}` for its details.
3. GET `/v2/providers/{provider_id}/actions`, then GET the chosen `/{action_id}` for the actual input/output schema.
4. GET `/v2/connections?provider_id=...` and choose an accessible compatible connection. A `needs_reconnection` status requires repair in StackAI.
5. POST `/v2/providers/{provider_id}/actions/{action_id}/run` with `connection_id` when required and the action-specific `inputs`.

```json
{
  "connection_id": "00000000-0000-4000-8000-000000000001",
  "inputs": {"ACTION_SPECIFIC_FIELD": "VALUE_FROM_YOUR_APPLICATION"}
}
```

The UUID and field above are placeholders, not a universally valid action request. Do not infer an action's inputs from its name. Omit `connection_id` only for actions whose contract supports that. The call is synchronous; inspect returned outputs and errors.

The public API lists existing connections; it does not define a connection-create operation in this contract. Establish or reconnect credentials through StackAI's supported connection flow. Users see only connections available through their roles/sharing; an empty list need not mean the organization has none.

Use the trigger list/detail routes to discover configuration requirements. There is no trigger-enable operation in this public catalog. Actions can send messages, update records, or otherwise change third-party systems, so use a test connection first and reconcile ambiguous failures before retrying.

#### Example: read a Linear issue before routing a request

Use a connected Linear account to retrieve an issue's title and status. This is a read operation; it does not create or change an issue. First establish a Linear connection in StackAI and confirm your key has `connections.read` and `connections.use`.

Discover the action's current contract and the connections available to you:

```bash
curl --fail-with-body -sS "$STACKAI_BASE_URL/v2/providers/linear/actions/get_issue" \
  -H "Authorization: Bearer $STACKAI_API_KEY"
curl --fail-with-body -sS --get "$STACKAI_BASE_URL/v2/connections" \
  -H "Authorization: Bearer $STACKAI_API_KEY" \
  --data-urlencode 'provider_id=linear'
```

Choose a healthy Linear connection from the returned list. Save its ID as `CONNECTION_ID`, and choose an issue that account can read. The action requires `issue_id`, which can be an issue identifier such as `ENG-123`.

Create `linear-issue.json` with your actual connection and issue:

```json
{"connection_id":"00000000-0000-4000-8000-000000000001","inputs":{"issue_id":"ENG-123"}}
```

```bash
curl --fail-with-body -sS \
  "$STACKAI_BASE_URL/v2/providers/linear/actions/get_issue/run" \
  -H "Authorization: Bearer $STACKAI_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary @linear-issue.json
```

The result is inside `data.outputs`. For example, an excerpt can contain:

```json
{"data":{"outputs":{"identifier":"ENG-123","title":"Restore customer access","status":"In Progress"}}}
```

Use `identifier`, `title`, and `status` from the response to enrich your application's routing decision. The action returns additional issue fields; consult its discovered output schema. If the connection is missing, check sharing and organization access. If it needs reconnection, repair it in StackAI. If the issue is inaccessible, use an issue the connected Linear account can read.


---

# 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/stackai-api-developer-guide/providers-connections-and-actions.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.
