diff --git a/docs/Contributing/API-for-contributors.md b/docs/Contributing/API-for-contributors.md index cb8a4e8bf7..c26b57428e 100644 --- a/docs/Contributing/API-for-contributors.md +++ b/docs/Contributing/API-for-contributors.md @@ -2410,7 +2410,7 @@ One of `query` and `query_id` must be specified. #### Example with one host targeted by hostname -`POST /api/v1/fleet/queries/run_by_names` +`POST /api/v1/fleet/queries/run_by_identifiers` ##### Request body @@ -2449,7 +2449,7 @@ One of `query` and `query_id` must be specified. #### Example with multiple hosts targeted by label name -`POST /api/v1/fleet/queries/run_by_names` +`POST /api/v1/fleet/queries/run_by_identifiers` ##### Request body @@ -2486,6 +2486,39 @@ One of `query` and `query_id` must be specified. } ``` +#### Example with invalid label + +`POST /api/v1/fleet/queries/run_by_identifiers` + +##### Request body + +```json +{ + "query": "SELECT instance_id FROM system_info", + "selected": { + "labels": ["Windows", "Banana", "Apple"] + } +} +``` + +##### Default response + +`Status: 400` + +```json +{ + "message": "Bad request", + "errors": [ + { + "name": "base", + "reason": "Invalid label name(s): Banana, Apple." + } + ], + "uuid": "303649f4-5e45-4379-bae9-64ec0ef56287" +} +``` + + ### Retrieve live query results (standard WebSocket API) You can retrieve the results of a live query using the [standard WebSocket API](#https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications).