> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cassidyai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy via API

> Integrate your Agent into any application using the Cassidy API for programmatic access.

Use the Cassidy API to integrate your [Agent](/agents/overview) into any custom application, internal tool, or [Workflow](/workflows/overview).

<Info>
  **Prerequisites:**

  * An Agent created in Cassidy
  * An API key (or the ability to create one)
</Info>

<Steps>
  <Step title="Navigate to your Agent">
    Go to **Agents** and select the Agent you want to deploy via API. Click **Edit** to open the Agent settings.

    <Frame>
      <img src="https://mintcdn.com/cassidy/RZ75CscZWMGVg8C6/images/integrations/deploying-agents-via-api-img-0.png?fit=max&auto=format&n=RZ75CscZWMGVg8C6&q=85&s=be920871ae479312583841d799ccb946" alt="Agents page showing the list of available Agents" width="2424" height="966" data-path="images/integrations/deploying-agents-via-api-img-0.png" />
    </Frame>
  </Step>

  <Step title="Open the Deployments tab">
    Navigate to the **Deployments** tab and select **Deploy via API**.

    <Frame>
      <img src="https://mintcdn.com/cassidy/RZ75CscZWMGVg8C6/images/integrations/deploying-agents-via-api-img-1.png?fit=max&auto=format&n=RZ75CscZWMGVg8C6&q=85&s=6c88f7671c85ca9c876d854db3c2e418" alt="Agent settings with the Deployments tab selected" width="2490" height="1186" data-path="images/integrations/deploying-agents-via-api-img-1.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cassidy/RZ75CscZWMGVg8C6/images/integrations/deploying-agents-via-api-img-2.png?fit=max&auto=format&n=RZ75CscZWMGVg8C6&q=85&s=175537c4691875d946fac25446914bee" alt="Deploy via API section showing setup instructions and sample code" width="1660" height="1418" data-path="images/integrations/deploying-agents-via-api-img-2.png" />
    </Frame>
  </Step>

  <Step title="Open Organization Settings">
    Click the **API Keys** link in the instructions, or navigate manually: click your name in the bottom left of the sidebar, then click the settings icon for your organization.

    <Frame>
      <img src="https://mintcdn.com/cassidy/RZ75CscZWMGVg8C6/images/integrations/deploying-agents-via-api-img-3.png?fit=max&auto=format&n=RZ75CscZWMGVg8C6&q=85&s=01382785b61736f48a2aa2282a0f4685" alt="Sidebar showing the organization settings gear icon" width="1126" height="682" data-path="images/integrations/deploying-agents-via-api-img-3.png" />
    </Frame>
  </Step>

  <Step title="Navigate to the API Keys tab">
    In the **Organization Settings** window, go to the **API Keys** tab.

    <Frame>
      <img src="https://mintcdn.com/cassidy/RZ75CscZWMGVg8C6/images/integrations/deploying-agents-via-api-img-4.png?fit=max&auto=format&n=RZ75CscZWMGVg8C6&q=85&s=1c5983fa300be5ed7f7fa2e49eb23592" alt="Organization Settings window with the API Keys tab selected" width="2508" height="1532" data-path="images/integrations/deploying-agents-via-api-img-4.png" />
    </Frame>
  </Step>

  <Step title="Create an API key">
    Click **+ Create API Key**, enter a name for the key, and click **Save**. Click the eye icon to reveal the key, then copy it and save it to a secure location. Click **Exit** when finished.

    <Frame>
      <img src="https://mintcdn.com/cassidy/RZ75CscZWMGVg8C6/images/integrations/deploying-agents-via-api-img-5.png?fit=max&auto=format&n=RZ75CscZWMGVg8C6&q=85&s=640ee43eefe66d8ef791f538c8510251" alt="Create API Key dialog with name field and Save button" width="1190" height="504" data-path="images/integrations/deploying-agents-via-api-img-5.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cassidy/RZ75CscZWMGVg8C6/images/integrations/deploying-agents-via-api-img-6.png?fit=max&auto=format&n=RZ75CscZWMGVg8C6&q=85&s=48f168e389c3b225dd0e000222cc5733" alt="API key revealed with copy button and Exit option" width="1372" height="598" data-path="images/integrations/deploying-agents-via-api-img-6.png" />
    </Frame>

    <Warning>Copy and save your API key immediately — you won't be able to see it again after closing the dialog.</Warning>
  </Step>

  <Step title="Use the sample code">
    Return to the **Deploy via API** tab in your Agent's settings. Follow the sample code provided to create conversation threads and send messages programmatically.

    <Frame>
      <img src="https://mintcdn.com/cassidy/RZ75CscZWMGVg8C6/images/integrations/deploying-agents-via-api-img-7.png?fit=max&auto=format&n=RZ75CscZWMGVg8C6&q=85&s=6c94c9e6606efb3443467a0247ad340d" alt="Deploy via API tab showing sample code for creating threads and sending messages" width="1984" height="446" data-path="images/integrations/deploying-agents-via-api-img-7.png" />
    </Frame>
  </Step>
</Steps>

## API basics

The Cassidy API uses threads and messages to manage conversations:

1. **Create a thread** — start a new conversation with the Agent
2. **Send a message** — add a user message to the thread
3. **Receive a response** — the Agent processes the message and returns a reply

For detailed endpoint documentation, request formats, and authentication details, see the [Cassidy API documentation](https://app.cassidyai.com/api-docs).

<Warning>Keep your API key secure. Do not share it publicly or commit it to version control.</Warning>

<Tip>You can delete an API key at any time from the **API Keys** tab by clicking the ellipsis menu and selecting **Delete**.</Tip>

## Next steps

<CardGroup cols={2}>
  <Card title="Agents overview" icon="robot" href="/agents/overview">
    Learn more about creating and configuring Agents.
  </Card>

  <Card title="Deploy via email" icon="envelope" href="/agents/deploy/email">
    Deploy your Agent to a dedicated email address.
  </Card>

  <Card title="Deploy via embed" icon="code" href="/agents/deploy/embed">
    Embed your Agent on a website without writing code.
  </Card>
</CardGroup>
