> ## 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.

# 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/lucidworks-search/09-developer-documentation/config-specs/apis/overview

[mintlify link]: https://doc.lucidworks.com/docs/lucidworks-search/09-developer-documentation/config-specs/apis/overview

[old doc.lw link]: https://doc.lucidworks.com/managed-fusion/5.9/t51gkk

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

You can access all of Lucidworks Search's REST API specifications in the [Lucidworks Search 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 Lucidworks Search 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 Lucidworks Search 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/lucidworks-search/04-move-data-in/parsers/overview) in Lucidworks Search. This API replaces the Parsers API in Lucidworks Search 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/lucidworks-search/04-move-data-in/datasource/overview), 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/lucidworks-search/04-move-data-in/index-pipeline/overview), [index profiles](/docs/lucidworks-search/04-move-data-in/index-profile/overview), and [index stages](/docs/lucidworks-search/04-move-data-in/index-pipeline/index-pipeline-stages).
  </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/lucidworks-search/08-administration/jobs-scheduling/overview). Available in Lucidworks Search 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/lucidworks-search/08-administration/jobs-scheduling/spark-jobs) across Lucidworks Search’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/lucidworks-search/10-machine-learning/overview) in Lucidworks Search.
  </Card>

  <Card title="Proxy API" href="/api-reference/system-status/list-services-and-realms" icon="user-check">
    Manage [users](/docs/lucidworks-search/08-administration/access-control/users),
    [roles](/docs/lucidworks-search/08-administration/access-control/roles),
    [realms](/docs/lucidworks-search/08-administration/access-control/security-realms),
    and [API keys](/docs/lucidworks-search/08-administration/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/lucidworks-search/05-move-data-out/query-pipeline/overview),
    [query profiles](/docs/lucidworks-search/05-move-data-out/query-profile/overview),
    [query stages](/docs/lucidworks-search/05-move-data-out/query-pipeline/query-pipeline-stages),
    [experiments](/docs/lucidworks-search/06-metrics-and-analytics/experiments),
    [signals](/docs/lucidworks-search/07-improve-your-queries/signals/overview),
    and [query rewrites](/docs/lucidworks-search/07-improve-your-queries/overview).
  </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/lucidworks-search/07-improve-your-queries/curate-search-experience/predictive-merchandiser/templates-pm).
  </Card>
</Columns>

<LwTemplate />

## API authentication

There are two ways to authenticate when making API calls to Lucidworks Search:

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

### Authenticate with basic auth

You can use a Lucidworks Search username and password to authenticate with Lucidworks Search’s REST API.
The user’s [role](/docs/lucidworks-search/08-administration/access-control/roles) and [permissions](/docs/lucidworks-search/08-administration/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 Lucidworks Search 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/lucidworks-search/08-administration/access-control/api-keys).

## Access API endpoints

API endpoints follow this pattern:

```sh wrap  theme={"dark"}
https://EXAMPLE_COMPANY.b.lucidworks.cloud/SERVICE_NAME/ENDPOINT
```

**Example: `https://EXAMPLE_COMPANY.b.lucidworks.cloud/query/query-pipelines`**

## Get API specs directly from Lucidworks Search

There are a couple of ways to get Lucidworks Search’s REST API specifications directly from your Lucidworks Search 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 Lucidworks Search 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://EXAMPLE_COMPANY.b.lucidworks.cloud/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://EXAMPLE_COMPANY.b.lucidworks.cloud/api/swagger
https://EXAMPLE_COMPANY.b.lucidworks.cloud/apps-manager/v3/api-docs
https://EXAMPLE_COMPANY.b.lucidworks.cloud/async-parsing/v3/api-docs
https://EXAMPLE_COMPANY.b.lucidworks.cloud/connectors/v3/api-docs
https://EXAMPLE_COMPANY.b.lucidworks.cloud/indexing/v3/api-docs
https://EXAMPLE_COMPANY.b.lucidworks.cloud/job-config/v3/api-docs
https://EXAMPLE_COMPANY.b.lucidworks.cloud/job-launcher/v3/api-docs
https://EXAMPLE_COMPANY.b.lucidworks.cloud/job-rest-server/v3/api-docs
https://EXAMPLE_COMPANY.b.lucidworks.cloud/ml-model-service/v3/api-docs
https://EXAMPLE_COMPANY.b.lucidworks.cloud/query/v3/api-docs
https://EXAMPLE_COMPANY.b.lucidworks.cloud/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 Lucidworks Search 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 Lucidworks Search.

  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 Lucidworks Search 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 Lucidworks Search:
     1. Log into the Lucidworks Search 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 Lucidworks Search 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 Lucidworks Search 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 [Lucidworks Search 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>
