π€User Data API setup
How to set up your AI agent to use user data ingested via API to improve its responses.
Overview
This API, provided by your company, allows us to retrieve user information based on a provided identifier. The endpoint will accept a POST request and will return relevant user data.
How to set up your User Data API
Login to your Dashboard and go to Knowledge > Content
Scroll to Connect live user data and click the button that says + New Connection
Enter your API endpoint URL, Authorization Header (required) and Authorization Header Key (Required)
Enter a test user email address that will return a response when your Endpoint is called and click Test User Data API, you should then see your example response appear below. You can retest this response until you are satisfied with the test data returned.
Once you are happy with the User Data API response you can click the toggle to Activate live user data. From this point on, when a user contacts you, if they have a validated email address, we send a request for user data to your API and then your AI agent will use this data in its responses.
Detailed API Specification
Endpoint
Example URL:
https://api.client.com/user-dataMethod:
POST
Headers
Authorization (required): The request must include an
Authorizationheader with an API key provided to My AskAI.Content-Type (required): The request should accept only:
application/jsonNo other headers are required.
Request Body
The request will come from My AskAI with every new support ticket or support conversation.
The request body will be in JSON format and will include only the following field:
identifier: (String) The unique email of the user whose data is being requested. This must be available to My AskAI from an authenticated or valid source e.g. extracted from a Zendesk ticket or authenticated Intercom conversation
Response
If responses from the User Data API exceed 1,500 characters, each response will be charged as a tool (at $0.02 per message).
The API must respond with a JSON object containing the requested user information:
user_info: (String) Information related to the user.Tip: Provide all relevant info that might be needed to support a request or question about their account. Try to avoid providing unnecessary information. Provide information in a concise format.
identifier: (String) The same identifier provided in the request.Here is an example of detailed "user_info" (unstringified) with hierarchical information:
Performance Requirements
The API must respond within 10 seconds.
The API must be capable of responding for each new support conversation or ticket.
Error Handling
401 Unauthorized: If the
Authorizationheader is missing or invalid.400 Bad Request: If the request body does not contain the required
identifierfield or is improperly formatted.404 Not Found: If the user data is not found from the identifier
500 Internal Server Error: For any other unexpected errors.
If the API fails, the AI agent will continue support the user, but without any additional user data
Standards & Conventions
All requests must be in JSON format
All responses are in JSON format
Last updated
