CreateEvent
Creates an event in a memory store. Events represent interactions or activities that occur within a session and are associated with specific actors.
To use this operation, you must have the CreateEvent
permission.
This operation is subject to request rate limiting.
Request Syntax
POST /memories/memoryId
/events HTTP/1.1
Content-type: application/json
{
"actorId": "string
",
"branch": {
"name": "string
",
"rootEventId": "string
"
},
"clientToken": "string
",
"eventTimestamp": number
,
"payload": [
{ ... }
],
"sessionId": "string
"
}
URI Request Parameters
The request uses the following URI parameters.
- memoryId
-
The identifier of the memory store in which to create the event.
Length Constraints: Minimum length of 12.
Pattern:
[a-zA-Z][a-zA-Z0-9-_]{0,99}-[a-zA-Z0-9]{10}
Required: Yes
Request Body
The request accepts the following data in JSON format.
- actorId
-
The identifier of the actor associated with this event. An actor represents an entity that participates in sessions and generates events.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 255.
Pattern:
[a-zA-Z0-9][a-zA-Z0-9-_/]*
Required: Yes
- branch
-
The branch information for this event. Branches allow for organizing events into different conversation threads or paths.
Type: Branch object
Required: No
- clientToken
-
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, AgentCore ignores the request, but does not return an error.
Type: String
Required: No
- eventTimestamp
-
The timestamp when the event occurred. If not specified, the current time is used.
Type: Timestamp
Required: Yes
- payload
-
The content payload of the event. This can include conversational data or binary content.
Type: Array of PayloadType objects
Array Members: Minimum number of 0 items. Maximum number of 100 items.
Required: Yes
- sessionId
-
The identifier of the session in which this event occurs. A session represents a sequence of related events.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 100.
Pattern:
[a-zA-Z0-9][a-zA-Z0-9-_]*
Required: No
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"event": {
"actorId": "string",
"branch": {
"name": "string",
"rootEventId": "string"
},
"eventId": "string",
"eventTimestamp": number,
"memoryId": "string",
"payload": [
{ ... }
],
"sessionId": "string"
}
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedException
-
The exception that occurs when you do not have sufficient permissions to perform an action. Verify that your IAM policy includes the necessary permissions for the operation you are trying to perform.
HTTP Status Code: 403
- InvalidInputException
-
The input fails to satisfy the constraints specified by AgentCore. Check your input values and try again.
HTTP Status Code: 400
- ResourceNotFoundException
-
The exception that occurs when the specified resource does not exist. This can happen when using an invalid identifier or when trying to access a resource that has been deleted.
HTTP Status Code: 404
- ServiceException
-
The service encountered an internal error. Try your request again later.
HTTP Status Code: 500
- ServiceQuotaExceededException
-
The exception that occurs when the request would cause a service quota to be exceeded. Review your service quotas and either reduce your request rate or request a quota increase.
HTTP Status Code: 402
- ThrottledException
-
The request was denied due to request throttling. Reduce the frequency of requests and try again.
HTTP Status Code: 429
- ValidationException
-
The exception that occurs when the input fails to satisfy the constraints specified by the service. Check the error message for details about which input parameter is invalid and correct your request.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: