Skip to content

Get tunnel credential metadata

GET
/api/devices/{device_id}/tunnel-credential
curl --request GET \
--url 'https://example.com/api/devices/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/tunnel-credential?organization_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \
--header 'Authorization: Bearer <token>'

Return the active tunnel credential METADATA for a device.

The raw secret is NEVER exposed by this endpoint. Only the prefix, timestamps and rotation_count are returned. Use the rotate endpoint to obtain a new raw token.

Returns 404 if the device does not belong to the organisation, or if the device has no active tunnel credential (e.g. provisioned before this feature was deployed).

device_id
required
Device Id
string format: uuid
organization_id
required
Organization Id
string format: uuid

Successful Response

Media type application/json
TunnelCredentialMetaResponse

Metadata for the active tunnel credential.

The raw secret is NEVER included; only non-sensitive fields are returned. Use the rotate endpoint to obtain a new secret.

object
created_at
required
Created At
string format: date-time
is_active
required
Is Active
boolean
last_rotated_at
Any of:
string format: date-time
last_used_at
Any of:
string format: date-time
rotation_count
required
Rotation Count
integer
token_prefix
required
Token Prefix
string
Example generated
{
"created_at": "2026-04-15T12:00:00Z",
"is_active": true,
"last_rotated_at": "2026-04-15T12:00:00Z",
"last_used_at": "2026-04-15T12:00:00Z",
"rotation_count": 1,
"token_prefix": "example"
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}