RunpodR
Runpod10mo ago
ozzie

Delete Serverless Endpoint via the API?

I am trying to delete the serverless endpoint via the API, but everytime I make a request to the endpoint, I get an internal error:

Via the Python API:
delete_endpoint_graphql = """mutation {{
  deleteEndpoint(id: "{ENDPOINT_ID}") {{
    id
  }}
}}
"""


async def delete_endpoint(endpoint_id: str):
    try:
        runpod.api.graphql.run_graphql_query(
            delete_endpoint_graphql.format(ENDPOINT_ID=endpoint_id)
        )
    except runpod.error.QueryError as e:
        print(e)
        print_warning(
            f"Failed to delete endpoint {endpoint_id}: {e}Please delete it manually."
        )

Response:
Something went wrong. Please try again later or contact support.


I confirmed that my min and max is set to zero as per the GraphQL docs:

min and max workers must both be set to zero for your call to work.
Was this page helpful?