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
| Field | Type | Description |
|---|---|---|
url | string | The 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.
| Field | Type | Description |
|---|---|---|
image_hash | string | The 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
- Identify the full image reference you expect the service to be using (e.g.,
ghcr.io/my-org/my-service:latest). - Compute the SHA256 hash of this string locally.
- Compare your local hash with the
image_hashreturned 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 Code | Description |
|---|---|
| 400 - Bad Request | Invalid JSON or URL format. |
| 404 - Not Found | The URL could not be resolved to a known service. |
| 500 - Internal Server Error | Failed to query the backend services. |