Delete an Instance

This route deletes an instance from the marketplace and is available to both providers and admins.

Delete an Instance from the GPU Marketplace

This endpoint permanently deletes a specific instance from the marketplace. This is a dual-role endpoint that can be used by both Administrators and Providers.

  • Admins can delete any instance on the platform.
  • Providers can only delete instances that they own.

Endpoint

DELETE /api/v1/instances/{instance_id}

Authentication

TypeRequiredLocationDescription
Admin Key OR Provider KeytrueHeaderThe key must be sent as x-api-key: YOUR_API_KEY.

The behavior of this endpoint depends on the type of key provided.


URL Parameters

ParameterTypeRequiredDescription
instance_idstringtrueThe unique ID of the instance to be deleted.

Request

This endpoint does not require a request body.

Example Requests

As an Administrator

This request will delete any instance, regardless of owner. Replace INSTANCE_ID_TO_DELETE and YOUR_ADMIN_KEY.

curl -X DELETE 'https://offers.dataoorts.com/api/v1/instances/INSTANCE_ID_TO_DELETE' \
-H 'x-api-key: YOUR_ADMIN_KEY'

As a Provider

This request will only succeed if the instance belongs to the authenticated provider. Replace INSTANCE_ID_YOU_OWN and YOUR_PROVIDER_API_KEY.

curl -X DELETE 'https://offers.dataoorts.com/api/v1/instances/INSTANCE_ID_YOU_OWN' \
-H 'x-api-key: YOUR_PROVIDER_API_KEY'

Responses

✅ Success Response (200 OK)

Returned when the instance is successfully found and deleted.

Body

{
  "status": "Success",
  "message": "Success: Instance 'IID_21052024103005123' has been deleted."
}

❌ Error Response (401 Unauthorized)

Returned if the x-api-key header is missing or the provided key is invalid and does not match any user (Admin or Provider).

Body

{
  "error": "Unauthorized: Invalid API key."
}
🚧

More than three failed authentication attempts will result in a permanent IP block.


❌ Error Response (403 Forbidden)

This error is specific to Providers. It is returned when a provider attempts to delete an instance that they do not own.

Body

{
  "error": "Forbidden: Instance do not exists or you do not have permission to delete this instance."
}

❌ Error Response (404 Not Found)

Returned if no instance exists with the instance_id provided in the URL. This can occur for both Admin and Provider roles.

Body

{
  "error": "Not Found",
  "details": "No instance found with ID 'IID_56953657865412360258960'."
}

❌ Error Response (500 Internal Server Error)

Returned for database errors or other unexpected issues on the server during the deletion process.

Body

{
  "error": "A database error occurred",
  "details": "Specific error message from the database driver."
}