def new_extended(
    httpreq: Request, request: NewExtendedObservableRequest
) -> ObservableTypes:
    """Creates a new observable in the database with extended properties.

    Raises:
        HTTPException(400) if observable already exists.
    """
    if observable.find(value=request.observable.value, type=request.observable.type):
        raise HTTPException(
            status_code=400,
            detail=f"Observable with value {request.observable.value} already exists",
        )
    try:
        new = observable.save(
            **request.observable.model_dump(exclude={"tags"}), tags=request.tags
        )
        audit.log_timeline(httpreq.state.username, new)
        rbac.set_acls(new, user=httpreq.state.user)
        return new
    except Exception:
        raise HTTPException(
            status_code=400,
            detail="Failed to add observable",
        )
Creates a new observable in the database with extended properties.

    Raises:
        HTTPException(400) if observable already exists.
    
core/web/apiv2/observables.py