We characterize in bicategorical terms actions of monoidal categories on the categories of representations of algebras and of relative Hopf modules. For this purpose we introduce 2-cocycles in any 2-category [Formula: see text]. We observe that under certain conditions the structures of pseudofunctors between bicategories are in one-to-one correspondence with (twisted) 2-cocycles in the image bicategory. In particular, for certain pseudofunctors to Cat, the 2-category of categories, one gets 2-cocycles in the free completion 2-category under Eilenberg–Moore objects, constructed by Lack and Street. We introduce (co)quasi-bimonads in [Formula: see text] and a suitable bicategory of Tambara (co)modules over (co)quasi-bimonads in [Formula: see text] fitting the setting of the latter pseudofuntors. We describe explicitly the involved 2-cocycles in this context and show how they are related to Sweedler’s and Hausser–Nill 2-cocycles in [Formula: see text], which we define. This allows us to recover some results of Schauenburg, Balan, Hausser and Nill for modules over commutative rings. We fit a version of the 2-category of bimonads in [Formula: see text], which we introduced in a previous paper, in a similar setting as above and recover a result of Laugwitz. We observe that pseudofunctors to Cat in general determine what we call pseudo-actions of hom-categories, which correspond to the whole range of a 2-cocycle, so that the described actions of categories appear as restrictions of these 2-cocycles to endo-hom categories.