Replace a case attachment
- Base URL
-
https://{kibana_url}
- PUT /api/cases/{caseId}/attachments/{attachmentId}
- PUT /s/{space_id}/api/cases/{caseId}/attachments/{attachmentId}
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
-
space_idstringoptional -
An identifier for the space. If
space_idis not provided in the URL, the default space is used. Refer to Spaces for more information.
Request body
-
attachmentIdunion oneOfrequired -
The ID of the attached item, such as an alert or a dashboard. To attach several alerts, use an array. This isn't the attachment's own ID (
id). -
One of:
string[]orstring -
dataobjectnullable -
The attachment's content. Required for comments, where
contentis the comment text (up to 30,000 characters). In requests, it can be up to 524,288 characters when serialized as JSON and nest up to 30 levels deep. -
metadataobjectnullable -
Extra details about the attachment. For alerts, this is the alert's index and rule. Required for some types, such as
dashboard. In requests, it can be up to 524,288 characters when serialized as JSON and nest up to 30 levels deep. -
ownerenumrequired -
The application that owns the cases: Stack Management, Observability, or Elastic Security.
-
Values:
casesobservabilitysecuritySolution -
typestringrequired -
The attachment type, such as
comment,security.alert,observability.alert,stack.alert,security.event,lens,dashboard, orfile.security.*types only work on Security cases,observability.*on Observability cases, andstack.*on Stack Management cases. Usecomment(not the legacyusertype) and a*.alerttype (notalert). You can't add or replace file attachments with this API. To add a file, usePOST /api/cases/{caseId}/files.
-
dataobjectrequired nullable -
The attachment's content. Required for comments, where
contentis the comment text (up to 30,000 characters). In requests, it can be up to 524,288 characters when serialized as JSON and nest up to 30 levels deep. -
metadataobjectnullable -
Extra details about the attachment. For alerts, this is the alert's index and rule. Required for some types, such as
dashboard. In requests, it can be up to 524,288 characters when serialized as JSON and nest up to 30 levels deep. -
ownerenumrequired -
The application that owns the cases: Stack Management, Observability, or Elastic Security.
-
Values:
casesobservabilitysecuritySolution -
typestringrequired -
The attachment type, such as
comment,security.alert,observability.alert,stack.alert,security.event,lens,dashboard, orfile.security.*types only work on Security cases,observability.*on Observability cases, andstack.*on Stack Management cases. Usecomment(not the legacyusertype) and a*.alerttype (notalert). You can't add or replace file attachments with this API. To add a file, usePOST /api/cases/{caseId}/files.
Responses
Indicates a successful call. Returns the replaced attachment.
-
attachmentIdunion oneOf -
The ID of the attached item, such as an alert or a dashboard. To attach several alerts, use an array. This isn't the attachment's own ID (
id). -
One of:
string[]orstring -
dataobjectnullable -
The attachment's content. Required for comments, where
contentis the comment text (up to 30,000 characters). In requests, it can be up to 524,288 characters when serialized as JSON and nest up to 30 levels deep. -
metadataobjectnullable -
Extra details about the attachment. For alerts, this is the alert's index and rule. Required for some types, such as
dashboard. In requests, it can be up to 524,288 characters when serialized as JSON and nest up to 30 levels deep. -
ownerenumrequired -
The application that owns the cases: Stack Management, Observability, or Elastic Security.
-
Values:
casesobservabilitysecuritySolution -
pushed_atstring · format: date-timerequired nullable -
When this attachment was last pushed to an external system, such as Jira. Is
nullif it hasn't been pushed. -
typestringrequired -
The attachment type, such as
comment,security.alert,observability.alert,stack.alert,security.event,lens,dashboard, orfile.security.*types only work on Security cases,observability.*on Observability cases, andstack.*on Stack Management cases. Usecomment(not the legacyusertype) and a*.alerttype (notalert). You can't add or replace file attachments with this API. To add a file, usePOST /api/cases/{caseId}/files.
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.