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

# Models

## The ErrorResponse object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}}}}}
```

## The FilePartByContent object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"FilePartByContent":{"required":["mimeType","fileContent"],"type":"object","properties":{"fileContent":{"type":"string"},"mimeType":{"minLength":1,"type":"string"}}}}}}
```

## The MessageDTO object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"MessageDTO":{"required":["parts"],"type":"object","properties":{"parts":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/PartDTO"}}}},"PartDTO":{"type":"object","required":["type"],"properties":{"type":{"$ref":"#/components/schemas/PartType"}},"discriminator":{"propertyName":"type","mapping":{"TEXT":"#/components/schemas/TextPartDTO","FILE":"#/components/schemas/FilePartByContent"}},"oneOf":[{"$ref":"#/components/schemas/TextPartDTO"},{"$ref":"#/components/schemas/FilePartByContent"}]},"PartType":{"type":"string","enum":["TEXT","FILE"]},"TextPartDTO":{"required":["text"],"type":"object","properties":{"text":{"minLength":1,"type":"string"}}},"FilePartByContent":{"required":["mimeType","fileContent"],"type":"object","properties":{"fileContent":{"type":"string"},"mimeType":{"minLength":1,"type":"string"}}}}}}
```

## The PartDTO object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"PartDTO":{"type":"object","required":["type"],"properties":{"type":{"$ref":"#/components/schemas/PartType"}},"discriminator":{"propertyName":"type","mapping":{"TEXT":"#/components/schemas/TextPartDTO","FILE":"#/components/schemas/FilePartByContent"}},"oneOf":[{"$ref":"#/components/schemas/TextPartDTO"},{"$ref":"#/components/schemas/FilePartByContent"}]},"PartType":{"type":"string","enum":["TEXT","FILE"]},"TextPartDTO":{"required":["text"],"type":"object","properties":{"text":{"minLength":1,"type":"string"}}},"FilePartByContent":{"required":["mimeType","fileContent"],"type":"object","properties":{"fileContent":{"type":"string"},"mimeType":{"minLength":1,"type":"string"}}}}}}
```

## The PartType object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"PartType":{"type":"string","enum":["TEXT","FILE"]}}}}
```

## The HandoffConversationMessageRequest object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"HandoffConversationMessageRequest":{"required":["message"],"type":"object","properties":{"metadata":{"type":"object","additionalProperties":{"type":"string"},"nullable":true,"description":"Optional metadata that will be passed through the request flow"},"message":{"$ref":"#/components/schemas/MessageDTO"}}},"MessageDTO":{"required":["parts"],"type":"object","properties":{"parts":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/PartDTO"}}}},"PartDTO":{"type":"object","required":["type"],"properties":{"type":{"$ref":"#/components/schemas/PartType"}},"discriminator":{"propertyName":"type","mapping":{"TEXT":"#/components/schemas/TextPartDTO","FILE":"#/components/schemas/FilePartByContent"}},"oneOf":[{"$ref":"#/components/schemas/TextPartDTO"},{"$ref":"#/components/schemas/FilePartByContent"}]},"PartType":{"type":"string","enum":["TEXT","FILE"]},"TextPartDTO":{"required":["text"],"type":"object","properties":{"text":{"minLength":1,"type":"string"}}},"FilePartByContent":{"required":["mimeType","fileContent"],"type":"object","properties":{"fileContent":{"type":"string"},"mimeType":{"minLength":1,"type":"string"}}}}}}
```

## The TextPartDTO object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"TextPartDTO":{"required":["text"],"type":"object","properties":{"text":{"minLength":1,"type":"string"}}}}}}
```

## The A2AError object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"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"}}}}}}}
```

## The A2AStatus object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"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"}}}}}}}
```

## The A2AErrorInfo object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"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"}}}}}}}
```

## The JsonRpcError object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"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"}}}}}}}
```

## The JsonRpcSendMessageRequest object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"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"}}}}
```

## The JsonRpcSendMessageResponse object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"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"},"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"}}},"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"}}}}}}}
```

## The Message object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"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"}}}}}}
```

## The Part object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"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"}}}}}}
```

## The Role object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"Role":{"type":"string","description":"Role of the message sender. Supported values: ROLE_USER, ROLE_AGENT","enum":["ROLE_UNSPECIFIED","ROLE_USER","ROLE_AGENT"]}}}}
```

## The SendMessageConfiguration object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"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"}}}}
```

## The SendMessageRequest object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"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"}}}}
```

## The SendMessageResponse object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"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"},"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"}}},"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"]}}}}
```

## The StreamResponse object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"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"}}},"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"]},"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"}}}}}}
```

## The Task object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"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"]},"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"}}}}}}
```

## The TaskPushNotificationConfig object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"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"}}}}
```

## The TaskState object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"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"]}}}}
```

## The TaskStatus object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"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"]},"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"}}}}}}
```

## The TaskStatusUpdateEvent object

```json
{"openapi":"3.0.1","info":{"title":"public-api","version":"1.0.0"},"components":{"schemas":{"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"}}},"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"]},"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"}}}}}}
```


---

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