Keystone Developers
Open Keystone
API reference

Internal API

Assistant internal

11 endpoints.

GET/api/v1/internal/agent-models

The agents' models, what each sends and how it is rated, and the defaults (internal)

Authentication

X-Internal-Api-Key header.

Parameters

NameInTypeDescription
business_idquerystring (uuid) | null

Responses

200Successful Response
application/jsonSuccessResponse_AgentModelsInternalData_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredAgentModelsInternalData
AgentModelsInternalData fields
FieldTypeDescription
modelsrequiredAgentModelInternal[]
AgentModelInternal[] fields

AgentModelInternal (not expanded)

default_model_idrequiredstring
agentsobjectdefault {}
object fields

Map of string to string

agent_only_modelsAgentModelInternal[]default []
AgentModelInternal[] fields

AgentModelInternal (not expanded)

metadataResponseMetadata | null
ResponseMetadata fields
FieldTypeDescription
paginationPaginationMetadata | null
PaginationMetadata fields
FieldTypeDescription
limitrequiredinteger
next_cursorstring | null
prev_cursorstring | null
has_morerequiredboolean
has_prevbooleandefault false
total_countinteger | null
status_countsobject | null
object | null fields

Map of string to integer

lifecycle_countsLifecycleCounts | null
LifecycleCounts fields
FieldTypeDescription
allintegerdefault 0
leadintegerdefault 0
prospectintegerdefault 0
customerintegerdefault 0
former_customerintegerdefault 0
classification_countsClassificationCounts | null
ClassificationCounts fields
FieldTypeDescription
signalobject
object fields

Nested object (not expanded)

touchobject
object fields

Nested object (not expanded)

stageobject
object fields

Nested object (not expanded)

metaResponseMeta | null
ResponseMeta fields
FieldTypeDescription
totalinteger | null
total_countinteger | null
pageinteger | null
per_pageinteger | null
  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

POST/api/v1/internal/assistant/attachments

A message's photos and documents, as the model is shown them (internal)

Every file must be the business's own (422 otherwise, as the editor's send is). A photo is shown by its public URL; a video by the public address it plays at (the model reads no video: it places one by that address); a document by its words (the same decoding the website's documents get).

Authentication

X-Internal-Api-Key header.

Request bodyrequired

application/jsonAssistantAttachmentsBody
FieldTypeDescription
business_idrequiredstring (uuid)
attachmentsrequiredAssistantAttachmentRef[]min items 1 · max items 10
AssistantAttachmentRef[] fields
FieldTypeDescription
kindrequiredenumone of "photo", "document", "video"
idrequiredstringmin length 1 · max length 64

Responses

200Successful Response
application/jsonSuccessResponse_AssistantAttachmentsData_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredAssistantAttachmentsData
AssistantAttachmentsData fields
FieldTypeDescription
filesrequiredAssistantAttachment[]
AssistantAttachment[] fields

AssistantAttachment (not expanded)

metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

GET/api/v1/internal/assistant/attachments/content

One file's bytes, for the assistant's sandbox (internal)

The file as the business has it: a photo's bytes from the library, a document as it was put in (one a site change attached reads even once removed from Files); 404 for another business's.

Authentication

X-Internal-Api-Key header.

Parameters

NameInTypeDescription
business_idrequiredquerystring (uuid)
kindrequiredqueryenum
idrequiredquerystring

Responses

200Successful Response
  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

POST/api/v1/internal/assistant/attachments/standing

How each of a message's files stands for the business, file by file (internal)

Every file asked about answers on its own, in order: whether it is the business's and where, and why a message may not carry it (``unavailable``). A gone file does not refuse the others; only a request naming a file no attachment could be is 422. Reads no file's contents.

Authentication

X-Internal-Api-Key header.

Request bodyrequired

application/jsonAssistantAttachmentsBody

AssistantAttachmentsBody, expanded above.

Responses

200Successful Response
application/jsonSuccessResponse_AssistantAttachmentStandingData_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredAssistantAttachmentStandingData
AssistantAttachmentStandingData fields
FieldTypeDescription
filesrequiredAssistantAttachmentStanding[]
AssistantAttachmentStanding[] fields

AssistantAttachmentStanding (not expanded)

metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

GET/api/v1/internal/assistant/businesses/{business_id}/people/{user_id}

A business as sor knows it, and one person's membership and role on it (internal)

Always 200: ``found`` false for a business sor doesn't know, never a 404.

Authentication

X-Internal-Api-Key header.

Parameters

NameInTypeDescription
business_idrequiredpathstring (uuid)
user_idrequiredpathstring (uuid)

Responses

200Successful Response
application/jsonSuccessResponse_AssistantBusinessPersonData_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredAssistantBusinessPersonData
AssistantBusinessPersonData fields
FieldTypeDescription
foundrequiredboolean
memberbooleandefault false
business_role_idinteger | null
namestring | null
timezonestring | null
guestbooleandefault false
metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

POST/api/v1/internal/assistant/calls

Bind a live call to its business, with what it starts from (internal)

Authentication

X-Internal-Api-Key header.

Request bodyrequired

application/jsonAssistantCallBody
FieldTypeDescription
call_idrequiredstringmin length 1 · max length 128
from_numberstring | null
to_numberrequiredstringmin length 1 · max length 32

Responses

200Successful Response
application/jsonSuccessResponse_AssistantCallData_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredAssistantCallData
AssistantCallData fields
FieldTypeDescription
business_idrequiredstring (uuid)
contextrequiredobject
metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

POST/api/v1/internal/assistant/files

A file the assistant made, kept as the business's (internal)

A picture goes into the photo library (checked and re-encoded as an upload is); anything else into Library › Files (converted as an attached document is, so the agents can read it later), downloaded through the admin API. A file SOR cannot keep answers as an upload would (413, 415, 422).

Authentication

X-Internal-Api-Key header.

Request bodyrequired

multipart/form-dataBody_internal_save_file_api_v1_internal_assistant_files_post
FieldTypeDescription
business_idrequiredstring (uuid)
filerequiredstring

Responses

201Successful Response
application/jsonSuccessResponse_AssistantSavedFile_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredAssistantSavedFile
AssistantSavedFile fields
FieldTypeDescription
kindrequiredenumone of "photo", "document"
idrequiredstring
namerequiredstring
urlstring | null
thumbnail_urlstring | null
sizeinteger | null
content_typestring | null
metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

DELETE/api/v1/internal/assistant/files

A file the assistant made and then made again: the earlier copy goes (internal)

The earlier draft leaves as the owner's Remove would take it: a photo a record took up meanwhile stays (409 PHOTO_IN_USE); one already gone is 404.

Authentication

X-Internal-Api-Key header.

Parameters

NameInTypeDescription
business_idrequiredquerystring (uuid)
kindrequiredqueryenum
idrequiredquerystring

Responses

204Successful Response
  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

POST/api/v1/internal/assistant/mention-emails

Email the people an Ask Keystone reply mentioned (internal)

Sent by the rules every notification keeps (``services/notifications``): only the business's own people, each person's settings, the daily cap, and once per thread and reply.

Authentication

X-Internal-Api-Key header.

Request bodyrequired

application/jsonAssistantMentionEmailsBody
FieldTypeDescription
business_idrequiredstring (uuid)
thread_idrequiredstringmin length 1 · max length 200
member_idsrequiredstring (uuid)[]min items 1 · max items 20
string (uuid)[] fields
asked_bystringdefault "" · max length 120
thread_titlestringdefault "" · max length 120
excerptstringdefault "" · max length 600

Responses

200Successful Response
application/jsonSuccessResponse_AssistantMentionEmailsData_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredAssistantMentionEmailsData
AssistantMentionEmailsData fields
FieldTypeDescription
sentrequiredstring[]
string[] fields
skippedrequiredobject[]
object[] fields

Nested object (not expanded)

metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

GET/api/v1/internal/assistant/site-screenshots/{shot_id}

A screenshot a site workspace tool took, for the assistant's model (internal)

The JPEG ``site_check`` or ``site_look`` named by id; 404 once it expired (an hour) or for another business's.

Authentication

X-Internal-Api-Key header.

Parameters

NameInTypeDescription
shot_idrequiredpathstring
business_idrequiredquerystring (uuid)

Responses

200Successful Response
  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

POST/api/v1/internal/assistant/site-screenshots/{shot_id}/keep

A site screenshot the chat's questions show stays while they may be read (internal)

The screenshot stays a week from now, and the console may load it for the business (``GET /admin/businesses/{business_id}/website/screenshots/{shot_id}``); 404 once it expired or for another business's.

Authentication

X-Internal-Api-Key header.

Parameters

NameInTypeDescription
shot_idrequiredpathstring
business_idrequiredquerystring (uuid)

Responses

204Successful Response
  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.