Skip to main content

Stop an Instance

Stop an running instance.

/instance/stop

Authorization

You can find the AccessToken in the Request Header, or copy it from the web page(copy Auth Token). This token is generated each time you log in and will expire after one day.

You can also request the login api to get another token. See login api.

The AccessToken should be included in the request as a cookie. In the cURL example below, you can see how the token is passed using the -b flag:

-b 'AccessToken=your_token_here'

Note: Replace your_token_here with your actual AccessToken. The token is a JWT (JSON Web Token) that contains your authentication information and permissions.

Request Body

The request body contains the instance ID that you want to stop.

FieldTypeRequiredDescription
instanceIdstringYesThe ID of the instance to stop

Example Request

{
"instanceId": "notebook-43f8fcd9-xxxx-xxxx-xxxx-96891d9dfb5e"
}

cURL Example

curl 'https://hpc-ai.com/api/instance/stop' \
-H 'content-type: application/json' \
-b 'AccessToken=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsicGxhdGZvcm0uY29sb3NzYWxhaS5jb20iXSwiZXhwIjoxNzUxNjExOTE2LCJncm91cCI6WyJhZG1pbiJdLCJpYXQiOjE3NTE1MjU1MTYsImlzcyI6ImhwY2FpdGVjaC5jb20iLCJzdWIiOiIwOGY2ZjI2MS1hNzY2LTQ2M2UtOGJhNC04NWU2YWUzMmY0OTIifQ.hDEYrfq5zksB7ywx7scoNM-IJmyW88mYTtz435kamqoO8etsSPHy1yLe2L7WKAkUx_eJOISUauwTUX6Of8ys5gj8MP4BK6Ixh_saAWylRdF7IrFMDb16Yaxc2a91yAhK26IsiDCOoygSBYZ8tMHMUJkudkY2CqzSJvb3Z-kCqJfK8wlgY45Dgx6dTkVeYvA9bohnRQ6R4hI57HJo8fnav3VxkzEbYcs9UmLSNgfPYdC-mCURsSsPUaCTVEUxk9oJaHXmyH61uo7ZQKOHXNqsCHVgwFJPAm3YjPCx3n1jNYPGH-amnrLt0PQVpFa-PGWwjySrOVyjmjtlsxxxxxx' \
--data-raw '{"instanceId":"notebook-43f8fcd9-xxxx-xxxx-xxxx-96891d9dfb5e"}'

Example Response

Success Response

{
"instanceId":"notebook-43f8fcd9-xxxx-xxxx-xxxx-96891d9dfb5e"
}

Error Response

{
"message":"ent: instance not found"
}