Create a case attachment
- Base URL
-
https://{kibana_url}
- POST /api/cases/{caseId}/attachments
- POST /s/{space_id}/api/cases/{caseId}/attachments
Adds a single attachment, such as a comment or an alert, to a case. 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. NOTE: Each case can have a maximum of 1,000 alerts.
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 new attachment. If some of the alert or event IDs are already attached to the case, they are skipped and the new attachment holds only the remaining IDs.
-
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 isn't registered, or is
file. - The owner doesn't match the case owner.
- A case limit was exceeded.
Authorization information is missing or invalid.
You don't have the required privileges for this case.