View a markdown version of this page

IngestData - Amazon Bedrock AgentCore Data Plane

IngestData

Submits content directly for ingestion to generate long-term memory records in a AgentCore Memory resource.

To use this operation, you must have the bedrock-agentcore:IngestData permission.

Request Syntax

POST /memories/memoryId/ingest HTTP/1.1 Content-type: application/json { "actorId": "string", "clientToken": "string", "contentTimestamp": number, "extractionConfig": { "namespaceVariables": { "string" : "string" } }, "metadata": { "string" : { ... } }, "sessionId": "string", "source": { ... } }

URI Request Parameters

The request uses the following URI parameters.

memoryId

The identifier of the AgentCore Memory resource to ingest content into.

Length Constraints: Minimum length of 12.

Pattern: (arn:(aws|aws-cn|aws-us-gov):bedrock-agentcore:[a-z0-9-]+:[0-9]{12}:memory/)?[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 content. An actor represents an entity that participates in sessions and generates content.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 255.

Pattern: [a-zA-Z0-9][a-zA-Z0-9-_/]*(?::[a-zA-Z0-9-_/]+)*[a-zA-Z0-9-_/]*

Required: Yes

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

contentTimestamp

The timestamp of when the content occurred.

Type: Timestamp

Required: Yes

extractionConfig

The extraction configuration for long-term memory records. Use this parameter to specify namespace variable keys and their values for namespace substitution during extraction.

Type: ExtractionConfig object

Required: No

metadata

The key-value metadata to attach to the content.

Type: String to MetadataValue object map

Map Entries: Minimum number of 0 items. Maximum number of 15 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Key Pattern: [a-zA-Z0-9\s._:/=+@-]*

Required: No

sessionId

The identifier of the session that the content belongs to. If not provided, a session identifier is generated and returned in the response.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Pattern: [a-zA-Z0-9][a-zA-Z0-9-_]*

Required: No

source

The content to ingest. Only inline content is supported.

Type: ContentSource object

Note: This object is a Union. Only one member of this object can be specified or returned.

Required: Yes

Response Syntax

HTTP/1.1 202 Content-type: application/json { "sessionId": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 202 response.

The following data is returned in JSON format by the service.

sessionId

The identifier of the session that the service ingested the content into. This value echoes the session identifier from the request, or the identifier that the service generated when you did not provide one.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Pattern: [a-zA-Z0-9][a-zA-Z0-9-_]*

Errors

For information about the errors that are common to all actions, see Common Error Types.

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

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: