Create Relation
hudu_create_relationLink any two Hudu records—asset, password, company, article—by creating a from/to relation. Returns the new relation and flags invalid inputs.
Instructions
Create a new relation in Hudu. A relation is a link between any two Hudu records — an asset to the password that opens it, an article to the company it documents — stored as a from/to pair of type-and-id. Hudu exposes no update route for relations, so changing one means deleting it and creating a replacement.
Returns the created record, including the id Hudu assigned. Hudu answers 422 with the offending field named when validation fails.
Operation class: Create.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| toable_id | Yes | Numeric Hudu id of the destination record, of the type named in `toable_type`. | |
| is_inverse | No | Leave this unset. Hudu creates the reverse link automatically and sets this flag on the copy it generates; sending true yourself declares the relation you are creating to be that generated mirror. | |
| description | No | Free text explaining what the link means, shown alongside it on both records — "admin credentials for this firewall". Worth filling in: the record names alone rarely say why two things were linked. | |
| fromable_id | Yes | Numeric Hudu id of the origin record, of the type named in `fromable_type`. | |
| toable_type | Yes | Kind of record at the destination of the link. Hudu documents six: Asset, Website, Procedure, AssetPassword (a stored password record), Company and Article. The string is case-sensitive and is Hudu's internal class name, not the label shown in the UI — a password is "AssetPassword", not "Password". | |
| fromable_type | Yes | Kind of record at the origin of the link. Hudu documents six: Asset, Website, Procedure, AssetPassword (a stored password record), Company and Article. The string is case-sensitive and is Hudu's internal class name, not the label shown in the UI — a password is "AssetPassword", not "Password". |