def save(
    *,
    value: str,
    type: str | None = None,
    tags: List[str] = None,
    overwrite=False,
    **kwargs,
) -> ObservableTypes:
    """
    Save an observable object. If the object is already in the database, it will be updated.

    kwargs must contain a "value" field representing the of the observable.

    if kwargs does not contain a "type" field, type will be automatically
    determined based on the value. If the type is not recognized, a ValueError will be raised.

    tags is an optional list of tags to add to the observable.
    """
    observable_obj = create(value=value, type=type, **kwargs)
    db_obs = find(value=observable_obj.value, type=observable_obj.type)
    if db_obs:
        if overwrite:
            observable_obj = observable_obj.save()
        else:
            observable_obj = db_obs
    else:
        observable_obj = observable_obj.save()
    if tags:
        observable_obj.tag(tags)
    return observable_obj

    Save an observable object. If the object is already in the database, it will be updated.

    kwargs must contain a "value" field representing the of the observable.

    if kwargs does not contain a "type" field, type will be automatically
    determined based on the value. If the type is not recognized, a ValueError will be raised.

    tags is an optional list of tags to add to the observable.
    
core/schemas/observable.py