Class MemoryUpdateParams
-
- All Implemented Interfaces:
-
com.anthropic.core.Params
public final class MemoryUpdateParams implements Params
Update a Memory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classMemoryUpdateParams.BuilderA builder for MemoryUpdateParams.
public final classMemoryUpdateParams.BodyThe request body for Update a Memory. Set
content,path, or both.Changing
pathrenames the memory and never replaces another one. The request fails with HTTP status 409 if another memory uses the new path, or if the new path is an ancestor or descendant of another memory's path. Delete or rename the other memory first. The request also fails if the memory store is archived.If every field you set already matches the memory, nothing changes. The response is the current memory, which doesn't get a new version.
See the memory guide to learn more about updating memories.
-
Method Summary
Modifier and Type Method Description final StringmemoryStoreId()The ID of the memory store that holds the memory ( memstore_...).final Optional<String>memoryId()The ID of the memory to update ( mem_...).final Optional<BetaManagedAgentsMemoryView>view()Whether a memoryormemory_versionin the response includes itscontent.final Optional<List<AnthropicBeta>>betas()This endpoint is in beta: requests must send agent-memory-2026-07-22ormanaged-agents-2026-04-01in this header.final Optional<String>workspaceId()Optional header to select the Workspace for this request. final Optional<String>content()New UTF-8 text content for the memory. final Optional<String>path()The new path of the memory, which renames it. final Optional<BetaManagedAgentsPrecondition>precondition()The condition that the memory must meet for the update to apply. final JsonField<String>_content()Returns the raw JSON value of content. final JsonField<String>_path()Returns the raw JSON value of path. final JsonField<BetaManagedAgentsPrecondition>_precondition()Returns the raw JSON value of precondition. final Map<String, JsonValue>_additionalBodyProperties()final Headers_additionalHeaders()Additional headers to send with the request. final QueryParams_additionalQueryParams()Additional query param to send with the request. final MemoryUpdateParams.BuildertoBuilder()final MemoryUpdateParams.Body_body()final String_pathParam(Integer index)Headers_headers()The full set of headers in the parameters, including both fixed and additional headers. QueryParams_queryParams()The full set of query params in the parameters, including both fixed and additional query params. SpanData_spanData()The data for the OpenTelemetry span of a call to the method with these parameters. Booleanequals(Object other)IntegerhashCode()StringtoString()final static MemoryUpdateParams.Builderbuilder()Returns a mutable builder for constructing an instance of MemoryUpdateParams. -
-
Method Detail
-
memoryStoreId
final String memoryStoreId()
The ID of the memory store that holds the memory (
memstore_...).
-
view
final Optional<BetaManagedAgentsMemoryView> view()
Whether a
memoryormemory_versionin the response includes itscontent. Defaults tofullon retrieve operations and tobasicon list, create, and update operations.With
full, list operations return at most 20 items per page.
-
betas
final Optional<List<AnthropicBeta>> betas()
This endpoint is in beta: requests must send
agent-memory-2026-07-22ormanaged-agents-2026-04-01in this header.
-
workspaceId
final Optional<String> workspaceId()
Optional header to select the Workspace for this request. The value is a Workspace ID (for example,
wrkspc_011CZkZaBF1tNoB5wlCeusgy).Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.
-
content
final Optional<String> content()
New UTF-8 text content for the memory. Maximum 100 kB (102,400 bytes). Omit to leave the content unchanged (e.g., for a rename-only update).
-
path
final Optional<String> path()
The new path of the memory, which renames it. Omit it to keep the current path.
The memory keeps its
id. A path starts with/and has 1 to 20 segments. A segment can't be empty and can't be.or... A path can't contain control characters, format characters, or the line and paragraph separators U+2028 and U+2029. It must be in Unicode Normalization Form C and at most 1,024 bytes long. Paths are case-sensitive.
-
precondition
final Optional<BetaManagedAgentsPrecondition> precondition()
The condition that the memory must meet for the update to apply. Omit it to update unconditionally.
If the condition fails, the request fails with HTTP status 409.
-
_content
final JsonField<String> _content()
Returns the raw JSON value of content.
Unlike content, this method doesn't throw if the JSON field has an unexpected type.
-
_path
final JsonField<String> _path()
Returns the raw JSON value of path.
Unlike path, this method doesn't throw if the JSON field has an unexpected type.
-
_precondition
final JsonField<BetaManagedAgentsPrecondition> _precondition()
Returns the raw JSON value of precondition.
Unlike precondition, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalBodyProperties
final Map<String, JsonValue> _additionalBodyProperties()
-
_additionalHeaders
final Headers _additionalHeaders()
Additional headers to send with the request.
-
_additionalQueryParams
final QueryParams _additionalQueryParams()
Additional query param to send with the request.
-
toBuilder
final MemoryUpdateParams.Builder toBuilder()
-
_body
final MemoryUpdateParams.Body _body()
-
_pathParam
final String _pathParam(Integer index)
-
_headers
Headers _headers()
The full set of headers in the parameters, including both fixed and additional headers.
-
_queryParams
QueryParams _queryParams()
The full set of query params in the parameters, including both fixed and additional query params.
-
_spanData
SpanData _spanData()
The data for the OpenTelemetry span of a call to the method with these parameters.
-
builder
final static MemoryUpdateParams.Builder builder()
Returns a mutable builder for constructing an instance of MemoryUpdateParams.
The following fields are required:
.memoryStoreId()
-
-
-
-