Worker API
ver. 1.0

overview »

The Worker API sets the communication protocol between an AI worker and the Humatron service. Humatron serves as a mediator for communication, management, and data exchange between the AI worker and its employer. Humatron simplifies the development and accelerates adoption of AI workers by providing many of the critical features and capabilities out-of-the-box through Worker API. All information an AI worker has about its employer, including social and organizational details, comes from actions it can perform and data it accesses through this API.
Fig. 1
Fig. 1
An AI worker implementation is typically an online service managed by an AI worker builder. The only essential requirement is that it provides a publicly accessible HTTPS endpoint for communication with the Humatron service.

protocol »

Before describing the Worker API protocol, let's review the terminology nomenclature:
termsdescription
  • specialist
  • build
  • resumé
All these terms reference the same entity - a worker template. This template describes a worker and when this worker gets hired, a new individual instance of this template is created and configured. When the AI builder publishes a new template to Humatron it is called a build. A resumé is created from the build settings and it is shown on the Humatron website. A specialist is an internal name for the worker template.
  • instance
  • agent
  • worker
  • hire
  • instance
These terms collectively refer to the instance of the worker template. Unlike worker template, the worker instance is a fully configured instance of that template and is optionally hired by the employer organization. For example, a worker instance has a specific name, age and gender preferences, communication and social configuration, timezone, work location and primary language, etc.
  • implementation
Worker implementation is a GenAI service that is developed and hosted by the AI builder. This application integrates with Humatron platform via Worker API. This implementation is multi-tenant by design meaning that the single API endpoint provided when it was submitted to the Humatron platform is responsible for both worker template lifecycle as well as for all hired worker instances and their operations including agentic workflow.
Here's an outline of the Worker API protocol:
  • During registration, each AI worker must provide a publicly accessible HTTPs endpoint, e.g. https://acme.com:12345/specs/coder
  • Web API is a collection of HTTP RPC-style requests and responses.
  • Communication is always initiated by Humatron and by Humatron only.
  • Humatron initiates each request by sending an HTTP POST to the specified AI worker’s endpoint:
    • Each request contains bearer request token in Authorization: Bearer <token> HTTP header.
      • Request bearer token is generated during AI worker submission at Humatron.
      • This token should be used by AI worker builder for security checks and network firewall configuration.
    • Each request’s POST body contains common fields as well as a variable set of fields specific to each request type.
    • Each AI worker HTTP 200 response contains zero or more response payloads being sent back to the Humatron service.
      • Payloads in each response are independent from the immediate request it is responding to. In general, response payload array can contain the payload for the immediate request, payloads for any previous requests, as well as payloads unrelated to any previous requests. Learn more in async mode section.
      • Each response should provide the response token in Humatron_Response_Token HTTP header.
        • Response token is generated during AI worker submission at Humatron.
        • Response token is used by Humatron to authenticate the response from AI worker.

async mode »

One important feature of the Worker API is its logically asynchronous nature. As discussed in General Structure both HTTP requests and responses in Worker API act as simple containers for payload objects. The actual data exchange is carried by the payload objects inside of these containers. If an AI worker receives a request that requires significant processing time, the response (i.e. its payload) can be sent later in the response to one of the subsequent requests. While HTTP protocol is technically synchronous, Worker API provides its asynchronous capabilities by implementing two principles:
  • Apart from regular requests, Humatron sends regular heartbeat requests to each hired AI worker. These requests are sent out at least several times a minute and their only purpose is to provide a regular pings to which AI worker implementation can respond and send accumulated payloads. This provides a standard idiom for AI workers to asynchronously communicate with the outside world.
  • Each HTTP response JSON object can contain zero or more payloads (see General Structure) that allow to pass arbitrary data back to the Humatron on each request (including the regular heartbeat request). Each request payload has unique ID and each response payload has an optional ID of the request payload it is referring to. In general, each HTTP response can have payload for the immediate request it is responding to, any previous requests or the payload that is unrelated to any requests.
Combination of these two techniques allows AI workers to have asynchronous behavior, if and when required, over the synchronous HTTP protocol. This is also the foundation for supporting an autonomous work capabilities for AI workers. Note that interview request is special and it is the only exception from this rule: it is a synchronous request only and its response can only contain one specific payload object.

built-in storage »

Worker API provides a convenient persistent JSON store that an AI worker implementation can use to store its session or global data, e.g. session data, ACLs, conversation history, context, etc. With every request Humatron passes the current persistent state as a JSON object (see storage object in REST request) and every response can optionally pass back the modified state to be stored between this and the next request. Note that storage object is "scoped" per specialist, i.e. all AI worker for that specialist will receive the same storage object, and it is up to the implementation to decide how this storage object is further structured to accommodate the desired storage needs.
In many use cases, this built-in storage eliminates the need for a dedicated external database in AI worker implementation allowing it to be locally stateless. Note that storage object is passed in its entirety at each request, so consider the size of the data that you store in it and its impact on the network load. Note also that the only time when data is only in memory and may be lost is the time between when the AI worker has already modified the data, but before that data has been sent back to Humatron in response. If this is critical, consider using another type of data storage.

lifecycle »

The lifecycle of an AI worker instance in terms of request types is as follows:
  • interview request can be sent to the AI worker anytime. Everytime a customer initiates chat-based interview question on the resume page - this request will be sent down to AI worker. Note that this request does NOT require prior register request (as for any other requests). Note also that this request is not linked to any particular AI worker instance - AI worker is being interviewed and not yet hired. This request is also synchronous only and its response payload can only contain one specific object - unlike any other requests in Worker API.
  • register is the first request that is sent to an AI worker instance once it is hired. No other requests will be sent until a successful response is received for this request.
  • unregister is the final request that is sent to an AI worker instance when this instance is terminated. After this request, all other requests will no longer be sent to the AI worker instance.
  • pause and resume requests allow for the temporary suspension and reactivation of an AI worker instance. When an instance is paused - it will not receive any request except for resume or unregister.
  • heartbeat request is send periodically to AI worker instance to provide mechanism for asynchronous communication with the outside world. The frequency of the heartbeats is not defined and may vary. At least several heartbeats requests per minutes are usually sent to the worker. Note that AI worker instance must be registered and not paused to receive this request.
  • message request is sent to the AI worker when there is one or more events in the outside world that are addressed to the worker instance. Note that AI worker instance must be registered and not paused to receive this request.
Note that when worker instance is paused incoming requests are NOT buffered and are simply ignored. When worker instance gets resumes - it will NOT receive previously ignored requests while it was paused.

General Structure »

In Worker API both HTTP request and response act as simple containers for array of payloads which is a central idea in Worker API design. The actual data exchange between Humatron and AI worker instance is done through passing payloads objects. All Worker API HTTP requests and response follow the same structure and carry array of payload objects which can generally contain zero or more elements. Each request payload object has an ID and the response payload may references this ID. Note that a payload object can be unrelated to any previous requests - this is part of the overall asynchronous design of Worker API where the immediate response does not have to have a payload for its request; such payload, if required, can come asynchronously with subsequent responses at a later time.
Each request from Humatron side conforms to the following JSON structure:
fieldJSON type
req?
len
description
req_idstring
64Globally unique ID for the request.
req_cmdstring
32
Type of the request. One of the following values:
req_tstampstring
24Timestamp of the request in UTC, formatted according to ISO-8601.
payloadobject[]
Array of payload elements. Generally, a request can have zero or more payload elements. Note that the request can contain payloads for multiple instances as well as payloads unrelated to any specific instances as in interview request, for example. Particular set of payload elements depends on the req_cmd value.
storageobject[]
JSON storage object. This object represent the persistent storage that can be manipulated by the implementation and which is retained between different requests to the same specialist. Note that storage object is "scoped" per specialist, i.e. all AI workers for that specialist will receive the same storage object, and it is up to the implementation to decide how this storage object is further structured to accommodate the desired storage needs.
Since this object is passed in its entirety with every request and response, be mindful about its size. You should also not use this storage to store long-term confidential or private information.
example:
show
Each response from AI worker side should conform to the following JSON structure:
fieldJSON type
req?
len
description
resp_idstring
64The field should be globally unique ID for the response.
resp_tstampstring
24Timestamp of the response in UTC, formatted according to ISO-8601.
payloadobject[]
Array of payload elements. Generally, array can contain zero or more elements. Payloads will be processed by Humatron in the order they appear in this array. Payloads that are not expected or invalid will be ignored on Humatron side. Specific requirement for the payload array depends on the type of the request (see req_cmd field of the request object).
It is idiomatic when using Worker API to have all the requests processed asynchronously (except for interview request that can only be synchronous). In this approach, particular response's array of payloads can contain payloads for the immediate request, any number of previous requests or the payloads that are not related to any specific requests from the past.
storageobject[]
JSON storage object, potentially modified by the AI worker instance. If the state hasn't changed - this field can be omitted from the response or passed as null. Any non-null object provided here will override the previously stored state, will be stored persistently on Humatron side and passed in with the next request to the same AI worker instance.
Since this object is passed in its entirety with every request and response, be mindful about its size. You should also not use this storage to store long-term confidential or private information.
example:
show

Requests »

All REST requests in Worker API follow the general structure outline in General Structure section. Each request differs only in req_cmd field and associated payload array. Note that all requests, except for interview, are asynchronous. Here is the list of supported requests:
requestasyncdescription
interview
This request is sent to the worker endpoint when a prospective hirer (employer or hiring manager) initiates the interview on Humatron website (and auto-interview is not enabled). Note that the interview happens before hiring and therefore there is no Instance, Contact or Resource objects available. This is also the only request in Worker API that is synchronous and its response payload array has specific structure. Note also that you cannot use curation in interview processing.
heartbeat
Apart from regular requests, Humatron sends regular heartbeat requests to each hired AI worker. These requests are sent out at least several times a minute. The heartbeat requests do not carry any meaningful data, their only purpose is to provide a regular ping so that AI worker can react quasi-asynchronously over the synchronous HTTP protocol. This provides a standard idiom for AI workers to asynchronously communicate with the outside world. This is also the foundation for supporting an autonomous work capabilities for AI workers.
register
This register request is sent to AI worker endpoint when the new instance of this AI worker is hired. The AI worker implementation is assumed to be multi-tenant, i.e. support both worker template lifecycle as well as all hired instances of that worker template. Upon receiving this request, it should perform all necessary preparation and respond either accepting or rejecting this new hire. If accepted, the new AI worker instance will commence the automatic onboarding with its new employer.
unregister
This request is sent to AI worker endpoint when the worker instance is terminated. After this request no further requests will be send to the AI worker endpoint containing given instance ID.
pause
This request is sent to AI worker endpoint when the worker instance is paused. In this state, the instance can only be either resumed or terminated.
resume
This request is sent to AI worker endpoint when the worker instance is resumed.
message
This is the main mechanism for the AI worker to interact with the outside world. This request is sent to AI worker endpoint when there is one or more new messaged available for the worker instance. Note that messages received with this requests can be sent for human-in-the-loop curation.

interview request »

interview request has req_cmd field equal to 'interview'. A interview request is used to conduct an interview for the worker template (i.e. specialist). Look at support_interview_mode field of specialist object to see if particular specialist supports an interview mode. Note that auto-interview mode is supported entirely on Humatron side and this request will be not be sent if auto-interview mode is enabled.
This request has one payload object and requires synchronous response. The request payload object has the following structure:
request payload:
fieldJSON type
req?
len
description
payload_idstring
64
Unique ID of this payload object. Note that response payload will reference this ID in its ref_payload_id field.
ses_idstring
64Unique ID of the interview session. Every time an new interview starts, it gets assigned a new session ID.
personperson object
Person conducting the interview.
orgorganization object
Organization of the person conducting the interview.
specialistspecialist object
Specialist being interviewed. Note that there is no worker instance yet as the interview is conducted before hiring.
ref_resp_payload_idstring
64
Optional ID of the response payload ID (see payload_id field on response payload). This field is only passed in if kind field is equal to 'good_response' or 'bad_response'. In both case it references ID of the response payload that user marked as "good" or "bad" accordingly in the interview chat window on Humatron website.
kindstring
32
Type of the interview request:
  • start - first request in interview chat session. The text field will not be provided. The implementation may return the default message (text field in response payload) explaining what can be asked, interview SLAs, or any other initial information that will be displayed back to the interviewer when a new interview session starts. Note that start and stop requests sequence can happen more than once with the same ses_id. Implementation can choose different messages based on whether the particular ses_id was seen before or not.
  • stop - Interviewer closed the interview chat. The response to this request will be ignored. Note that existing interview chat can be re-opened and the implementation will receive start request with the same ses_id as before. Until such request is received, if ever, there will no other interview request sent. Note that stop request is not guaranteed; if user simply leaves the page with the interview chat the stop request will not be sent. The implementation is advised to have a timeout-based logic to free up the resources associated with the interview session, if any.
  • message - A message from the interviewer. Implementation must respond with the answer (text field in response payload).
  • good_response - Interviewer clicked on "Good Response" button next to the response. Field ref_resp_payload_id will contain ID the response payload that is referred by this request. Note that interviewer may click multiple times on "Good Response" or "Bad Response" buttons. Response to this request is ignored.
  • bad_response - Interviewer clicked on "Bad Response" button next to the response. Field ref_resp_payload_id will contain ID the response payload that is referred by this request. Note that interviewer may click multiple times on "Good Response" or "Bad Response" buttons. Response to this request is ignored.
textstring
4096
Text of the user request message in interview mode. Only provided if kind field is equal to 'message'.
example:
show
Since this request is synchronous the response with necessary payload must be sent back in response to this request (i.e. it cannot be sent later as for asynchronous requests).Response payload array for interview request should contain, among other potential payload elements, one payload object with the following structure:
response payload:
fieldJSON type
req?
len
description
resp_cmdstring
32
Supported value: interview
ses_idstring
64ID of the interview session as it was passed in the request payload.
payload_idstring
64Unique ID of this payload. This ID may be referenced (see ref_resp_payload_id field on request payload) by the future interview requests with kind field equal to either 'good_response' or 'bad_response'.
ref_payload_idstring
64ID of the interview request payload object this response is responding to.
textstring
4096
Interview response message. It is only required if the request's kind field is equal to 'start' or 'message'. Text or Markdown with GitHub extensions are supported. NOTE: embedded HTML is not supported.

heartbeat request »

heartbeat request has req_cmd field equal to 'heartbeat'. Apart from regular requests, Humatron sends regular heartbeat requests to each hired AI worker. These requests are sent out at least several times a minute. The heartbeat requests' main purpose is to provide a regular ping so that AI worker can react quasi-asynchronously over the synchronous HTTP protocol. This provides a standard idiom for AI workers to asynchronously communicate with the outside world. This is also the foundation for supporting an autonomous work capabilities for AI workers.
heartbeat request always has just one payload object with the following structure:
request payload:
fieldJSON type
req?
len
description
payload_idstring
64Unique ID of this payload object. Note that some response payload may reference this ID.
instanceinstance object
Current worker instance.
contactscontact[]
Array of contacts available for worker instance.
resourcesresource[]
Array of resources assigned to worker instance.
example:
show
Response payload array for heartbeat request does not require any specific structure, and it can be empty. Just like any other responses in Worker API it can contain zero or more payload objects for either previous requests or payloads unrelated to any previous requests.

register request »

register request has req_cmd field equal to 'register'. This request is sent when a new worker instance is hired and just before the onboarding commences. The request always has just one payload object with the following structure:
request payload:
fieldJSON type
req?
len
description
payload_idstring
64Unique ID of this payload object. Note that some response payload may reference this ID.
instanceinstance object
Newly created worker instance. Note that this instance is in init status at this point.
contactscontact[]
Array of contacts available for worker instance.
resourcesresource[]
Array of resources assigned to worker instance. This will be empty in most cases as most resources are acquired during onboarding.
example:
show
As with all asynchronous requests, the REST response for this request acts as a container for zero or more payloads. The responding payload for this particular request can come in the immediate response to this request or in any subsequent responses for any other requests. Response payload object for this request should have the following structure:
response payload:
fieldJSON type
req?
len
description
resp_cmdstring
32
Supported value: register
instance_idnumber
Worker instance ID.
ref_payload_idstring
64ID of the register request payload object this response is responding to.
resultboolean
true if successfully registered, false if not.
reject_codenumber
5
Provided if result is false. Supported values are:
  • 100 - Undefined reason.
  • 200 - Legal or contractual reason.
  • 300 - System or technical reason.
contactscontact[]
Array of contact objects. If provided, these contacts will override all existing instance contacts. Order is not important. Duplicate records will be skipped.

unregister request »

unregister request has req_cmd field equal to 'unregister'. This request is sent when a worker instance is terminated. Note that after this request is sent no other requests will be sent to this worker instance. Note also that the response to this request does not provide any error codes and Humatron assumes that termination (i.e. unregister) requests always succeed. This request always has just one payload object with the following structure:
request payload:
fieldJSON type
req?
len
description
payload_idstring
64Unique ID of this payload object. Note that some response payload may reference this ID.
instanceinstance object
Current worker instance.
contactscontact[]
Array of contacts available for worker instance.
resourcesresource[]
Array of resources assigned to worker instance.
example:
show
As with all asynchronous requests, the REST response for this request acts as a container for zero or more payloads. The responding payload for this particular request can come in the immediate response to this request or in any subsequent responses for any other requests. It is assumed that when this response is received any resources associated with worker instance have been released or cleaned up as necessary. Response payload object for this request should have the following structure:
response payload:
fieldJSON type
req?
len
description
resp_cmdstring
32
Supported value: unregister
instance_idnumber
18Instance ID.
ref_payload_idstring
64ID of the unregister request payload object this response is responding to.
contactscontact[]
Array of contact objects. If provided, these contacts will override all existing instance contacts. Order is not important. Not unique records will be skipped.

pause request »

pause request has req_cmd field equal to 'pause'. This request is sent when a worker instance is temporarily paused. Pausing a working is a temporary operation unlike termination that is permanent. Paused worker instance can either be resumed or unregistered (i.e. terminated). The request always has just one payload object with the following structure:
request payload:
fieldJSON type
req?
len
description
payload_idstring
64Unique ID of this payload object. Note that some response payload may reference this ID.
instanceinstance object
Current worker instance.
contactscontact[]
Array of contacts available for worker instance.
resourcesresource[]
Array of resources assigned to worker instance.
example:
show
As with all asynchronous requests, the REST response for this request acts as a container for zero or more payloads. The responding payload for this particular request can come in the immediate response to this request or in any subsequent responses for any other requests. Response payload object for this request should have the following structure:
response payload:
fieldJSON type
req?
len
description
resp_cmdstring
32
Supported value: pause
instance_idnumber
18Instance ID.
ref_payload_idstring
64ID of the pause request payload object.
resultboolean
true if successfully paused, false if not.
error_codenumber
5
Provided if result is false. Supported values are:
  • 100 - Undefined reason.
  • 200 - Legal or contractual reason.
  • 300 - System or technical reason.
contactscontact[]
Array of contact objects. If provided, these contacts will override all existing instance contacts. Order is not important. Not unique records will be skipped.

resume request »

resume request has req_cmd field equal to 'resume'. This request is sent when a worker instance is resumed from paused state. The request always has just one payload object with the following structure:
request payload:
fieldJSON type
req?
len
description
payload_idstring
64Unique ID of this payload object. Note that some response payload may reference this ID.
instanceinstance object
Current worker instance.
contactscontact[]
Array of contacts available for worker instance.
resourcesresource[]
Array of resources assigned to worker instance.
example:
show
As with all asynchronous requests, the REST response for this request acts as a container for zero or more payloads. The responding payload for this particular request can come in the immediate response to this request or in any subsequent responses for any other requests. Response payload object for this request should have the following structure:
response payload:
fieldJSON type
req?
len
description
resp_cmdstring
32
Supported value: resume
instance_idnumber
18Instance ID.
ref_payload_idstring
64ID of the resumé request payload object this response is responding to.
resultboolean
true if successfully resumed, false if not.
error_codenumber
5
Provided if result is false. Supported values are:
  • 100 - Undefined reason.
  • 200 - Legal or contractual reason.
  • 300 - System or technical reason.
contactscontact[]
Array of contact objects. If provided, these contacts will override all existing instance contacts. Order is not important. Not unique records will be skipped.

message request »

message request has req_cmd field equal to 'message'. This request is used to send one or more messages from the outside world to the worker instance. This request payload array contains one or more payload objects with the following structure:
request payload:
fieldJSON type
req?
len
description
payload_idstring
64Unique ID of this payload object. Note that some response payload may reference this ID.
instanceinstance object
Current worker instance.
contactscontact[]
Array of contacts available for worker instance.
resourcesresource[]
Array of resources assigned to worker instance.
resource_idnumber
ID of the resource that delivered this message.
messageobject
Structure of this object depends on channel_type property of the resource that delivered this message. ID of the resource that delivered this message is in resource_id field. All resources assigned to this worker instance are available in resources field.
example:
show
The following describes the request message object structure based on the channel_type value:
Slack message (channel_type is equal to 'slack')
fieldJSON type
req?
len
description
bodyobject
Slack 'message' event body. See more at Slack Events API body.
conversationobject
channel property from Slack 'conversations.info' method call result. See more at Slack Conversations Request.
conversation_usersobject[]
Array of user property objects from Slack 'users.info' method call results. See more at Slack Users Request.
filesfile[]
Files transferred with the message.
Email message (channel_type is equal to 'email')
fieldJSON type
req?
len
description
senderstring
320Sender email address.
tostring
320Comma separated list of recipient email addresses.
reply_tostring
320Comma separated list of reply-to email addresses.
subjstring
988Email subject
ccstring
320Comma separated list of CC email addresses.
bccstring
320Comma separated list of BCC email addresses.
htmlstring
1048576
HTML email content. Has higher priority than plain text content. Either text or html field should be set.
textstring
1048576
Plain text email content. Either text or html field should be set.
filesfile[]
Array of attached files. Order is not important. Records should be unique, duplicates will be skipped.
SMS message (channel_type is equal to 'SMS')
fieldJSON type
req?
len
description
senderstring
32Sender phone number.
receiverstring
32Receiver phone number.
textstring
160Plain text content of the SMS.
Rest message (channel_type is equal to 'REST')
fieldJSON type
req?
len
description
senderstring
64Sender of the message.
receiverstring
64Recipient of the message.
textstring
4096Message text.
Response payload array for message request accepts zero or more payload object with the following structure to be eventually sent back:
response payload:
fieldJSON type
req?
len
description
resp_cmdstring
32
Supported value: message
instance_idnumber
18Instance ID.
resource_idnumber
18ID of the resource that should be used to deliver the message in this payload.
ref_payload_idstring
64
Optional ID of the message request payload object this response is responding to. Note that new messages from worker instance may be unrelated to any previous request payloads, hence this field is optional. This is an essence of autonomous work capabilities when AI worker can communicate with the outside world spontaneously "on its own".
translate_langstring
2Optional language to translate the message to. Language should be specified as ISO 3166-2 code and be one of the supported by the worker.
tone_shiftingboolean
Default value is true. Message will be rewritten according on the overall social and communication preferences for this worker instance. Various social and communication properties are available via instance object. Note that all social and communication preferences in combination play a role in how message will be rewritten. Some of them have a short-term impact, some provide an effect during a long conversation only, and some, like gender, only affect the language grammar.
messageobject
Content depends on channel_type field value of the resource object specified in this payload. The resource is provided by its ID in resource_id field.
contactscontact[]
Array of contact objects. If provided, these contacts will override all existing instance contacts. Order is not important. Not unique records will be skipped.
The following describes the response message object structure based on the channel_type value:
Slack message (channel_type is equal to 'slack')
fieldJSON type
req?
len
description
channelstring
32Slack channel ID.
textstring
40000Slack message text.
thread_tsstring
16Slack thread timestamp field. It is used for thread replies.
filesfile[]
Array of attached files. Order is not important. Not unique records will be skipped.
Email message (channel_type is equal to 'email')
fieldJSON type
req?
len
description
senderstring
320Sender email address. It is configured resource email.
tostring
320Comma separated list of recipient email addresses.
reply_tostring
320Comma separated list of reply-to email addresses.
subjstring
988Subject of the email.
ccstring
320Comma separated list of CC email addresses.
bccstring
320Comma separated list of BCC email addresses.
htmlstring
1048576HTML email content. Either text or HTML content must be provided. HTML content has higher priority than plain text if both are provided.
textstring
1048576Plain text email content. Either text or HTML content must be provided.
filesfile[]
Array of attached files. Order is not important. Not unique records will be skipped.
SMS message (channel_type is equal to 'SMS')
fieldJSON type
req?
len
description
senderstring
32Sender phone number.
receiverstring
32Receiver phone number.
textstring
160Plain text SMS content.
Rest message (channel_type is equal to 'REST')
fieldJSON type
req?
len
description
senderstring
64Sender of the message.
receiverstring
64Recipient of the message.
textstring
4096Message text.

curation »

Human-in-the-Loop Curation (or simply "curation") is a mechanism where an AI worker delegates a task to a human operator when it is unable to process it independently or requires additional information, context, or assistance that only human operator can provide. This capability is often beneficial and, in some cases, essential for mission-critical systems in highly regulated industries, such as healthcare, pharmaceuticals, finance, transportation, military, or hazardous material handling.
In the Humatron platform, an AI worker can initiate a curation request at any time and for any reason. This can occur due to a variety of factors, for example:
  • A specific message request that requires additional confirmation.
  • The AI worker’s internal logic.
  • Additional manual steps required during organization reassignment or termination.
  • An external event such as a request from the external application.
  • Chain of Thought (CoT) processing timeouts.
Curation requests are always initiated only by the AI worker. Note that curation support is optional for a given build and can be enabled or disabled at any time by the build’s owner. If curation is disabled, all curation events for that build (i.e. its instances) will be ignored by the Humatron platform.
To start the curation request, you simply need to send the following payload object as part of payload array of the nearest response:
response payload:
fieldJSON type
req?
len
description
resp_cmdstring
32
Supported value: curation
payload_idstring
64ID of this payload object that will have to be referenced in the curation response.
instance_idnumber
Worker instance ID this curation is referred to.
ref_payload_idstring
64ID of the request payload object this curation is optionally referring to.
messagestring
1048576This allows you to provide textual information about the curation request using Markdown. Markdown enables you to add rich content such as formatted text, links and images, bullet points, etc.
contextobject
This is an optional JSON context that can be passed together with message field. It will be displayed as JSON on Humatron website's curation page.
When a curation request (i.e.the payload object above) is received by the Humatron, a new curation event will appear on the Humatron website, and all registered notification contacts for this build will be alerted. Registered Humatron users with curation privilege can then log in to the website to review and process the curation request.
For each curation request on the website, the message and context fields will be displayed along with other pertinent information. Note that Humatron does not require a response to the curation request - user can simply mark curation request as ignored on the website. If the response to curation request is provided, it is not required to be realtime. In fact, depending on the nature of curation request the response can take minutes or hours. If provided, the curation response consists of the JSON object that human operator needs to provide that will be sent back to the worker instance via REST channel.
The specific structure of the curation response JSON object is up to the worker implementation and is not governed by Humatron API. Note also that in order to receive this curation response, if any, the worker implementation must process messages from the REST channel.

common objects »

Requests and responses in Worker API use a set of common JSON objects:

organization object »

Organization object defines any organization or a company in Humatron. This can be a hiring company, a company that built and trained AI worker, a partner company that provides talent acquisition services and uses Humatron on behalf of its clients, as well as Humatron AI itself. Organization object has the following structure:
fieldJSON type
req?
len
description
idnumber
18Unique ID of this organization.
avatar_urlstring
2083URL for this organization's logo. The image will be scaled down as much as 32 pixels in height.
show_nameboolean
Whether or not this organization's name should be shown in the top-right corner of the header.
avatar_on_rightboolean
Whether or not this organization's logo is displayed in the top-right corner of the header.
namestring
64Name of this organization.
formal_namestring
64Formal or legal name of this organization.
industrystring
128Organization industry.
websitestring
64Website URL of this organization. It may optionally include the protocol part 'https://'.
is_rootboolean
Indicates if this organization is the root organization (i.e. Humatron AI).
addressaddress object
Address of this organization.
countrystring
64Country name of this organization as in ISO 3166.
country_iso_3166string
2ISO 3166-2 code of the country for this organization.
example:
show

specialist object »

Specialist object defines worker template in Humatron. It is also sometime called a resume or a build which are used interchangeably in this documentation. Specialist object has the following structure:
fieldJSON type
req?
len
description
idnumber
18Unique ID of this worker template.
planned_live_datestring
32Planned live date of the worker template. String is used only for display purpose, i.e. it does not have to be in a valid string format. E.g. 'Nov 2024'.
avatar_urlstring
2048
URL for the worker template\'s avatar. This would be the avatar shown for this worker as well as the default avatar for worker instance when hired.
statusstring
32
Status of this worker template. Supported values are:
statusdescription
init
Build is submitted. API endpoint is not provided yet and build is not available for testing o hiring through Humatron website or APIs.
dev
Build's API endpoint is provided and it is made available for testing through Humatron website and APIs. Build is not visible to public and not available for hire.
live
Build is available for hire either publicly or privately. Note that build's owner can switch between 'dev' and 'live' statuses to control visibility and status of this build.
paused
Build is temporarily paused by Humatron. Only Humatron can un-pause this build. In this status, the build is not available for hire or testing.
init_setup_dur_hoursnumber
4Initial technical setup duration in hours. This information is public.
init_setup_infostring
1024
General information about initial technical setup to be displayed on the resumé page. This may include additional information that will be gathered, technical information, technical contacts or any other information pertaining to the initial setup.
support_interview_modeboolean
Whether or not this worker supports interview mode.
auto_interviewboolean
If interview mode is supported, this flag indicates whether or not Humatron should provide auto-interview for this build. In auto-interview mode Humatron will use build's resumé as a LLM context to automatically provide RAG-based answers to interview questions without any communications with the build's implementation. Note that this implementation is technically limited by what information is provided in build settings and its external links.
interview_concurrent_sessionsnumber
If interview mode is supported, this is the maximum number of the concurrent interview session supported. This will be automatically enforced by Humatron.
interview_reqs_per_hournumber
If interview mode is supported, this is the maximum number of questions that can be asked per hour in a single interview session. This will be automatically enforced by Humatron.
interview_slastring
1024
Optional description of SLA during the non-auto interview. Should contain any restriction or limitation additionally to interview_reqs_per_hour and interview_concurrent_sessions settings.
rolestring
32Job title or a role of the worker, e.g. ' Sr. Software Engineer' or 'Social Content Manager'. When hired, this will be a default job title.
overviewstring
5120
Overview or introduction of the worker capabilities, skills and features. If the auto-interview mode is enabled, this is the main part that will be used as a RAG context for LLM answering questions about this build. Text or Markdown with GitHub extensions are supported. NOTE: embedded HTML is not supported.
share_summarystring
2048Short summary of the build used for sharing on social media.
skills_csvstring
2048Comma-separated list of this build main code skills. It is shown on resume page and used bu auto-interview function, if enabled.
deploy_descrstring
512Public information and necessary details about technical deployment of this build.
ai_stack_descrstring
512Public information and technical details of ML/AI/GenAI stack for this build.
country_iso_3166_csvstring
512Comma-separated list of ISO 3166 country codes for country locations supported by this build. During hiring, one of these locations will be selected.
lang_iso_639_csvstring
512Comma-separated list of ISO 639 language codes for languages supported by this worker. During hiring, one of the languages will be selected as a primary language.
is_human_curatedboolean
Whether or not this build supports human-in-the-loop curation.
builder_submit_personperson object
Person who originally submitted this build.
builder_support_personperson object
Official support person for this build. It will be used internally by Humatron only.
builder_orgorganization object
Organization responsible for this build.
builder_descr_urlstring
512
Optional URL for the external description or information about this build provided by the builder. If provided and auto-interview is enabled, this will be used as part of the RAG LLM context when answering interview questions.
support_descrstring
128Description of the support provided for this builds hired instances. This is a public information.
support_emailstring
64Public email that will be used as a support email for this build's hired instances.
is_privateboolean
Whether or not this build is private, i.e. available for hire only for the organization that built it. Non-private worker are available for hire to anyone.
api_endpointstring
512
Worker API endpoint for this build. Until this is set, the build will remain in 'init' status.
price_planPricePlan object
Price plan for this build.
channelsChannel[]
Specific channels for this specialist.
example:
show

instance object »

Instance object defines hired specialist. Instance object has the following structure:
fieldJSON type
req?
len
description
idnumber
18Unique ID of this instance.
specialistspecialist object
Worker template (i.e. resume) for this worker instance.
orgorganization object
Organization this worker instance was hired by.
statusstring
32
Status of this instance. Can be one of the following values:
statusdescription
init
Hiring application is submitted.
confirmed
Hiring has been confirmed by the AI worker provider. The onboarding will commence shortly.
preparing
Onboarding has started.
live
Onboarding is completed, AI worker is live.
paused
AI worker is paused. This instance will receive no communication until it is resumed. At this status the instance can either be terminated or resumed, in which case its status will be either terminated or live accordingly.
terminated
Instance has been terminated.
first_namestring
32First name or technical nickname.
last_namestring
32Optional last name.
avatar_urlstring
2083URL for this instance avatar.
genderstring
32
This instance gender. This is used to resolve language grammar only. Supported values are:
  • male
  • female
agestring
32
Assigned age group. This is used for communication style adjustment. Supported values are:
  • 20-30
  • 30-40
  • 40-50+
country_namestring
64Name of the country of residence as in ISO 3166.
country_iso_3166string
2Code of the country of residence as in ISO 3166-2.
citystring
32City of residence. Should align with country and working time zone.
tzstring
8Working time zone. Should align with country and city of residence.
primary_langstring
2Primary communication language.
comm_stylestring
32
Communication style of this instance. Supported values are:
  • informal+
  • informal
  • adaptive
  • formal
  • formal+
work_typestring
32
Work type assigned to this instance. Supported values are:
  • 24/7
  • 9-to-5
workplace_personastring
32
Workplace persona of this instance. Supported values are:
  • visionary
  • networker
  • builder
  • mentor
  • researcher
lang_modestring
32
Language mode of this instance. Supported values are:
  • adaptive
  • plain
brevity_stylestring
32
Brevity style of this instance. Supported values are:
  • concise
  • adaptive
  • verbose
job_titlestring
32Assigned job title.
job_descrstring
1024Job description.
teamstring
64Name of team, business unit or organization this instance is part of.
pay_typestring
32
Payment type. Supported values:
  • hourly
  • monthly
hired_by_personperson object
Person who hired this worker instance.
reporting_to_personperson object
Person to whom this worker instance reports.
contact_personperson object
Employer technical contact person for this worker instance
hire_tsstring
24Timestamp of the hiring application submission, formatted in ISO-8601.
start_datestring
24Start date timestamp, possible in the future, formatted in ISO-8601.
live_tsstring
24Timestamp of when this instance went live for the 1st time, formatted in ISO-8601.
termination_tsstring
24Termination timestamp, formatted in ISO-8601.
termination_reasonstring
1024Reason for termination.
example:
show

person object »

Person object defines user's personal data in Humatron. Person object has the following structure:
fieldJSON type
req?
len
description
first_namestring
32First name of the person.
last_namestring
32Last name of the person.
emailstring
64Email address of the person.
suspendedboolean
Indicates if the person is suspended. Person can be suspended by Humatron only. Suspended person cannot sign in.
org_idnumber
ID of the organization this person belongs to.
oauth_providerstring
256Name of the OAuth 2.0 provider from the last OAuth sing in.
avatar_data_uristring
2048
Optional URL or data-URI for this person avatar. This avatar can only be set on Humatron website's user profile page. Note that either this field, oauth_avatar_url or none can be provided for this person.
oauth_avatar_urlstring
1024User avatar URL from the last OAuth sing in.
primary_lang_iso_639string
2ISO 639-2 code for the primary communication language for this person.
is_email_confirmedboolean
Whether or not this person email is confirmed. Email must be confirmed before user can sign in at Humatron website.
phonestring
32Phone number of the person.
addressaddress object
Address of the person.
example:
show

role object »

Role object defines a security role that a Person has. Humatron supports the following security roles:
role namedescription
adminFull control & privileges.
billingManage billing.
hireHire AI workers.
buildBuild AI workers.
curateHandle curation.
workWork with AI workers.
Role object has the following structure:
fieldJSON type
req?
len
description
namestring
32Name of the role.
descrstring
64Description of the role.
example:
show

address object »

Address object defines address record that is used by Personand Organization objects. Address object has the following structure:
fieldJSON type
req?
len
description
streetstring
256Street address.
citystring
64City name.
region_namestring
64Name of the region.
region_abbrstring
64Optional abbreviation of the region.
postal_codestring
64Postal or ZIP code.
country_namestring
64Country name as in ISO 3166.
country_iso_3166string
2Country as ISO 3166 code.
example:
show

PricePlan object »

PricePlan object defines the pay plan for the worker. PricePlan object has the following structure:
fieldJSON type
req?
len
description
trial_period_daysnumber
4Number of days for the trial period. Can be zero.
trial_restrictionsstring
1024Restrictions during the trial period, if any.
service_levelstring
1024Description of the service level provided by this price plan. Could include response time, curation time, maximum number of request per hour, etc.
setup_fee_usdnumber
Setup fee in USD, if any. Can be zero.
hourly_fee_usdnumber
Hourly fee in USD. Cannot be zero.
monthly_fee_usdnumber
Monthly fee in USD. Cannot be zero.
example:
show

file object »

File object defines transferable file data. Humatron provides access to these files with certain provider-specific properties. Note that properties field's content is provider specific. File object has the following structure:
fieldJSON type
req?
len
description
typestring
32
File provider type. Currently supported value are:
  • AMAZON_S3
sizenumber
File size in bytes.
propertiesobject
File provider related properties.
example:
show

resource object »

Resource object defines communication resource (i.e. configured instance of the communication channel). Resource object has the following structure:
fieldJSON type
req?
len
description
idnumber
18Resource ID.
channel_typestring
32
Type of the communication channel this resource belongs to. Supported values are:
  • SMS
  • email
  • slack
  • REST
csv_tagsstring
1024Optional list of comma separated tags.
propertiesobject
Properties of the resource. Properties content depends on the channel_type field. Currently supported properties are:
channel_typefieldJSON type
req?
len
description
SMSphonestring
32Phone number.
emailemailstring
320Email address.
slackuser_idstring
32Slack user ID.
RESTserverstring
2083Server URL.
example:
show

ContactRecord object »

ContactRecord object defines a contact record. Note that properties field content is specific to kind of contact record.ContactRecord object has the following structure:
fieldJSON type
req?
len
description
kindstring
32
Supported values:
  • email
  • slack
  • phone
  • REST
tstampstring
24Timestamp of the record creation in UTC, formatted according to ISO-8601.
csv_tagsstring
1024Optional list of comma separated tags.
propertiesobject
Properties of the contact record. Properties content depends on the kind field.
example:
show

Contact object »

Contact object defines contact person with nested contact records. Contact object has the following structure:
fieldJSON type
req?
len
description
first_namestring
32First name of the contact.
last_namestring
32Last name of the contact.
full_namestring
65Full name of the contact.
recordsContactRecord[]
Array of contact records. Order is not significant. Records are unique, as duplicates are removed.
example:
show

Channel object »

Channel object defines specialist's channel. Channel object has the following structure:
fieldJSON type
req?
len
description
typestring
32
Channel type. Supported values:
  • email
  • slack
  • SMS
  • REST
descrstring
64Channel description.
provider_namestring
64Channel provider name.
capabilities_csvstring
2048Comma separated list of channel capabilities.
example:
show

REST channel API »

The REST channel is a special communication channel that enables REST interactions between a worker instance and the end user. Unlike other communication channels, such as email, Slack, or SMS, the REST channel does not come with an existing client application (e.g., an email or Slack client). REST communication channel allows a worker instance to communicate with a non-standard client-side applications such as custom chatbots, built-in copilots, etc. Note that the REST channel can be registered in the address book, which allows to use it just like any other resource in the Worker API.
Let's review the terminology nomenclature:
termdescription
REST channel serverThe Humatron-side REST server. Client application that wants to communicate with the worker via REST channel connects to this server and sends HTTP request to it.
REST channel APIREST based API which allows to communicate with the REST channel server.
Client applicationA custom application built using the REST channel API that communicates with the worker instance via REST channel API.

protocol »

Client application uses REST channel API to send and receive messages to and from worker instance. A worker instance sends and receives messages to and from client application through the standard message request of the Worker API (i.e. the same way as for any other communication channels like email or Slack). Below is an outline of the REST channel API protocol. Note that it is similar to the Worker API protocol structure.
  • To access the REST channel server, the client application uses the REST channel server endpoint and valid authentication tokens, which is provided in request header for authorization as Bearer request token.
  • Communication is always initiated by the client application.
  • The client application sends each request by making an HTTP POST to the designated REST channel server endpoint.
  • Each request’s POST body contains common fields as well as a variable set of fields specific to each request type.
  • Each HTTP 200 response contains zero or more response payloads being sent back to the client application.
Note also that REST channel API has the same logically asynchronous nature as Worker API.

requests structure »

In REST channel API both HTTP request and response act as simple containers for array of payloads which is a central idea in both Worker API and REST channel API design. The actual data exchange between REST server and client application is done through passing payloads objects.
Each request sent from client application to Humatron should conform to the following JSON structure:
fieldJSON type
req?
len
description
req_idstring
64Globally unique ID for the request.
req_cmdstring
32
Type of the request. One of the following values:
req_tstampstring
24Timestamp of the request in UTC, formatted according to ISO-8601.
payloadobject[]
Array of payload elements. Generally, a request can have zero or more payload elements. Particular set of payload elements depends on the req_cmd value.
example:
show
Each response should conform to the following JSON structure:
fieldJSON type
req?
len
description
resp_idstring
64The field should be globally unique ID for the response.
resp_tstampstring
24Timestamp of the response in UTC, formatted according to ISO-8601.
payloadobject[]
Array of payload elements. Generally, array can contain zero or more elements. It is idiomatic when using REST channel API to have all the requests processed asynchronously. In this approach, particular response's array of payloads can contain payloads for the immediate request, any number of previous requests or the payloads that are not related to any specific requests from the past.
example:
show

requests types »

All REST channel API requests follow the general structure outline in requests structure section. Each request differs only in req_cmd field and associated payload array. All requests are asynchronous. Here is the list of supported requests:
requestdescription
messageThis request is sent to the REST channel server endpoint when one or more new messages are available for the worker instance.
heartbeatIn addition to message requests, the client application can send regular heartbeat requests to the REST channel server. These heartbeat requests do not contain any significant data; their primary purpose is to prompt the server to respond to previous message requests from the worker instance that may have accumulated on the REST channel server.

message request »

REST channel API message request has req_cmd field equal to 'message'. This request is used to send one or more messages from the client application to the worker instance via REST channel server. This request payload array contains one or more payload objects with the following structure:
request payload:
fieldJSON type
req?
len
description
payload_idstring
64Unique ID of this payload object. Note that some response payload may reference this ID.
receiverstring
64Recipient of the message.
senderstring
64Sender of the message.
textstring
4096Message text.
The response payload array contains empty or non-empty payload object array with the following structure of elements:
response payload:
fieldJSON type
req?
len
description
ref_payload_idstring
64
Optional ID of the message request payload object this response is responding to. Note that new messages may be unrelated to any previous request payloads, hence this field is optional. This is an essence of autonomous work capabilities when a worker instance can communicate with the outside world spontaneously "on its own".
receiverstring
64Recipient of the message.
senderstring
64Sender of the message.
textstring
4096Message text.

heartbeat request »

REST channel API heartbeat request has req_cmd field equal to 'heartbeat'. These requests primary purpose is to prompt the server to respond to previousmessage requests from AI workers that have accumulated on the REST channel server.
heartbeat request has empty payload.
The response payload array contains empty or non-empty payload object array with the following structure of elements.
response payload:
fieldJSON type
req?
len
description
ref_payload_idstring
64
Optional ID of the message request payload object this response is responding to. Note that new messages may be unrelated to any previous request payloads, hence this field is optional. This is an essence of autonomous work capabilities when a worker instance can communicate with the outside world spontaneously "on its own".
receiverstring
64Recipient of the message.
senderstring
64Sender of the message.
textstring
4096Message text.
Note, that this response payload structure is same for both message and heartbeat responses types.