# Send console command

#### HTTP Request <a href="#http-request-4" id="http-request-4"></a>

`POST https://garry.host/api/client/servers/<ID>/command`

#### URL Parameters <a href="#url-parameters-3" id="url-parameters-3"></a>

| Parameter | Description                                         |
| --------- | --------------------------------------------------- |
| ID        | The ID of the server that you are requesting.       |
| command   | The command that you would like sent to the server. |

```php
  curl "https://garry.host/api/client/servers/<id>/command" \
  -H "Authorization: Bearer api" \
  -H "Content-Type: application/json" \
  -H "Accept: Application/vnd.pterodactyl.v1+json" \
  -X POST \
  -d '{ "command": "say test" }'
```

This endpoint sends a command to the server.

You are required to add the `Accept: Application/vnd.pterodactyl.v1+json` and `Content-Type: application/json`headers for this endpoint.

If successful, there will be an empty response body. The server must be online already, otherwise you will receive a `HTTP 412`error.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.garryhost.com/api/send-console-command.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
