Skip to main content
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, or jump directly to one of them here:

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 and 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:
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.

Access API endpoints

API endpoints follow this pattern:
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.
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.
Access the Swagger UI at this URL:
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:
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

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:
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
Spaces in an app name become underscores. Spaces in an index profile name become hyphens.
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
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:
    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.
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:
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
To send XML data to an app, use the following:
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 JSON notation.
This example uses the Indexing API to remove content defined in a JSON file:
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:
[
    {
        "id": "978-0641723445",
        "commands": [
            {
                "name": "delete",
                "params": {}
            }
        ]
    },
    {
        "id": "978-1423103349",
        "commands": [
            {
                "name": "delete",
                "params": {}
            },
            {
                "name": "commit",
                "params": {}
            }
        ]
    }
]
You can use ?echo=false to turn off the response to the terminal.
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.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.
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:
{"delete":{"query":"*:*"}}
This operation is irreversible. Use it with caution.
LucidAcademyLucidworks offers free training to help you get started.The Quick Learning for Apps Manager API focuses on the purpose and functions of the Apps Manager API:
Apps Manager APIPlay Button
Visit the LucidAcademy to see the full training catalog.
I