Skip to main content

register_service

Function register_service 

Source
pub fn register_service(
    request: Json<ServiceRegisterRequest>,
    _actor: Actor,
    pool: &State<DbPool>,
) -> Result<(Status, Json<ServiceDto>), Status>
Expand description

Registers (defines) a new service in the registry — the agent twin of the “Add a service” screen (/services/new, create_service_human). Token-gated via the Actor guard; 401 without a valid token, 409 if the service name already exists, 201 with the service on success. (This defines a service; activating it on a corpus — creating tasks — is POST /api/corpora/<c>/services/<s>.)