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

# Fusion REST APIs

export const LwTemplate = ({title = "Key questions to get you started", icon = "sparkles", cta = "Powered by Agent Studio", linkHref = "https://lucidworks.com/demo/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta_ai"}) => {
  const [isLoaded, setIsLoaded] = useState(false);
  useEffect(() => {
    const timer = setTimeout(() => {
      setIsLoaded(true);
    }, 500);
    return () => clearTimeout(timer);
  }, []);
  return <div className="lw-template-container">
      <Card title={title} icon={icon}>
        {isLoaded && <span dangerouslySetInnerHTML={{
    __html: `<lw-template id="a029c1a9-28be-427e-b0e1-5d918920246a"></lw-template
            >`
  }} />}
        <Link href={linkHref} className="agent-studio-link text-left text-gray-600 gap-2 dark:text-gray-400 text-sm font-medium flex flex-row items-center hover:text-primary dark:hover:text-primary-light group-hover:text-primary group-hover:dark:text-primary-light">Powered by Lucidworks Agent Studio</Link>
      </Card>
    </div>;
};

[localhost link]: http://localhost:3000/docs/5/fusion/dev-portal/api/overview

[mintlify link]: https://doc.lucidworks.com/docs/5/fusion/dev-portal/api/overview

[old doc.lw link]: https://doc.lucidworks.com/fusion/5.9/424

Fusion’s REST APIs provide programmatic access to Fusion services and features.
You can use the APIs to automate tasks, integrate Fusion with other systems, and build custom applications.

You can access all of Fusion's REST API specifications in the [Fusion APIs tab](/api-reference/apps/get-apps-service-status), or jump directly to one of them here:

<Columns cols={2}>
  <Card title="Admin API" href="/api-reference/apps/get-apps-service-status" icon="gear">
    Manage your Fusion instance, including objects, configurations, connections, and your license.
  </Card>

  <Card title="Apps Manager API" href="/api-reference/license/get-the-fusion-license" icon="grid-2">
    Get information about your Fusion capabilities, entitlements, and consumption.
  </Card>

  <Card title="Async Parsing API" href="/api-reference/parsers-crud-api/list-all-parsers" icon="file-code">
    View, modify, and delete [parsers](/docs/5/fusion/reference/config-ref/parser-stages/overview) in Fusion. This API replaces the Parsers API in Fusion 5.9.11 and up.
  </Card>

  <Card title="Connectors API" href="/api-reference/datasource-configuration-v2-api/list-all-v2-datasources" icon="plug">
    Configure [datasources](/docs/5/fusion/getting-data-in/indexing/overview#datasources), list the installed [connectors](/docs/fusion-connectors/overview), and install or update connectors.
  </Card>

  <Card title="Indexing API" href="/api-reference/index-profiles-api/get-the-service-status" icon="database">
    Create and manage [index pipelines](/docs/5/fusion/getting-data-in/indexing/index-pipelines/overview), [index profiles](/docs/5/fusion/getting-data-in/indexing/index-pipelines/index-profiles), and [index stages](/docs/5/fusion/reference/config-ref/pipeline-stages/index-stages/overview).
  </Card>

  <Card title="Job Config API" href="/api-reference/manage-task-jobs/list-task-jobs" icon="calendar-clock">
    Manage configurations, schedules, and histories for [task type jobs](/docs/5/fusion/operations/jobs-and-scheduling/tasks). Available in Fusion Fusion 5.9.11 and up.
  </Card>

  <Card title="Job Launcher API" href="/api-reference/job-configuration/launch-a-job" icon="rocket">
    Launch and control pre-configured jobs with runtime parameters.
  </Card>

  <Card title="Job REST Server API" href="/api-reference/spark-job-controller-api/list-all-job-runs" icon="server">
    Run and monitor [Spark jobs](/docs/5/fusion/operations/jobs-and-scheduling/spark-jobs) across Fusion’s distributed runtime.
  </Card>

  <Card title="Machine Learning Model API" href="/api-reference/model-service-api/list-all-models" icon="brain-circuit">
    Train, deploy, and manage [machine learning models](/docs/5/fusion/intro/machine-learning/machine-learning-models) in Fusion.
  </Card>

  <Card title="Proxy API" href="/api-reference/system-status/list-services-and-realms" icon="user-check">
    Manage [users](/docs/5/fusion/operations/security/access-control/users),
    [roles](/docs/5/fusion/operations/security/access-control/roles),
    [realms](/docs/5/fusion/operations/security/access-control/security-realms),
    [access tokens](/docs/5/fusion/reference/config-ref/configure-fusion-for-jwt-5x),
    and [API keys](/docs/5/fusion/operations/security/access-control/api-keys).
  </Card>

  <Card title="Query API" href="/api-reference/query-profiles-api/get-the-service-status" icon="magnifying-glass">
    Manage [query pipelines](/docs/5/fusion/getting-data-out/query-basics/query-pipelines/overview),
    [query profiles](/docs/5/fusion/getting-data-out/query-basics/query-pipelines/query-profiles),
    [query stages](/docs/5/fusion/reference/config-ref/pipeline-stages/query-stages/overview),
    [experiments](/docs/5/fusion/getting-data-out/data-analytics/experiments/overview),
    [signals](/docs/5/fusion/getting-data-out/query-enhancement/signals/overview),
    and [query rewrites](/docs/5/fusion/getting-data-out/query-enhancement/query-rewriting).
  </Card>

  <Card title="Templating API" href="/api-reference/render-controller/get-template-information-using-your-app-name" icon="palette">
    Create and manage [Predictive Merchandiser templates](/docs/5/fusion/getting-data-out/curating-your-search-experience/predictive-merchandiser/templates).
  </Card>
</Columns>

<LwTemplate />

## API authentication

There are two ways to authenticate when making API calls to Fusion:

* Basic authentication with a username and password
* API key authentication

### Authenticate with basic auth

You can use a Fusion username and password to authenticate with Fusion’s REST API.
The user’s [role](/docs/5/fusion/operations/security/access-control/roles) and [permissions](/docs/5/fusion/operations/security/access-control/permissions) must include access to the endpoints and methods you want to use.

### Authenticate with an API key

You can use an API key instead of a username and password combination to power your search application or operations.
Pass your API key to Fusion using either `apiKey` or `x-api-key`, as in these examples:

```bash wrap  theme={"dark"}
curl -H "x-api-key: API_KEY" "https://FUSION_HOST/api/query/status"
curl -H "apiKey: API_KEY" "https://FUSION_HOST/api/query/status"
curl https://FUSION_HOST/api/query/status?apiKey=API_KEY
```

For more information, see [API Keys](/docs/5/fusion/operations/security/access-control/api-keys).

## Access API endpoints

API endpoints follow this pattern:

```sh wrap  theme={"dark"}
https://FUSION_HOST/api/SERVICE_NAME/ENDPOINT
```

Example: `https://FUSION_HOST/api/query/query-pipelines`

## Get API specs directly from Fusion

There are a couple of ways to get Fusion’s REST API specifications directly from your Fusion instance.

### Access the Swagger UI

To enable Swagger, use `--set swagger.enabled=true` in the Helm chart install command.

<Warning>
  Authentication and authorization rules do not include the Swagger user interface; anyone with network access to your Fusion instance can see it.
  Before enabling Swagger, determine your organization’s security requirements.
</Warning>

Access the Swagger UI at this URL:

```sh wrap  theme={"dark"}
https://FUSION_HOST/swagger-ui/index.html
```

You can change the URL path to switch between the APIs for different services.
For any API you want to see, change the path to `/SERVICE_NAME/swagger-ui/index.html` in the URL.
For example, change the path to `/indexing/swagger-ui/index.html` to see the Indexing API.

### Get the API specs in JSON

You can view or download the JSON-formatted API specs for each service by appending
`/v2/api-docs` or `/v3/api-docs`
to the service’s base URL:

```sh wrap  theme={"dark"}
https://FUSION_HOST/api/swagger
https://FUSION_HOST/apps-manager/v3/api-docs
https://FUSION_HOST/async-parsing/v3/api-docs
https://FUSION_HOST/connectors/v3/api-docs
https://FUSION_HOST/indexing/v2/api-docs
https://FUSION_HOST/job-config/v3/api-docs
https://FUSION_HOST/job-launcher/v3/api-docs
https://FUSION_HOST/job-rest-server/v3/api-docs
https://FUSION_HOST/ml-model-service/v3/api-docs
https://FUSION_HOST/query/v2/api-docs
https://FUSION_HOST/templating/v3/api-docs
```

## API how-tos and examples

{/* Taken from /Users/dustinguericke/repositories/fusion-docs-site-mintlify/convert_mdx/how-to_mdx/import-via-API.mdx and "Import Data with the REST API" */}

<Accordion title="Send data to an index profile in an app">
  Accessing an index profile through an app lets a Fusion admin secure and manage all objects on a per-app basis. Security is then determined by whether a user can access an app. This is the recommended way to manage permissions in Fusion.

  The syntax for sending documents to an index profile that is part of an app is as follows:

  ```bash wrap theme={"dark"}
  curl -u USERNAME:PASSWORD -X POST -H 'content-type: application/json' https://FUSION_HOST:FUSION_PORT/api/apps/APP_NAME/index/INDEX_PROFILE --data-binary @my-json-data.json
  ```

  <Note>Spaces in an app name become underscores. Spaces in an index profile name become hyphens.</Note>

  To prevent the terminal from displaying all the data and metadata it indexes--useful if you are indexing a large file--you can optionally append `?echo=false` to the URL.

  Be sure to set the content type header properly for the content being sent. Some frequently used content types are:

  * Text: `application/json`, `application/xml`
  * PDF documents: `application/pdf`
  * MS Office:
  * DOCX: `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
  * XLSX: `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`
  * PPTX: `application/vnd.vnd.openxmlformats-officedocument.presentationml.presentation`
  * More types: [http://filext.com/faq/office\_mime\_types.php](http://filext.com/faq/office_mime_types.php)
</Accordion>

<Accordion title="Send JSON data to an index profile in an app">
  In `$FUSION_HOME/apps/solr-dist/example/exampledocs` you can find a few sample documents. This example uses one of these, `books.json`.

  To push JSON data to an index profile under an app:

  1. Create an index profile. In the Fusion UI, click **Indexing > Index Profiles** and follow the prompts.
  2. From the directory containing `books.json`, enter the following, substituting your values for username, password, and index profile name:
     ```bash wrap theme={"dark"}
     curl -u USERNAME:PASSWORD -X POST -H 'content-type: application/json' https://FUSION_HOST:FUSION_PORT/api/apps/APP_NAME/index/INDEX_PROFILE?echo=false --data-binary @books.json
     ```
  3. Test that your data has made it into Fusion:
     1. Log into the Fusion UI.
     2. Navigate to the app where you sent your data.
     3. Navigate to the Query Workbench.
     4. Search for `*:*`.
     5. Select relevant Display Fields, for example `author` and `name`.
</Accordion>

<Accordion title="Send JSON data without specifying an app">
  In most cases it is best to delegate permissions on a per-app basis. But if your use case requires it, you can push data to Fusion without defining an app.

  To send JSON data without app security, issue the following curl command:

  ```bash wrap theme={"dark"}
  curl -u USERNAME:PASSWORD -X POST -H 'content-type: application/json' https://FUSION_HOST:FUSION_PORT/api/index/INDEX_PROFILE --data-binary @my-json-data.json
  ```
</Accordion>

<Accordion title="Send XML data to an index profile in an app">
  To send XML data to an app, use the following:

  ```bash wrap theme={"dark"}
  curl -u USERNAME:PASSWORD -X POST -H 'content-type: application/xml' https://FUSION_HOST:FUSION_PORT/api/apps/APP_NAME/index/INDEX_PROFILE --data-binary @my-xml-file.xml
  ```

  In Fusion 5, documents can be created on the fly using the [PipelineDocument](https://javadoc.lucidworks.com/fusion-pipeline-javadocs/5.9/com/lucidworks/apollo/common/pipeline/PipelineDocument.html) JSON notation.
</Accordion>

<Accordion title="Remove specific documents from the index">
  This example uses the Indexing API to remove content defined in a JSON file:

  ```bash wrap theme={"dark"}
  curl -u USERNAME:PASSWORD -X POST -H 'content-type: application/vnd.lucidworks-document' https://FUSION_HOST:FUSION_PORT/api/apps/APP_NAME/index/INDEX_PROFILE --data-binary @del-json-data.json
  ```

  The JSON file specifies two documents to delete:

  ```json wrap theme={"dark"}
  [
      {
          "id": "978-0641723445",
          "commands": [
              {
                  "name": "delete",
                  "params": {}
              }
          ]
      },
      {
          "id": "978-1423103349",
          "commands": [
              {
                  "name": "delete",
                  "params": {}
              },
              {
                  "name": "commit",
                  "params": {}
              }
          ]
      }
  ]
  ```

  <Tip>You can use `?echo=false` to turn off the response to the terminal.</Tip>
</Accordion>

<Accordion title="Send documents to an index pipeline">
  Although sending documents to an index profile is recommended, if your use case requires it, you can send documents directly to an index pipeline.

  For more information about index pipeline REST API reference documentation, see [Fusion 5.x Index Pipelines API](/api-reference/index-pipelines-api/list-all-index-pipelines).

  When you push data to a pipeline, you can specify the name of the parser by adding a parserId querystring parameter to the URL.
  For example: `https://FUSION_HOST:FUSION_PORT/api/index-pipelines/INDEX_PIPELINE/collections/COLLECTION_NAME/index?parserId=PARSER`.

  If you do not specify a parser, and you are indexing outside of an app (`https://FUSION_HOST:FUSION_PORT/api/index-pipelines/...`), then the `_system` parser is used.

  If you do not specify a parser, and you are indexing in an app context (`https://FUSION_HOST:FUSION_PORT/api/apps/APP_NAME/index-pipelines/...`), then the parser with the same name as the app is used.
</Accordion>

<Accordion title="Clear a collection">
  To clear all content from a collection without deleting the collection, send a `POST` request to this endpoint:

  ```
  /api/solr/{COLLECTIONNAME}/update
  ```

  Include this JSON body in your request:

  ```jason theme={"dark"}
  {"delete":{"query":"*:*"}}
  ```

  <Warning>This operation is irreversible. Use it with caution.</Warning>
</Accordion>

<Card title="Apps Manager API" class="note-image" href="https://academy.lucidworks.com/apps-manager-api" cta="Take this course on the LucidAcademy." icon="graduation-cap" iconType="duotone">
  The quick learning for **Apps Manager API** focuses on the purpose and functions of the Apps Manager API.
</Card>
