Get last seen identity
zero_trust.access.users.last_seen_identity.get(struser_id, LastSeenIdentityGetParams**kwargs) -> Identity
GET/accounts/{account_id}/access/users/{user_id}/last_seen_identity
Get last seen identity for a single user.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Get last seen identity
import os
from cloudflare import Cloudflare
client = Cloudflare(
api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted
)
identity = client.zero_trust.access.users.last_seen_identity.get(
user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
print(identity.account_id){
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true,
"result": {
"account_id": "1234567890",
"auth_status": "NONE",
"common_name": "",
"device_id": "",
"device_sessions": {
"foo": {
"last_authenticated": 1638832687
}
},
"devicePosture": {
"foo": {
"id": "id",
"check": {
"exists": true,
"path": "path"
},
"data": {},
"description": "description",
"error": "error",
"rule_name": "rule_name",
"success": true,
"timestamp": "timestamp",
"type": "type"
}
},
"email": "test@cloudflare.com",
"geo": {
"country": "US"
},
"iat": 1694791905,
"idp": {
"id": "id",
"type": "type"
},
"ip": "127.0.0.0",
"is_gateway": false,
"is_warp": false,
"mtls_auth": {
"auth_status": "auth_status",
"cert_issuer_dn": "cert_issuer_dn",
"cert_issuer_ski": "cert_issuer_ski",
"cert_presented": true,
"cert_serial": "cert_serial"
},
"service_token_id": "",
"service_token_status": false,
"user_uuid": "57cf8cf2-f55a-4588-9ac9-f5e41e9f09b4",
"version": 2
}
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true,
"result": {
"account_id": "1234567890",
"auth_status": "NONE",
"common_name": "",
"device_id": "",
"device_sessions": {
"foo": {
"last_authenticated": 1638832687
}
},
"devicePosture": {
"foo": {
"id": "id",
"check": {
"exists": true,
"path": "path"
},
"data": {},
"description": "description",
"error": "error",
"rule_name": "rule_name",
"success": true,
"timestamp": "timestamp",
"type": "type"
}
},
"email": "test@cloudflare.com",
"geo": {
"country": "US"
},
"iat": 1694791905,
"idp": {
"id": "id",
"type": "type"
},
"ip": "127.0.0.0",
"is_gateway": false,
"is_warp": false,
"mtls_auth": {
"auth_status": "auth_status",
"cert_issuer_dn": "cert_issuer_dn",
"cert_issuer_ski": "cert_issuer_ski",
"cert_presented": true,
"cert_serial": "cert_serial"
},
"service_token_id": "",
"service_token_status": false,
"user_uuid": "57cf8cf2-f55a-4588-9ac9-f5e41e9f09b4",
"version": 2
}
}