Spaces method and path for this operation:
Refer to Spaces for more information.
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
-
The identifier for the case. To retrieve case IDs, use the search cases (
_find)API. All non-ASCII characters must be URL encoded.
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.
-
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.
-
The case was not found.
-
Every alert or event ID in the request is already attached to the case.
curl \
--request POST 'https://<KIBANA_URL>/api/cases/9c235210-6834-11ea-a78c-6ffb38a34414/attachments' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: string" \
--data '{
"attachmentId": "6b24c4dc44bc720cfc92797f3d61fff952f2b2627db1fb4f8cc49f4530c4ff42",
"metadata": {
"index": ".internal.alerts-security.alerts-default-000001",
"rule": {
"id": "94309390-b76c-11ee-b4d6-39d8a0fcbc1b",
"name": "Endpoint Security"
}
},
"owner": "securitySolution",
"type": "security.alert"
}'
{
"attachmentId": "6b24c4dc44bc720cfc92797f3d61fff952f2b2627db1fb4f8cc49f4530c4ff42",
"metadata": {
"index": ".internal.alerts-security.alerts-default-000001",
"rule": {
"id": "94309390-b76c-11ee-b4d6-39d8a0fcbc1b",
"name": "Endpoint Security"
}
},
"owner": "securitySolution",
"type": "security.alert"
}
{
"data": {
"content": "A new comment."
},
"owner": "cases",
"type": "comment"
}
{
"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": "A new comment."
},
"id": "8048b460-fe2b-11ec-b15d-779a7c8bbcc3",
"owner": "cases",
"pushed_at": null,
"pushed_by": null,
"type": "comment",
"updated_at": null,
"updated_by": null,
"version": "WzIzLDFd"
}
{
"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": "Every id in the request is already attached to case 293f1bfe-c4ab-4a0b-9a36-9fd4a1d7d2b1.",
"statusCode": 409
}