Source Events ↗

cloudpanel.site.created

A site (webspace) was created successfully.

When
After clpctl exits successfully for site:add:* operations.
Payload
JSON: { operation, command, args, siteType?, status?, duration_ms, error?, hook_handlers }.
Cancelable
No

Emitted once the CloudPanel CLI finishes creating the webspace.

Use cases

  • Welcome emails
  • DNS provisioning
  • Post-create automation

Example

Registration and handler

Register

hook!(host, PluginEvent::CloudPanelSiteCreated, on_site_created);

Handler

extern "C" fn on_event(ctx: *const EventContext) -> HookResult {
    let ctx = unsafe { &*ctx };
    let payload = unsafe { std::slice::from_raw_parts(ctx.payload_ptr, ctx.payload_len) };
    let _json = std::str::from_utf8(payload).unwrap_or_default();
    HookResult::r#continue()
}

← All lifecycle events