> For the complete documentation index, see [llms.txt](https://docs.nexthink.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nexthink.com/api/spark.md).

# Spark

Spark API provides two endpoints: agent-to-agent and handoff to Spark. &#x20;

## Spark agent-to-agent API overview

Connect your existing AI agent to Spark using the Agent-to-Agent (A2A) protocol. Employees keep working in their current chat tools, and Spark answers through a webhook you host.

The process consists of the following steps:

1. The employee makes a request in your existing chatbot.
2. Your agent reads the Spark agent card and sends the request to Spark.
3. Spark processes the request and delivers its response to your webhook.
4. Your agent returns the response to the employee and reuses the `contextId` and `taskId` for follow-up messages.

Refer to [Connecting Spark to your AI agent through Agent2Agent](/configuring_nexthink/bringing-data-into-your-nexthink-instance/integrating-nexthink-with-third-party-tools/integrating-spark-with-existing-agents/spark-agent2agent-integration.md) for more information.

## Spark handoff API overview

Spark provides a standard handover mechanism that allows third-party chatbots to transfer a live conversation to Spark without losing context. The process consists of the following steps:

1. Employees initiate an IT request through a familiar enterprise chatbot interface.
2. The chatbot forwards the user message to Spark using the Handoff API.
3. Spark responds in Microsoft Teams and notifies the employee.
4. The employee continues the resolution in Microsoft Teams by interacting with Spark.

This ensures a seamless employee experience and minimizes development effort.

## Setting up API credentials

To set up an integration with the Nexthink API, you must first create a set of API credentials in your instance that the external application or service uses to access the Spark API. Refer to the [API Credentials](/api/readme.md) documentation.

## Configuring Spark for API

Register your webhook URL under **Third-party credentials** in **Administration**. Select **HTTPS** as the protocol. The URL must match the webhook URL that your agent sends in each request.

Refer to [Agent To Agent](/api/spark/agent-to-agent.md) for more information about request structure, authentication, and supported parameters

The Spark handoff API does not require any configuration within the Nexthink platform. Redirection is currently handled automatically through the Spark Microsoft Teams application.

Refer to [Handoff API](/api/spark/handoff-api.md) for more details about request structure, authentication requirements, and supported parameters.


---

# 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.nexthink.com/api/spark.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.
