Skip to main content

Workloads

Workloads are compute jobs running on Targon infrastructure. There are two primary workload types:

  • Rental — A dedicated GPU instance that runs continuously. Supports persistent storage via volumes and SSH access. Ideal for training, fine-tuning, or interactive development.
  • Serverless — An auto-scaling endpoint that scales between zero and many replicas based on traffic. Does not support volumes, but provides fine-grained scaling, concurrency, and health probe configuration. Ideal for inference APIs and event-driven workloads.

Lifecycle

Workloads follow a register-then-deploy pattern:

  1. Register — Call Create Workload (POST /tha/v2/workloads) to register the workload and its configuration. The workload is saved but not yet running.
  2. Deploy — Call Deploy Workload (POST /tha/v2/workloads/{workload_uid}/deploy) to start the workload on the cluster.

This two-step flow lets you configure everything (attach volumes, SSH keys, update settings) before committing resources.

Authentication

All workload endpoints require authentication using a Bearer token. Include your API key in the Authorization header:

Authorization: Bearer <YOUR_API_KEY>

Create Workload

Register a new workload configuration. This does not start the workload — it only saves the configuration. To start running the workload on the cluster, follow up with Deploy Workload.

Endpoint

POST /tha/v2/workloads

Common Fields

These fields apply to both rental and serverless workloads:

FieldTypeDescription
namestringRequired. Name for the workload. Lowercase alphanumeric and hyphens only.
imagestringRequired. Container image to run (e.g. pytorch/pytorch:latest).
resource_namestringRequired. Compute resource to use (e.g. h200-small).
typestringRequired. Workload type: RENTAL or SERVERLESS.
project_idstringUID of the project this workload belongs to.
app_idstringUID of the app this workload belongs to.
portsarrayPort mappings for the workload. See Port object.
envsarrayEnvironment variables. See Env object.
commandsarrayContainer command override (string array).
argsarrayContainer arguments (string array).
registry_authobjectPrivate registry credentials. See Registry auth object.

Rental-Only Fields

FieldTypeDescription
volumesarrayVolume mounts. See Volume mount object.
ssh_keysarraySSH key UIDs (string array) to attach for shell access.

Rental workloads cannot include serverless_config.

Serverless-Only Fields

FieldTypeDescription
serverless_configobjectRequired. Scaling and runtime configuration. See Serverless config.

Serverless workloads cannot include volumes.


Port Object

FieldTypeDescription
portintegerRequired. Port number (1024–65535).
protocolstringProtocol: TCP, UDP, or SCTP.
routingstringRouting type: PROXIED or DIRECT.

Env Object

FieldTypeDescription
namestringEnvironment variable name.
valuestringEnvironment variable value.

Registry Auth Object

FieldTypeDescription
serverstringRegistry server URL.
usernamestringRegistry username.
passwordstringRegistry password or token.

Volume Mount Object

Used in rental workloads to attach persistent storage.

FieldTypeDescription
uidstringRequired. UID of the volume to mount.
mount_pathstringRequired. Path inside the container to mount at.
read_onlybooleanMount as read-only. Defaults to false.

Serverless Config

Controls auto-scaling behavior, health probes, and request handling for serverless workloads.

FieldTypeDescription
min_replicasintegerMinimum number of replicas. Set to 0 to allow scale-to-zero.
max_replicasintegerMaximum number of replicas.
initial_replicasintegerNumber of replicas at initial deploy.
container_concurrencyintegerMaximum concurrent requests a single replica handles before queuing.
target_concurrencyintegerTarget concurrent requests per replica for the autoscaler.
scale_up_delaystringDelay before scaling up (e.g. "0s").
scale_down_delaystringDelay before scaling down (e.g. "300s").
zero_grace_periodstringGrace period before scaling to zero (e.g. "600s").
scaling_metricstringMetric used for autoscaling (e.g. "concurrency", "rps").
target_valuenumberTarget value for the scaling metric.
timeout_secondsintegerRequest timeout in seconds.
startup_timeoutintegerMaximum time in seconds for the container to start.
liveness_probeobjectLiveness probe configuration. See Probe config.
readiness_probeobjectReadiness probe configuration. See Probe config.
startup_probeobjectStartup probe configuration. See Probe config.
custom_annotationsobjectKey-value pairs of custom annotations.

Probe Config

Used for liveness_probe, readiness_probe, and startup_probe.

FieldTypeDescription
pathstringHTTP path to probe (e.g. "/healthz").
portintegerPort to probe.
initial_delay_secondsintegerSeconds to wait before the first probe.
period_secondsintegerHow often (in seconds) to run the probe.
timeout_secondsintegerSeconds before the probe times out.
failure_thresholdintegerConsecutive failures before marking unhealthy.
success_thresholdintegerConsecutive successes before marking healthy.

Example: Create a Rental Workload

curl -X POST https://api.targon.com/tha/v2/workloads \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "my-training-job",
"image": "pytorch/pytorch:latest",
"resource_name": "h200-small",
"type": "RENTAL",
"project_id": "prj-abc123def456",
"ports": [
{"port": 8080, "protocol": "TCP", "routing": "PROXIED"},
{"port": 2222, "protocol": "TCP", "routing": "DIRECT"}
],
"envs": [
{"name": "MODEL_NAME", "value": "llama-3"}
],
"volumes": [
{"uid": "vol-xyz789abc123", "mount_path": "/data"}
],
"ssh_keys": ["shk-def456ghi789"]
}'

Example: Create a Serverless Workload

curl -X POST https://api.targon.com/tha/v2/workloads \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "my-inference-api",
"image": "my-model-server:latest",
"resource_name": "h200-small",
"type": "SERVERLESS",
"project_id": "prj-abc123def456",
"ports": [
{"port": 8080, "protocol": "TCP", "routing": "PROXIED"}
],
"envs": [
{"name": "MODEL_NAME", "value": "llama-3"}
],
"serverless_config": {
"min_replicas": 0,
"max_replicas": 5,
"initial_replicas": 1,
"target_concurrency": 10,
"scale_down_delay": "300s",
"zero_grace_period": "600s",
"timeout_seconds": 60,
"readiness_probe": {
"path": "/healthz",
"port": 8080,
"initial_delay_seconds": 10,
"period_seconds": 5
}
}
}'

Response

Returns the created workload object.

FieldTypeDescription
uidstringUnique identifier for the workload (e.g. wrk-...).
namestringName of the workload.
imagestringContainer image.
typestringWorkload type (RENTAL or SERVERLESS).
resource_namestringCompute resource.
project_idstringProject UID.
app_idstringApp UID.
portsarrayPort mappings.
envsarrayEnvironment variables.
commandsarrayContainer commands.
argsarrayContainer arguments.
volumesarrayVolume mounts (rental only).
ssh_keysarrayAttached SSH keys (rental only).
serverless_configobjectServerless configuration (serverless only).
stateobjectCurrent workload state.
resourceobjectCompute resource details.
cost_per_hournumberHourly cost.
revisionstringCurrent revision.
created_atstringISO 8601 creation timestamp.
updated_atstringISO 8601 last update timestamp.

The state object:

FieldTypeDescription
statusstringCurrent status.
messagestringStatus message.
ready_replicasintegerNumber of ready replicas.
total_replicasintegerTotal number of replicas.
urlsarrayAccess URLs for the workload.

The resource object:

FieldTypeDescription
namestringResource identifier.
display_namestringHuman-readable name.
gpu_typestringGPU type (e.g. "H200").
gpu_countintegerNumber of GPUs.
vcpuintegerVirtual CPU cores.
memoryintegerMemory in MB.

Example Response (Rental)

{
"uid": "wrk-abc123def456",
"name": "my-training-job",
"image": "pytorch/pytorch:latest",
"type": "RENTAL",
"resource_name": "h200-small",
"project_id": "prj-abc123def456",
"ports": [
{"port": 8080, "protocol": "TCP", "routing": "PROXIED"},
{"port": 2222, "protocol": "TCP", "routing": "DIRECT"}
],
"envs": [
{"name": "MODEL_NAME", "value": "llama-3"}
],
"volumes": [
{"uid": "vol-xyz789abc123", "name": "my-data", "mount_path": "/data"}
],
"ssh_keys": [
{"uid": "shk-def456ghi789", "name": "my-laptop", "public_key_raw": "ssh-ed25519 AAAA..."}
],
"state": {
"status": "REGISTERED",
"message": "",
"ready_replicas": 0,
"total_replicas": 0,
"urls": []
},
"resource": {
"name": "h200-small",
"display_name": "NVIDIA H200 - Small",
"gpu_type": "H200",
"gpu_count": 1,
"vcpu": 12,
"memory": 115000
},
"cost_per_hour": 2.49,
"revision": "1",
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
}

Example Response (Serverless)

{
"uid": "wrk-jkl012mno345",
"name": "my-inference-api",
"image": "my-model-server:latest",
"type": "SERVERLESS",
"resource_name": "h200-small",
"project_id": "prj-abc123def456",
"ports": [
{"port": 8080, "protocol": "TCP", "routing": "PROXIED"}
],
"envs": [
{"name": "MODEL_NAME", "value": "llama-3"}
],
"serverless_config": {
"min_replicas": 0,
"max_replicas": 5,
"initial_replicas": 1,
"target_concurrency": 10,
"scale_down_delay": "300s",
"zero_grace_period": "600s",
"timeout_seconds": 60,
"readiness_probe": {
"path": "/healthz",
"port": 8080,
"initial_delay_seconds": 10,
"period_seconds": 5
}
},
"state": {
"status": "REGISTERED",
"message": "",
"ready_replicas": 0,
"total_replicas": 0,
"urls": []
},
"resource": {
"name": "h200-small",
"display_name": "NVIDIA H200 - Small",
"gpu_type": "H200",
"gpu_count": 1,
"vcpu": 12,
"memory": 115000
},
"cost_per_hour": 2.49,
"revision": "1",
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
}

Errors

Status CodeDescription
400 - Bad RequestInvalid request body or type-specific validation failed (e.g. serverless_config on a rental).
401 - UnauthorizedInvalid or missing API key.
500 - Internal Server ErrorServer error.

List Workloads

List workloads for the authenticated user, with optional filters.

Endpoint

GET /tha/v2/workloads

Query Parameters

FieldTypeDescription
limitintegerMaximum number of items to return.
cursorstringPagination cursor from a previous response.
typestringFilter by workload type (RENTAL, SERVERLESS).
statusstringFilter by workload status.
project_idstringFilter by project UID.
app_idstringFilter by app UID.
namestringFilter by workload name.

Example Request

curl -X GET "https://api.targon.com/tha/v2/workloads?type=RENTAL&limit=10" \
-H "Authorization: Bearer <YOUR_API_KEY>"

Response

FieldTypeDescription
itemsarrayList of workload summary objects.
next_cursorstringCursor for the next page of results.

Each item in items:

FieldTypeDescription
uidstringUnique identifier for the workload.
namestringName of the workload.
imagestringContainer image.
stateobjectCurrent workload state.
resourceobjectCompute resource details.
cost_per_hournumberHourly cost.
revisionstringCurrent revision.
volumesarrayVolume mounts.
created_atstringISO 8601 creation timestamp.
updated_atstringISO 8601 last update timestamp.

Example Response

{
"items": [
{
"uid": "wrk-abc123def456",
"name": "my-training-job",
"image": "pytorch/pytorch:latest",
"state": {
"status": "RUNNING",
"message": "",
"ready_replicas": 1,
"total_replicas": 1,
"urls": [{"port": 8080, "url": "https://wrk-abc123def456.caas.targon.com"}]
},
"resource": {
"name": "h200-small",
"display_name": "NVIDIA H200 - Small",
"gpu_type": "H200",
"gpu_count": 1,
"vcpu": 12,
"memory": 115000
},
"cost_per_hour": 2.49,
"revision": "1",
"volumes": [],
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:35:00Z"
}
],
"next_cursor": ""
}

Errors

Status CodeDescription
400 - Bad RequestInvalid query parameters.
401 - UnauthorizedInvalid or missing API key.
500 - Internal Server ErrorServer error.

Get Workload

Retrieve a workload by its UID.

Endpoint

GET /tha/v2/workloads/{workload_uid}

Path Parameters

FieldTypeDescription
workload_uidstringUnique identifier of the workload.

Example Request

curl -X GET https://api.targon.com/tha/v2/workloads/wrk-abc123def456 \
-H "Authorization: Bearer <YOUR_API_KEY>"

Response

Returns the full workload object (same shape as the Create response).

Errors

Status CodeDescription
401 - UnauthorizedInvalid or missing API key.
403 - ForbiddenNot allowed.
404 - Not FoundWorkload not found.
500 - Internal Server ErrorServer error.

Update Workload

Update a workload's configuration. All fields are optional — only include the fields you want to change.

Endpoint

PATCH /tha/v2/workloads/{workload_uid}

Path Parameters

FieldTypeDescription
workload_uidstringUnique identifier of the workload.

Request Body

FieldTypeDescription
namestringNew name for the workload.
imagestringUpdated container image.
project_idstringUpdated project UID.
app_idstringUpdated app UID.
portsarrayUpdated port mappings.
envsarrayUpdated environment variables.
commandsarrayUpdated container commands.
argsarrayUpdated container arguments.
volumesarrayUpdated volume mounts.
ssh_keysarrayUpdated SSH key UIDs.
registry_authobjectUpdated registry credentials.
serverless_configobjectUpdated serverless configuration.

Example Request

curl -X PATCH https://api.targon.com/tha/v2/workloads/wrk-abc123def456 \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"image": "pytorch/pytorch:2.0",
"envs": [
{"name": "MODEL_NAME", "value": "llama-3.1"}
]
}'

Response

Returns the updated workload object.

Errors

Status CodeDescription
400 - Bad RequestInvalid request body.
401 - UnauthorizedInvalid or missing API key.
403 - ForbiddenNot allowed.
404 - Not FoundWorkload not found.
500 - Internal Server ErrorServer error.

Delete Workload

Delete a workload.

Endpoint

DELETE /tha/v2/workloads/{workload_uid}

Path Parameters

FieldTypeDescription
workload_uidstringUnique identifier of the workload.

Example Request

curl -X DELETE https://api.targon.com/tha/v2/workloads/wrk-abc123def456 \
-H "Authorization: Bearer <YOUR_API_KEY>"

Response

Returns 204 No Content on success.

Errors

Status CodeDescription
401 - UnauthorizedInvalid or missing API key.
403 - ForbiddenNot allowed.
404 - Not FoundWorkload not found.
500 - Internal Server ErrorServer error.

Deploy Workload

Deploy a registered workload to start running it on the cluster.

Endpoint

POST /tha/v2/workloads/{workload_uid}/deploy

Path Parameters

FieldTypeDescription
workload_uidstringUnique identifier of the workload.

Example Request

curl -X POST https://api.targon.com/tha/v2/workloads/wrk-abc123def456/deploy \
-H "Authorization: Bearer <YOUR_API_KEY>"

Response

Returns 202 Accepted with the workload operation response.

FieldTypeDescription
uidstringUnique identifier of the workload.
namestringName of the workload.
imagestringContainer image.
stateobjectCurrent workload state.
resourceobjectCompute resource details.
cost_per_hournumberHourly cost.
revisionstringCurrent revision.
volumesarrayVolume mounts.
created_atstringISO 8601 creation timestamp.
updated_atstringISO 8601 last update timestamp.

Example Response

{
"uid": "wrk-abc123def456",
"name": "my-training-job",
"image": "pytorch/pytorch:latest",
"state": {
"status": "DEPLOYING",
"message": "",
"ready_replicas": 0,
"total_replicas": 1,
"urls": []
},
"resource": {
"name": "h200-small",
"display_name": "NVIDIA H200 - Small",
"gpu_type": "H200",
"gpu_count": 1,
"vcpu": 12,
"memory": 115000
},
"cost_per_hour": 2.49,
"revision": "1",
"volumes": [],
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:36:00Z"
}

Errors

Status CodeDescription
401 - UnauthorizedInvalid or missing API key.
403 - ForbiddenNot allowed.
404 - Not FoundWorkload not found.
500 - Internal Server ErrorServer error.

Get Workload State

Get the current state of a workload.

Endpoint

GET /tha/v2/workloads/{workload_uid}/state

Path Parameters

FieldTypeDescription
workload_uidstringUnique identifier of the workload.

Example Request

curl -X GET https://api.targon.com/tha/v2/workloads/wrk-abc123def456/state \
-H "Authorization: Bearer <YOUR_API_KEY>"

Response

FieldTypeDescription
uidstringUnique identifier of the workload.
workload_typestringType of the workload.
statusstringCurrent status.
messagestringStatus message.
ready_replicasintegerNumber of ready replicas.
total_replicasintegerTotal number of replicas.
urlsarrayAccess URLs for the workload.
updated_atstringISO 8601 timestamp of last update.

Each item in urls:

FieldTypeDescription
portintegerThe exposed port.
urlstringThe access URL.

Example Response

{
"uid": "wrk-abc123def456",
"workload_type": "RENTAL",
"status": "RUNNING",
"message": "",
"ready_replicas": 1,
"total_replicas": 1,
"urls": [
{"port": 8080, "url": "https://wrk-abc123def456.caas.targon.com"}
],
"updated_at": "2025-01-15T10:40:00Z"
}

Errors

Status CodeDescription
401 - UnauthorizedInvalid or missing API key.
403 - ForbiddenNot allowed.
404 - Not FoundWorkload or workload state not found.
500 - Internal Server ErrorServer error.

List Workload Events

List lifecycle events for a workload (status changes, scaling events, errors).

Endpoint

GET /tha/v2/workloads/{workload_uid}/events

Path Parameters

FieldTypeDescription
workload_uidstringUnique identifier of the workload.

Query Parameters

FieldTypeDescription
limitintegerMaximum number of items to return.
cursorstringPagination cursor.

Example Request

curl -X GET "https://api.targon.com/tha/v2/workloads/wrk-abc123def456/events?limit=20" \
-H "Authorization: Bearer <YOUR_API_KEY>"

Response

FieldTypeDescription
itemsarrayList of workload event objects.
next_cursorstringCursor for the next page of results.

Each item in items:

FieldTypeDescription
workload_uidstringUID of the workload.
workload_typestringWorkload type.
event_typestringType of event.
new_statusstringNew workload status.
messagestringEvent message.
display_messagestringHuman-readable message.
reasonstringReason for the event.
pod_namestringPod name.
container_namestringContainer name.
container_imagestringContainer image.
exit_codeintegerContainer exit code.
replica_countintegerCurrent replica count.
resource_namestringCompute resource name.
created_atstringISO 8601 event timestamp.

Example Response

{
"items": [
{
"workload_uid": "wrk-abc123def456",
"workload_type": "RENTAL",
"event_type": "STATUS_CHANGE",
"new_status": "RUNNING",
"message": "All replicas ready",
"display_message": "Workload is now running",
"reason": "",
"pod_name": "wrk-abc123def456-0",
"container_name": "main",
"container_image": "pytorch/pytorch:latest",
"exit_code": 0,
"replica_count": 1,
"resource_name": "h200-small",
"created_at": "2025-01-15T10:35:00Z"
}
],
"next_cursor": ""
}

Errors

Status CodeDescription
400 - Bad RequestInvalid query parameters.
401 - UnauthorizedInvalid or missing API key.
403 - ForbiddenNot allowed.
404 - Not FoundWorkload not found.
500 - Internal Server ErrorServer error.

Get Workload Logs

Retrieve container logs for a workload.

Endpoint

GET /tha/v2/workloads/{workload_uid}/logs

Path Parameters

FieldTypeDescription
workload_uidstringUnique identifier of the workload.

Query Parameters

FieldTypeDescription
sincestringReturn logs after this timestamp (RFC 3339 format).
tailintegerNumber of most recent log lines to return.
followbooleanStream logs in real time. Defaults to false.

Example Request

curl -X GET "https://api.targon.com/tha/v2/workloads/wrk-abc123def456/logs?tail=100" \
-H "Authorization: Bearer <YOUR_API_KEY>"

Response

Returns plain text log output. When follow=true, the response is a streaming text/plain connection.

Errors

Status CodeDescription
400 - Bad RequestInvalid query parameters.
401 - UnauthorizedInvalid or missing API key.
403 - ForbiddenNot allowed.
404 - Not FoundWorkload not found.
500 - Internal Server ErrorServer error.

Verify Workload Digest

Verify a workload's container image digest.

Endpoint

POST /tha/v2/workloads/verify

Request Body

FieldTypeDescription
uidstringRequired. Workload UID to verify.
digeststringRequired. Image digest to verify (sha256).

Example Request

curl -X POST https://api.targon.com/tha/v2/workloads/verify \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"uid": "wrk-abc123def456",
"digest": "5a1b2c3..."
}'

Response

FieldTypeDescription
verifiedbooleanWhether the digest matches the workload.

Example Response

{
"verified": true
}

Errors

Status CodeDescription
400 - Bad RequestMissing uid or digest.
401 - UnauthorizedInvalid or missing API key.
500 - Internal Server ErrorServer error.

Attach Volume to Workload

Attach a volume to a running rental workload. Rental workloads only.

You can also attach volumes at creation time by including the volumes array in the Create Workload request body before deploying.

Endpoint

PUT /tha/v2/workloads/{workload_uid}/volumes/{volume_uid}

Path Parameters

FieldTypeDescription
workload_uidstringUnique identifier of the workload.
volume_uidstringUnique identifier of the volume.

Request Body

FieldTypeDescription
mount_pathstringRequired. Path inside the container to mount the volume.
read_onlybooleanMount as read-only. Defaults to false.

Example Request

curl -X PUT https://api.targon.com/tha/v2/workloads/wrk-abc123def456/volumes/vol-xyz789abc123 \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"mount_path": "/data",
"read_only": false
}'

Response

FieldTypeDescription
workload_uidstringWorkload UID.
uidstringVolume UID.
mount_pathstringMount path in the container.
read_onlybooleanWhether mounted as read-only.

Example Response

{
"workload_uid": "wrk-abc123def456",
"uid": "vol-xyz789abc123",
"mount_path": "/data",
"read_only": false
}

Errors

Status CodeDescription
400 - Bad RequestInvalid request body.
401 - UnauthorizedInvalid or missing API key.
403 - ForbiddenNot allowed.
404 - Not FoundWorkload or volume not found.
500 - Internal Server ErrorServer error.

Detach Volume from Workload

Detach a volume from a workload. Rental workloads only.

Endpoint

DELETE /tha/v2/workloads/{workload_uid}/volumes/{volume_uid}

Path Parameters

FieldTypeDescription
workload_uidstringUnique identifier of the workload.
volume_uidstringUnique identifier of the volume.

Example Request

curl -X DELETE https://api.targon.com/tha/v2/workloads/wrk-abc123def456/volumes/vol-xyz789abc123 \
-H "Authorization: Bearer <YOUR_API_KEY>"

Response

Returns 204 No Content on success.

Errors

Status CodeDescription
401 - UnauthorizedInvalid or missing API key.
403 - ForbiddenNot allowed.
404 - Not FoundWorkload or volume not found.
500 - Internal Server ErrorServer error.

Attach SSH Key to Workload

Attach an SSH key to a workload for secure shell access.

Endpoint

PUT /tha/v2/workloads/{workload_uid}/ssh-keys/{ssh_key_uid}

Path Parameters

FieldTypeDescription
workload_uidstringUnique identifier of the workload.
ssh_key_uidstringUnique identifier of the SSH key.

Example Request

curl -X PUT https://api.targon.com/tha/v2/workloads/wrk-abc123def456/ssh-keys/shk-def456ghi789 \
-H "Authorization: Bearer <YOUR_API_KEY>"

Response

FieldTypeDescription
workload_uidstringWorkload UID.
ssh_key_uidstringSSH key UID.

Example Response

{
"workload_uid": "wrk-abc123def456",
"ssh_key_uid": "shk-def456ghi789"
}

Errors

Status CodeDescription
401 - UnauthorizedInvalid or missing API key.
404 - Not FoundWorkload or SSH key not found.
409 - ConflictSSH key is already attached to this workload.
500 - Internal Server ErrorServer error.

Detach SSH Key from Workload

Detach an SSH key from a workload.

Endpoint

DELETE /tha/v2/workloads/{workload_uid}/ssh-keys/{ssh_key_uid}

Path Parameters

FieldTypeDescription
workload_uidstringUnique identifier of the workload.
ssh_key_uidstringUnique identifier of the SSH key.

Example Request

curl -X DELETE https://api.targon.com/tha/v2/workloads/wrk-abc123def456/ssh-keys/shk-def456ghi789 \
-H "Authorization: Bearer <YOUR_API_KEY>"

Response

Returns 204 No Content on success.

Errors

Status CodeDescription
401 - UnauthorizedInvalid or missing API key.
404 - Not FoundWorkload or SSH key attachment not found.
500 - Internal Server ErrorServer error.