> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squarecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Restart application

> Restart an application with POST /v2/apps/{app_id}/restart, stopping and starting it again. Call it after a commit so the new files take effect.

<ParamField header="Authorization" type="string" placeholder="API Key" required>
  The API key for your account. You can find this in your [account settings](https://squarecloud.app/en/account/security).
</ParamField>

Requires an API key with the `apps:control` [scope](/en/api-reference/authentication#scopes).

Restarts a running application: it stops the application and then starts it again. This is the endpoint to call after [Commit Application](/en/api-reference/endpoint/apps/commit) so newly pushed files take effect, since committing on its own does not restart the application.

On workspace-shared applications, the caller needs the `manager`, `maintain` or `admin` [role](/en/api-reference/endpoint/workspace/members/invite#roles). The request is rate limited to 1 restart per 3 seconds per application, and to 20 lifecycle actions per 15 seconds per user across all applications, with a short block once that cap is hit. A restart can fail, for example when the application doesn't come back up: check [Get Application Status](/en/api-reference/endpoint/apps/status) and the [logs](/en/api-reference/endpoint/apps/logs), and [start](/en/api-reference/endpoint/apps/start) it again if needed. The request is also rejected with `403 RESTORE_IN_PROGRESS` while a snapshot restore runs on the application (up to about 2 minutes): wait for the restore to finish and try again.

## Parameters

<ParamField path="app_id" type="string" placeholder="Application ID" required>
  The ID of the application. You can find this in the URL of your application's dashboard.
</ParamField>

## Response

<ResponseField name="status" type="string">
  Indicates whether the call was successful: `success` if it was, `error` if not.
</ResponseField>

<ResponseExample>
  ```json theme={"system"}
  {
      "status": "success"
  }
  ```
</ResponseExample>

## Common errors

| Code | HTTP | Meaning |
| - | - | - |
| `RESTORE_IN_PROGRESS` | 403 | A snapshot restore is running on this application; wait for it to finish (up to about 2 minutes). |
| `ACTION_FAILED` | 409 | The cluster rejected the action, for example the application is already mid-deploy. |

## Related

* CLI: [`squarecloud app restart`](/en/cli-reference/apps#squarecloud-app-restart)
* SDKs: [`api.apps.restart()`](/en/sdks/js/managing_application) (JavaScript), [`client.apps.restart()`](/en/sdks/py/managing_application) (Python), [`c.Apps.Restart()`](/en/sdks/go/managing_application) (Go)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.