> 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/guides-and-quickstarts/interfaces-and-end-user-experiences/publish-a-project-through-the-api.md).

# Publish a project through the API

The API interface lets another application send inputs to a StackAI workflow and receive its outputs. Use it when the workflow must run from an existing application or service.

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQ1Sgy933krTyK0S4JpP%2Fuploads%2FvvsxUEho7WXprwGNPET4%2FG059.mp4?alt=media&token=26f35dda-939f-4724-84a1-e0b592bc53c9>" %}

## Before you start

Have a configured workflow and an API credential authorized to run it.

## Read the generated request

Open the API interface and inspect its generated request and field mappings.

![Generated API request configuration](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/s0GLFhVr0fqyMzWTjjbh/assets/g059-g059-01-request.png)

Use your project's endpoint and input identifiers, and keep authentication credentials private.

## Send a request

Run the request from the API panel and inspect the response.

![API request and response](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/QTdij2fYcYHxXHvSTuh8/assets/g059-g059-02-test.png)

Confirm the returned data matches the expected output structure.

## Find its execution

For a request made by your application, locate the corresponding execution in Analytics.

![API execution in Analytics](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/MaWj8FcS0YQRbcIzXfuD/assets/g059-g059-03-analytics.png)

Use its time and input to distinguish it from other runs.

## Inspect input and output

Open Run Details and expand the input and output.

![Recorded execution input and output](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/xkoXEiZCteD6mQJcx11v/assets/g059-g059-04-details.png)

Compare the received input and returned result with what your application sent and expects to consume.

## Important behavior

Use the endpoint and input identifiers generated for your project. Request fields must match the workflow’s inputs.

Keep API credentials in secure storage. Do not expose them in public website code.

## Continue

* [API key management](https://docs.stackai.com/guides-and-quickstarts/organization-administration/api-key-management.md)
* [Debug a recorded run](https://docs.stackai.com/guides-and-quickstarts/evaluations-and-observability/debug-a-recorded-run.md)


---

# 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/guides-and-quickstarts/interfaces-and-end-user-experiences/publish-a-project-through-the-api.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.
