Shutdown and Delete an App
When you want to stop an app (and pause the billing for that app), you want to call the update-app endpoint and set the active_workers to 0. You can do that by executing the following request
PUT /app/<app-id>
where app-id
is the app you want to scale down to 0.
Required Headers
x-api-key
: A valid API key that authenticates the user.x-team-id
: (Optional/Nullable) The ID of the team associated with the request.Content-Type
:application/json
- Bash
- Python
curl --location --request PUT 'https://api.rungen.ai/app/<APP-ID>' \
--header 'x-api-key: <YOUR-API-KEY>' \
--header 'Content-Type: application/json' \
--data '{
"configuration": {
"active_workers": 0
}
}'
import requests
import json
url = "https://api.rungen.ai/app/<APP-ID>"
payload = json.dumps({
"configuration": {
"active_workers": 0
}
})
headers = {
'x-api-key': '<YOUR-API-KEY>',
'Content-Type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
You should receive a response where the status for that app is STOPPED
{
"data": {
...
"status": "STOPPED",
"updated_at": "2025-01-02T02:30:57",
...
}
}
If you think you don't need the app anymore, you can delete it. To delete an app, you must send a DELETE request to:
DELETE /app/<app_id>
where <app_id>
is the unique identifier of the app you want to remove.
Important Pre-requisite
- Update the app so that
active_workers
is set to 0.- This ensures that no active processes or workers are running before you remove the app.
- Confirm that the app is in a safe state to be deleted (e.g., not currently processing jobs).
Required Headers
x-api-key
: A valid API key for the authenticated user.- (Optional)
x-team-id
: If your API requires team context, also include it here.
Example Requests
- Bash
- Python
curl --location --request DELETE 'https://api.rungen.ai/app/<APP-ID>' \
--header 'x-api-key: <YOUR-API-KEY>' \
--header 'x-team-id: <YOUR-TEAM-ID>'
import requests
url = "https://api.rungen.ai/app/<APP-ID>"
headers = {
"x-api-key": "<YOUR-API-KEY>",
"x-team-id": "<YOUR-TEAM-ID>"
}
response = requests.delete(url, headers=headers)
print(response.json())