pub struct AutomationTokenCreateRequest {
pub name: String,
pub role: Option<Role>,
pub roles: Option<Vec<String>>,
pub services: Option<Vec<String>>,
pub limit_services: Option<bool>,
pub limit_workspaces: Option<bool>,
pub workspaces: Option<Vec<String>>,
pub scope: Option<Scope>,
pub expires_at: Option<String>,
pub tls_access: Option<bool>,
}Fields§
§name: StringThe name of the token.
role: Option<Role>The role for the token. The roles field is the preferred way to assign roles. This field is supported for backwards compatibility with single-role tokens.
roles: Option<Vec<String>>Array of role IDs to assign to the token. Use this field for tokens with multiple roles. When provided, this takes precedence over the role field. To get available role IDs, use GET /roles.
services: Option<Vec<String>>List of service IDs the token can access. Only used when limit_services is true.
limit_services: Option<bool>When true, restricts the token to only the services specified in the services array. When false (default), the token has access to all services.
limit_workspaces: Option<bool>When true (default), restricts the token to only the workspaces specified in the workspaces array. When false, the token has access to all workspaces. Only applies to roles that support workspace access (such as Next-Gen WAF roles). For roles without workspace support, this field has no effect.
workspaces: Option<Vec<String>>List of workspace IDs the token can access. Only used when limit_workspaces is true and the token has roles that support workspace access.
scope: Option<Scope>§expires_at: Option<String>A UTC timestamp of when the token will expire.
tls_access: Option<bool>Indicates whether TLS access is enabled for the token. Only applicable when using the single-role role field. For tokens with multiple roles, assign TLS roles (tls_admin or tls_viewer) via the roles field instead.