Skip to main content
Beta Feature: The Actor concept is currently in beta. Full support requires the new API key format which is not yet generally available. Contact [email protected] for early access.

Overview

An Actor represents an entity that performs actions in the Nonce system. The Actor concept provides a clear and unified way to identify who performed an operation, enabling comprehensive task audit capabilities. With actors, you can:
  • Track which user, API key, or system process created a task batch
  • Build audit trails for compliance and operational visibility
  • Distinguish between manual operations (users) and automated operations (API keys or system)

Actor Types

TypeDescriptionID Prefix
userA human user authenticated via the Nonce platformuser_
apikeyAn API key used for programmatic accesskey_
systemInternal system operations or automations-

Actor Schema

When included in API responses, an actor contains the following fields:
FieldTypeDescription
typestringThe actor type: user, apikey, or system
idstringUnique identifier of the actor
namestring | nullDisplay name of the actor
avatarstring | nullAvatar URL (for user actors)
metadataobjectAdditional metadata about the actor

Example Actor Response

User Actor:
{
  "type": "user",
  "id": "user_2xGz1234567890",
  "name": "John Doe",
  "avatar": "https://example.com/avatar.png",
  "metadata": {
    "email": "[email protected]"
  }
}
API Key Actor:
{
  "type": "apikey",
  "id": "key_abc123xyz",
  "name": "Production API Key",
  "avatar": null,
  "metadata": {
    "keyPrefix": "nonce_sk_..."
  }
}
System Actor:
{
  "type": "system",
  "id": "automation-system",
  "name": "Automation",
  "avatar": null
}

Usage in API Responses

Task Batches

When you retrieve task batches, the created_by field contains the actor who created the batch:
{
  "batch_id": "xxxxx-xxxxx-xxxx-xxxxxx",
  "task_name": "miner.power_mode.update",
  "status": "succeed",
  "task_count": 10,
  "succeed_count": 10,
  "failed_count": 0,
  "created_by": {
    "type": "user",
    "id": "user_2xGz1234567890",
    "name": "John Doe",
    "avatar": "https://example.com/avatar.png"
  },
  "created_at": "2024-01-15T10:30:00Z"
}
If the actor cannot be resolved (e.g., user was deleted), the created_by field may be null or contain an “Unknown” actor.

Current Limitations

The Actor feature requires the new API key format to fully function. With legacy API keys, actor information may be limited or unavailable.
  • Legacy API keys: Tasks created with legacy API keys may show limited actor information
  • System operations: Some automated operations are attributed to the system actor
  • Historical data: Older records may not have actor information populated

Future Enhancements

Once the new API key format is generally available:
  • Full actor tracking for all API operations
  • Enhanced audit logging with actor information
  • Actor-based filtering in list endpoints