Spaces method and path for this operation:
Refer to Spaces for more information.
Fully replaces an attachment. You cannot change the attachment type or owner. You must have all privileges for the Cases feature in the Management, Observability, or Security section of the Kibana feature privileges, depending on the owner of the case.
Path parameters
-
The identifier for the case. To retrieve case IDs, use the search cases (
_find)API. All non-ASCII characters must be URL encoded. -
The ID of the attachment, which is its
idfield, notattachmentId. To get it, use the find case attachments API.Maximum length is
512.
Responses
-
Indicates a successful call. Returns the replaced attachment.
-
The request failed for one of these reasons:
- The request body is invalid.
- The attachment type is
file. - The request changes the attachment type or owner.
-
Authorization information is missing or invalid.
-
You don't have the required privileges for this case.
-
The attachment was not found in the case.
-
The attachment changed since you read it. Get the latest version and retry.
curl \
--request PUT 'https://localhost:5601/api/cases/9c235210-6834-11ea-a78c-6ffb38a34414/attachments/71ec1870-725b-11ea-a0b2-c51ea50a58e2' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: string" \
--data '{
"data": {
"content": "An updated comment."
},
"owner": "cases",
"type": "comment",
"version": "WzIzLDFd"
}'
{
"data": {
"content": "An updated comment."
},
"owner": "cases",
"type": "comment",
"version": "WzIzLDFd"
}
{
"created_at": "2026-09-30T19:32:13.104Z",
"created_by": {
"email": null,
"full_name": null,
"profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0",
"username": "elastic"
},
"data": {
"content": "An updated comment."
},
"id": "8048b460-fe2b-11ec-b15d-779a7c8bbcc3",
"owner": "cases",
"pushed_at": null,
"pushed_by": null,
"type": "comment",
"updated_at": "2026-10-01T08:45:21.512Z",
"updated_by": {
"email": null,
"full_name": null,
"profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0",
"username": "elastic"
},
"version": "WzI0LDFd"
}
{
"error": "Bad Request",
"message": "Invalid attachment payload for type 'comment': data.content: Comment content must be a non-empty string",
"statusCode": 400
}
{
"error": "Unauthorized",
"message": "Unable to authenticate with the provided credentials.",
"statusCode": 401
}
{
"error": "Forbidden",
"message": "Unauthorized to access cases",
"statusCode": 403
}
{
"error": "Not Found",
"message": "Saved object [cases-template/9da1ea2a-09f8-4d0e-bf9d-09bf8c9d0f42] not found",
"statusCode": 404
}
{
"error": "Conflict",
"message": "This attachment has been updated. Please refresh before saving additional updates.",
"statusCode": 409
}