> 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/agent-to-agent.md).

# Agent To Agent

A2A protocol endpoints for inter-agent communication

## Get the agent card

> Returns the A2A agent card of Spark: its identity, the interfaces (HTTP+JSON and JSON-RPC)\
> and their URLs, the supported capabilities and extensions, and the skills Spark offers.\
> \
> The interface URLs are specific to your instance. Unlike public A2A agents, the card is\
> served under \`/api/spark/a2a/\` and requires authentication.<br>

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"tags":[{"name":"Agent-to-Agent","description":"A2A protocol endpoints for inter-agent communication"}],"paths":{"/api/spark/a2a/.well-known/agent-card.json":{"get":{"tags":["Agent-to-Agent"],"summary":"Get the agent card","description":"Returns the A2A agent card of Spark: its identity, the interfaces (HTTP+JSON and JSON-RPC)\nand their URLs, the supported capabilities and extensions, and the skills Spark offers.\n\nThe interface URLs are specific to your instance. Unlike public A2A agents, the card is\nserved under `/api/spark/a2a/` and requires authentication.\n","operationId":"agentCard","responses":{"200":{"description":"Agent card returned successfully","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"Unauthorized"},"402":{"description":"License expired"},"403":{"description":"Forbidden"}}}}}}
```

## Send a message to Spark (HTTP+JSON binding)

> Sends an employee message to Spark. Implements the A2A \`SendMessage\` operation.\
> \
> The call returns as soon as the message is accepted, with a task in \`TASK\_STATE\_WORKING\`\
> and the \`contextId\` and \`taskId\` of the conversation. It does not contain the answer: Spark\
> delivers it later to \`configuration.taskPushNotificationConfig.url\` (see the\
> \`pushNotification\` callback).\
> \
> To continue a conversation, send the next message with the \`contextId\` and \`taskId\` returned\
> by Spark. Without them, Spark starts a new conversation.\
> \
> To receive progress messages while Spark works, activate the tool updates extension with the\
> \`A2A-Extensions\` header.<br>

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"tags":[{"name":"Agent-to-Agent","description":"A2A protocol endpoints for inter-agent communication"}],"paths":{"/api/spark/a2a/v1/message:send":{"post":{"tags":["Agent-to-Agent"],"summary":"Send a message to Spark (HTTP+JSON binding)","description":"Sends an employee message to Spark. Implements the A2A `SendMessage` operation.\n\nThe call returns as soon as the message is accepted, with a task in `TASK_STATE_WORKING`\nand the `contextId` and `taskId` of the conversation. It does not contain the answer: Spark\ndelivers it later to `configuration.taskPushNotificationConfig.url` (see the\n`pushNotification` callback).\n\nTo continue a conversation, send the next message with the `contextId` and `taskId` returned\nby Spark. Without them, Spark starts a new conversation.\n\nTo receive progress messages while Spark works, activate the tool updates extension with the\n`A2A-Extensions` header.\n","operationId":"sendMessage","parameters":[{"name":"Client-Request-Id","in":"header","required":false,"description":"Client identifier for the request. Echoed in the response and forwarded to the webhook. Spark generates one when it is absent.","schema":{"type":"string"}},{"name":"A2A-Extensions","in":"header","description":"Comma-separated A2A extension URIs to activate. Unsupported URIs are ignored. Activating the tool updates extension declared in the agent card pushes ephemeral progress messages (TASK_STATE_WORKING, message.extensions set) to the push notification webhook.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}}},"responses":{"200":{"description":"Message accepted for processing","headers":{"Correlation-Id":{"description":"Identifier assigned by Spark to the request. Provide it to Nexthink Support when reporting an issue.","schema":{"type":"string","format":"uuid"}},"Client-Request-Id":{"description":"The `Client-Request-Id` of the request, or the value generated by Spark.","schema":{"type":"string","format":"uuid"}},"A2A-Extensions":{"description":"Comma-separated URIs of the extensions activated for this request. Absent when no extension was activated.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageResponse"}}}},"400":{"description":"Bad request"},"401":{"description":"Missing, invalid or expired access token"},"402":{"description":"The Spark license of the instance has expired"},"403":{"description":"The access token does not have the Spark API permission"},"500":{"description":"Unexpected error. Retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/A2AError"}}}}},"callbacks":{"pushNotification":{"{$request.body#/configuration/taskPushNotificationConfig/url}":{"post":{"summary":"Task status update pushed by Spark","description":"Spark posts a status update to the webhook given in the request:\n- the answer, once Spark has processed the message;\n- with the tool updates extension active, progress messages before it.\n\nImplement this endpoint on your side.\n","operationId":"sendMessagePushNotification","parameters":[{"name":"Correlation-Id","in":"header","required":false,"description":"Identifier assigned by Spark to the originating request, the same value as the `Correlation-Id` header of the send message response.","schema":{"type":"string"}},{"name":"Client-Request-Id","in":"header","required":false,"description":"The `Client-Request-Id` of the originating request.","schema":{"type":"string"}},{"name":"A2A-Extensions","in":"header","required":false,"description":"Extensions active for the originating request. Present on every webhook call of that request, including the final answer, when the tool updates extension is active.","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"A2A `StreamResponse` carrying a task status update.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StreamResponse"}}}},"responses":{"2XX":{"description":"The webhook accepted the status update. Answer quickly and process the payload asynchronously."},"default":{"description":"The webhook did not accept the status update.\n- `5xx`, `429` or no answer: Spark retries the delivery a limited number of times with\n  exponential backoff. A retried delivery has the same `status.message.messageId`, so use\n  it to discard duplicates.\n- Other `4xx`: the delivery is not retried.\n"}}}}}}}}},"components":{"schemas":{"SendMessageRequest":{"required":["configuration","message"],"type":"object","properties":{"message":{"description":"The message to send","allOf":[{"$ref":"#/components/schemas/Message"}]},"configuration":{"description":"Delivery configuration","allOf":[{"$ref":"#/components/schemas/SendMessageConfiguration"}]}},"description":"A2A send message request"},"Message":{"required":["messageId","parts","role"],"type":"object","description":"A message containing one or more content parts","properties":{"messageId":{"maxLength":50,"minLength":1,"type":"string","description":"Unique message identifier. Generated by the client for each message it sends, and by Spark for each message it returns."},"contextId":{"type":"string","format":"uuid","description":"Conversation identifier. Omit it on the first message; Spark generates one and returns it. Send it on every follow-up message to stay in the same conversation."},"taskId":{"type":"string","format":"uuid","description":"Task identifier. Omit it on the first message; Spark generates one and returns it. Send it on every follow-up message, together with `contextId`."},"role":{"description":"Sender of the message. Clients send `ROLE_USER`; Spark answers with `ROLE_AGENT`.","allOf":[{"$ref":"#/components/schemas/Role"}]},"parts":{"minItems":1,"type":"array","description":"Content of the message","items":{"$ref":"#/components/schemas/Part"}},"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"Key-value metadata. In client messages, `userPrincipalName` is required: the email\naddress (UPN) of the employee the message is from (`UserPrincipalName` is also accepted).\nSpark acts on behalf of this employee. Other keys are kept and returned in the\n`metadata` of the webhook status updates.\n"},"extensions":{"type":"array","description":"URIs of the A2A extensions that produced this message. Set on tool updates pushed by Spark.","items":{"type":"string"}}}},"Role":{"type":"string","description":"Role of the message sender. Supported values: ROLE_USER, ROLE_AGENT","enum":["ROLE_UNSPECIFIED","ROLE_USER","ROLE_AGENT"]},"Part":{"type":"object","description":"A content part. Exactly one of `text` or `raw` must be provided and non-blank.","properties":{"text":{"type":"string","description":"Text content"},"raw":{"type":"string","format":"byte","description":"Base64-encoded file content"},"mediaType":{"type":"string","description":"Media type of the content, for example `text/plain`"},"filename":{"type":"string","description":"File name, for file parts"}}},"SendMessageConfiguration":{"required":["taskPushNotificationConfig"],"type":"object","properties":{"taskPushNotificationConfig":{"description":"Webhook where Spark delivers its answer","allOf":[{"$ref":"#/components/schemas/TaskPushNotificationConfig"}]}},"description":"Configuration for message delivery"},"TaskPushNotificationConfig":{"required":["url"],"type":"object","properties":{"url":{"minLength":1,"type":"string","description":"HTTPS URL of the webhook, in `https://{host}[:{port}][/{path}]` format. It must exactly\nmatch the URL of third-party credentials configured in **Administration > Third-party\ncredentials**. Spark uses those credentials to authenticate when calling the webhook.\nOtherwise the message is rejected with `400`.\n"}},"description":"Webhook where Spark delivers status updates"},"SendMessageResponse":{"type":"object","properties":{"message":{"description":"Not used. Spark always returns a `task`.","nullable":true,"allOf":[{"$ref":"#/components/schemas/Message"}]},"task":{"description":"The task created or continued by the message, in `TASK_STATE_WORKING`. Store its `id` and `contextId` and send them with the next message.","allOf":[{"$ref":"#/components/schemas/Task"}]}},"description":"Acknowledgement returned when a message is accepted"},"Task":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Task identifier, to send as `message.taskId` on the next message"},"contextId":{"type":"string","format":"uuid","description":"Conversation identifier, to send as `message.contextId` on the next message"},"status":{"description":"Current status of the task","allOf":[{"$ref":"#/components/schemas/TaskStatus"}]},"metadata":{"type":"object","additionalProperties":{"type":"object"},"description":"Not used"}},"description":"Task tracking the processing of a message"},"TaskStatus":{"type":"object","properties":{"state":{"description":"Current state of the task","allOf":[{"$ref":"#/components/schemas/TaskState"}]},"message":{"description":"Message from Spark. In webhook status updates, it contains the answer or the progress message.","allOf":[{"$ref":"#/components/schemas/Message"}]},"timestamp":{"type":"string","description":"ISO-8601 timestamp of this status update. Not currently set."}},"description":"Current status of a task"},"TaskState":{"type":"string","description":"Lifecycle state of a task. States used by Spark:\n- `TASK_STATE_WORKING`: Spark is processing the message. Returned in the send message\n  acknowledgement, and in tool updates.\n- `TASK_STATE_COMPLETED`: Spark has answered. The conversation can continue with a new\n  message using the same `contextId` and `taskId`.\n- `TASK_STATE_INPUT_REQUIRED`: Spark needs more information from the employee.\n- `TASK_STATE_FAILED`: Spark could not process the message.\n","enum":["TASK_STATE_UNSPECIFIED","TASK_STATE_SUBMITTED","TASK_STATE_WORKING","TASK_STATE_COMPLETED","TASK_STATE_FAILED","TASK_STATE_CANCELED","TASK_STATE_INPUT_REQUIRED","TASK_STATE_REJECTED","TASK_STATE_AUTH_REQUIRED"]},"A2AError":{"type":"object","description":"Error returned by the HTTP+JSON binding, following the A2A error format.","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/A2AStatus"}}},"A2AStatus":{"type":"object","required":["code","status","message","details"],"properties":{"code":{"type":"integer","description":"HTTP status code"},"status":{"type":"string","description":"Error status","enum":["INVALID_ARGUMENT","FAILED_PRECONDITION","INTERNAL"]},"message":{"type":"string","description":"Human-readable error description"},"details":{"type":"array","description":"Machine-readable error details. Contains one `ErrorInfo` entry.","items":{"$ref":"#/components/schemas/A2AErrorInfo"}}}},"A2AErrorInfo":{"required":["@type","reason","domain"],"type":"object","properties":{"@type":{"type":"string","enum":["type.googleapis.com/google.rpc.ErrorInfo"]},"reason":{"type":"string","description":"A2A error reason","enum":["INVALID_PARAMS","INTERNAL_ERROR","VERSION_NOT_SUPPORTED","UNSUPPORTED_OPERATION"]},"domain":{"type":"string","enum":["a2a-protocol.org"]},"metadata":{"type":"object","additionalProperties":{"type":"string"}}}},"StreamResponse":{"type":"object","description":"A2A stream response. Spark pushes only `statusUpdate`.","properties":{"statusUpdate":{"$ref":"#/components/schemas/TaskStatusUpdateEvent"}}},"TaskStatusUpdateEvent":{"type":"object","description":"Status update pushed to the webhook","properties":{"taskId":{"type":"string","format":"uuid"},"contextId":{"type":"string","format":"uuid"},"status":{"$ref":"#/components/schemas/TaskStatus"},"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"Metadata sent with the originating message"}}}}}}
```

## Send a message to Spark (JSON-RPC 2.0 binding)

> A2A JSON-RPC 2.0 binding. Only the \`SendMessage\` method is supported. Its \`params\` are the\
> same as the body of the HTTP+JSON send message operation, and its \`result\` is the same as\
> that operation's response.\
> \
> Following JSON-RPC 2.0, protocol and validation errors are returned with HTTP \`200\` and an\
> \`error\` object. Authentication and license errors (\`401\`, \`402\`, \`403\`) are returned as HTTP\
> errors.\
> \
> \| Error code | Meaning |\
> \| --- | --- |\
> \| \`-32700\` | The body is not valid JSON. |\
> \| \`-32600\` | Invalid JSON-RPC envelope: \`jsonrpc\` must be \`"2.0"\`, \`id\` must be a string or a number, \`method\` is required. |\
> \| \`-32601\` | Unknown method. |\
> \| \`-32602\` | Invalid \`params\`, with the same causes as \`INVALID\_PARAMS\` on the HTTP+JSON binding. |\
> \| \`-32603\` | Unexpected error. Retry later. |\
> \| \`-32004\` | A2A method that Spark does not support, for example \`GetTask\` or \`SendStreamingMessage\`. |\
> \| \`-32009\` | The \`A2A-Version\` header is not \`1.0\`. |<br>

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"tags":[{"name":"Agent-to-Agent","description":"A2A protocol endpoints for inter-agent communication"}],"paths":{"/api/spark/a2a/v1/rpc":{"post":{"tags":["Agent-to-Agent"],"summary":"Send a message to Spark (JSON-RPC 2.0 binding)","description":"A2A JSON-RPC 2.0 binding. Only the `SendMessage` method is supported. Its `params` are the\nsame as the body of the HTTP+JSON send message operation, and its `result` is the same as\nthat operation's response.\n\nFollowing JSON-RPC 2.0, protocol and validation errors are returned with HTTP `200` and an\n`error` object. Authentication and license errors (`401`, `402`, `403`) are returned as HTTP\nerrors.\n\n| Error code | Meaning |\n| --- | --- |\n| `-32700` | The body is not valid JSON. |\n| `-32600` | Invalid JSON-RPC envelope: `jsonrpc` must be `\"2.0\"`, `id` must be a string or a number, `method` is required. |\n| `-32601` | Unknown method. |\n| `-32602` | Invalid `params`, with the same causes as `INVALID_PARAMS` on the HTTP+JSON binding. |\n| `-32603` | Unexpected error. Retry later. |\n| `-32004` | A2A method that Spark does not support, for example `GetTask` or `SendStreamingMessage`. |\n| `-32009` | The `A2A-Version` header is not `1.0`. |\n","operationId":"sendMessageJsonRpc","parameters":[{"name":"A2A-Version","in":"header","required":false,"description":"A2A protocol version used by the client. Only `1.0` is supported. Omitting the header is the same as sending `1.0`.","schema":{"type":"string","enum":["1.0"]}},{"name":"A2A-Extensions","in":"header","required":false,"description":"Comma-separated URIs of the A2A extensions to activate for this request. URIs that Spark\ndoes not support are ignored and never cause the request to fail.\n\nSupported extensions:\n- `https://docs.nexthink.com/spark/a2a/tool-updates/v1` (tool updates): Spark also pushes\n  progress messages to the webhook while it works on the request. They are status updates\n  in `TASK_STATE_WORKING` with `status.message.extensions` set to the extension URI.\n","schema":{"type":"string"}},{"name":"Client-Request-Id","in":"header","required":false,"description":"Client identifier for the request. Echoed in the response and forwarded to the webhook. Spark generates one when it is absent.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcSendMessageRequest"}}}},"responses":{"200":{"description":"JSON-RPC response containing either a `result` or an `error`","headers":{"Correlation-Id":{"description":"Identifier assigned by Spark to the request. Provide it to Nexthink Support when reporting an issue.","schema":{"type":"string","format":"uuid"}},"Client-Request-Id":{"description":"The `Client-Request-Id` of the request, or the value generated by Spark.","schema":{"type":"string","format":"uuid"}},"A2A-Extensions":{"description":"Comma-separated URIs of the extensions activated for this request. Absent when no extension was activated.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcSendMessageResponse"}}}},"401":{"description":"Missing, invalid or expired access token"},"402":{"description":"The Spark license of the instance has expired"},"403":{"description":"The access token does not have the Spark API permission"}},"callbacks":{"pushNotification":{"{$request.body#/params/configuration/taskPushNotificationConfig/url}":{"post":{"summary":"Task status update pushed by Spark","description":"Same webhook call as for the HTTP+JSON binding. The body is a plain A2A\n`StreamResponse`, not wrapped in a JSON-RPC envelope.\n","operationId":"sendMessageJsonRpcPushNotification","parameters":[{"name":"Correlation-Id","in":"header","required":false,"description":"Identifier assigned by Spark to the originating request, the same value as the `Correlation-Id` header of the send message response.","schema":{"type":"string"}},{"name":"Client-Request-Id","in":"header","required":false,"description":"The `Client-Request-Id` of the originating request.","schema":{"type":"string"}},{"name":"A2A-Extensions","in":"header","required":false,"description":"Extensions active for the originating request. Present on every webhook call of that request, including the final answer, when the tool updates extension is active.","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"A2A `StreamResponse` carrying a task status update.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StreamResponse"}}}},"responses":{"2XX":{"description":"The webhook accepted the status update. Answer quickly and process the payload asynchronously."},"default":{"description":"The webhook did not accept the status update.\n- `5xx`, `429` or no answer: Spark retries the delivery a limited number of times with\n  exponential backoff. A retried delivery has the same `status.message.messageId`, so use\n  it to discard duplicates.\n- Other `4xx`: the delivery is not retried.\n"}}}}}}}}},"components":{"schemas":{"JsonRpcSendMessageRequest":{"required":["jsonrpc","id","method","params"],"type":"object","properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"description":"Request identifier, a string or a number, echoed in the response","oneOf":[{"type":"string"},{"type":"number"}]},"method":{"type":"string","description":"A2A method. Only `SendMessage` is supported.","enum":["SendMessage"]},"params":{"$ref":"#/components/schemas/SendMessageRequest"}}},"SendMessageRequest":{"required":["configuration","message"],"type":"object","properties":{"message":{"description":"The message to send","allOf":[{"$ref":"#/components/schemas/Message"}]},"configuration":{"description":"Delivery configuration","allOf":[{"$ref":"#/components/schemas/SendMessageConfiguration"}]}},"description":"A2A send message request"},"Message":{"required":["messageId","parts","role"],"type":"object","description":"A message containing one or more content parts","properties":{"messageId":{"maxLength":50,"minLength":1,"type":"string","description":"Unique message identifier. Generated by the client for each message it sends, and by Spark for each message it returns."},"contextId":{"type":"string","format":"uuid","description":"Conversation identifier. Omit it on the first message; Spark generates one and returns it. Send it on every follow-up message to stay in the same conversation."},"taskId":{"type":"string","format":"uuid","description":"Task identifier. Omit it on the first message; Spark generates one and returns it. Send it on every follow-up message, together with `contextId`."},"role":{"description":"Sender of the message. Clients send `ROLE_USER`; Spark answers with `ROLE_AGENT`.","allOf":[{"$ref":"#/components/schemas/Role"}]},"parts":{"minItems":1,"type":"array","description":"Content of the message","items":{"$ref":"#/components/schemas/Part"}},"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"Key-value metadata. In client messages, `userPrincipalName` is required: the email\naddress (UPN) of the employee the message is from (`UserPrincipalName` is also accepted).\nSpark acts on behalf of this employee. Other keys are kept and returned in the\n`metadata` of the webhook status updates.\n"},"extensions":{"type":"array","description":"URIs of the A2A extensions that produced this message. Set on tool updates pushed by Spark.","items":{"type":"string"}}}},"Role":{"type":"string","description":"Role of the message sender. Supported values: ROLE_USER, ROLE_AGENT","enum":["ROLE_UNSPECIFIED","ROLE_USER","ROLE_AGENT"]},"Part":{"type":"object","description":"A content part. Exactly one of `text` or `raw` must be provided and non-blank.","properties":{"text":{"type":"string","description":"Text content"},"raw":{"type":"string","format":"byte","description":"Base64-encoded file content"},"mediaType":{"type":"string","description":"Media type of the content, for example `text/plain`"},"filename":{"type":"string","description":"File name, for file parts"}}},"SendMessageConfiguration":{"required":["taskPushNotificationConfig"],"type":"object","properties":{"taskPushNotificationConfig":{"description":"Webhook where Spark delivers its answer","allOf":[{"$ref":"#/components/schemas/TaskPushNotificationConfig"}]}},"description":"Configuration for message delivery"},"TaskPushNotificationConfig":{"required":["url"],"type":"object","properties":{"url":{"minLength":1,"type":"string","description":"HTTPS URL of the webhook, in `https://{host}[:{port}][/{path}]` format. It must exactly\nmatch the URL of third-party credentials configured in **Administration > Third-party\ncredentials**. Spark uses those credentials to authenticate when calling the webhook.\nOtherwise the message is rejected with `400`.\n"}},"description":"Webhook where Spark delivers status updates"},"JsonRpcSendMessageResponse":{"required":["jsonrpc","id"],"type":"object","description":"Contains either `result` or `error`","properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"description":"The request identifier, or null when the request itself is invalid","nullable":true,"oneOf":[{"type":"string"},{"type":"number"}]},"result":{"$ref":"#/components/schemas/SendMessageResponse"},"error":{"$ref":"#/components/schemas/JsonRpcError"}}},"SendMessageResponse":{"type":"object","properties":{"message":{"description":"Not used. Spark always returns a `task`.","nullable":true,"allOf":[{"$ref":"#/components/schemas/Message"}]},"task":{"description":"The task created or continued by the message, in `TASK_STATE_WORKING`. Store its `id` and `contextId` and send them with the next message.","allOf":[{"$ref":"#/components/schemas/Task"}]}},"description":"Acknowledgement returned when a message is accepted"},"Task":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Task identifier, to send as `message.taskId` on the next message"},"contextId":{"type":"string","format":"uuid","description":"Conversation identifier, to send as `message.contextId` on the next message"},"status":{"description":"Current status of the task","allOf":[{"$ref":"#/components/schemas/TaskStatus"}]},"metadata":{"type":"object","additionalProperties":{"type":"object"},"description":"Not used"}},"description":"Task tracking the processing of a message"},"TaskStatus":{"type":"object","properties":{"state":{"description":"Current state of the task","allOf":[{"$ref":"#/components/schemas/TaskState"}]},"message":{"description":"Message from Spark. In webhook status updates, it contains the answer or the progress message.","allOf":[{"$ref":"#/components/schemas/Message"}]},"timestamp":{"type":"string","description":"ISO-8601 timestamp of this status update. Not currently set."}},"description":"Current status of a task"},"TaskState":{"type":"string","description":"Lifecycle state of a task. States used by Spark:\n- `TASK_STATE_WORKING`: Spark is processing the message. Returned in the send message\n  acknowledgement, and in tool updates.\n- `TASK_STATE_COMPLETED`: Spark has answered. The conversation can continue with a new\n  message using the same `contextId` and `taskId`.\n- `TASK_STATE_INPUT_REQUIRED`: Spark needs more information from the employee.\n- `TASK_STATE_FAILED`: Spark could not process the message.\n","enum":["TASK_STATE_UNSPECIFIED","TASK_STATE_SUBMITTED","TASK_STATE_WORKING","TASK_STATE_COMPLETED","TASK_STATE_FAILED","TASK_STATE_CANCELED","TASK_STATE_INPUT_REQUIRED","TASK_STATE_REJECTED","TASK_STATE_AUTH_REQUIRED"]},"JsonRpcError":{"required":["code","message"],"type":"object","properties":{"code":{"type":"integer","description":"JSON-RPC error code. See the operation description for the list.","enum":[-32700,-32600,-32601,-32602,-32603,-32004,-32009]},"message":{"type":"string","description":"Human-readable error description"},"data":{"type":"array","description":"A2A error details, present for `-32004` and `-32009`","items":{"$ref":"#/components/schemas/A2AErrorInfo"}}}},"A2AErrorInfo":{"required":["@type","reason","domain"],"type":"object","properties":{"@type":{"type":"string","enum":["type.googleapis.com/google.rpc.ErrorInfo"]},"reason":{"type":"string","description":"A2A error reason","enum":["INVALID_PARAMS","INTERNAL_ERROR","VERSION_NOT_SUPPORTED","UNSUPPORTED_OPERATION"]},"domain":{"type":"string","enum":["a2a-protocol.org"]},"metadata":{"type":"object","additionalProperties":{"type":"string"}}}},"StreamResponse":{"type":"object","description":"A2A stream response. Spark pushes only `statusUpdate`.","properties":{"statusUpdate":{"$ref":"#/components/schemas/TaskStatusUpdateEvent"}}},"TaskStatusUpdateEvent":{"type":"object","description":"Status update pushed to the webhook","properties":{"taskId":{"type":"string","format":"uuid"},"contextId":{"type":"string","format":"uuid"},"status":{"$ref":"#/components/schemas/TaskStatus"},"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"Metadata sent with the originating message"}}}}}}
```


---

# 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/agent-to-agent.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.
