Skip to main content

Image Hash

Retrieve the SHA256 hash of the container image used by a deployed service.

Endpoint

POST /v1/deployments/image-hash

Description

This endpoint resolves a service URL to its underlying container image and returns the SHA256 hash of that image. It supports URLs from:

  • Rentals (*.caas.targon.com)
  • Serverless Functions (*.serverless.targon.com)
  • Inference Services (inf-u-*)

Authentication

This endpoint requires authentication using a Bearer token. Include your API key in the Authorization header of your request:

Authorization: Bearer <YOUR_API_KEY>

Request Body

FieldTypeDescription
urlstringThe full URL of the service to look up.

Example Request

curl -X POST https://api.targon.com/v1/deployments/image-hash \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"url": "https://my-service.caas.targon.com"
}'

Response

Returns a JSON object containing the image hash.

FieldTypeDescription
image_hashstringThe SHA256 hash of the container image.

Example Response

{
"image_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}

Verification

The image_hash returned by this endpoint is the SHA256 hash of the image reference string (e.g., ghcr.io/username/repo:tag) stored in the deployment configuration. To verify that the service is configured to use the image you expect, you can locally compute the hash of your expected image reference and compare it with the API response.

How to Verify

  1. Identify the full image reference you expect the service to be using (e.g., ghcr.io/my-org/my-service:latest).
  2. Compute the SHA256 hash of this string locally.
  3. Compare your local hash with the image_hash returned by the API.

Example

If your image is ghcr.io/my-org/my-service:latest:

# Using openssl
echo -n "ghcr.io/my-org/my-service:latest" | openssl dgst -sha256
# Output: 5d41402abc4b2a76b9719d911017c592...

# Using shasum
echo -n "ghcr.io/my-org/my-service:latest" | shasum -a 256
# Output: 5d41402abc4b2a76b9719d911017c592...

Errors

Status CodeDescription
400 - Bad RequestInvalid JSON or URL format.
404 - Not FoundThe URL could not be resolved to a known service.
500 - Internal Server ErrorFailed to query the backend services.