[comment]: # aside: 1

[comment]: # ({ee4a2645-28092341})
# Objeto macro de usuario

Los siguientes objetos están directamente relacionados con la API `usermacro`.

[comment]: # ({/ee4a2645-28092341})

[comment]: # ({2f5f2156-e654cd12})
### Macro global

El objeto de macro global tiene las siguientes propiedades.

|Property|[Type](/manual/api/reference_commentary#data-types)|Description|
|--|--|------|
|globalmacroid|ID|ID de la macro global.<br><br>[Property behavior](/manual/api/reference_commentary#property-behavior):<br>- *solo lectura*<br>- *obligatorio* para operaciones de actualización|
|macro|string|Cadena de macro.<br><br>[Property behavior](/manual/api/reference_commentary#property-behavior):<br>- *obligatorio* para operaciones de creación|
|value|string|Valor de la macro.<br><br>[Property behavior](/manual/api/reference_commentary#property-behavior):<br>- *solo escritura* si `type` está establecido en "Secret macro"<br>- *obligatorio* para operaciones de creación|
|type|integer|Tipo de macro.<br><br>Valores posibles:<br>0 - *(predeterminado)* Macro de texto;<br>1 - Secret macro;<br>2 - Secreto de Vault.|
|description|string|Descripción de la macro.|

[comment]: # ({/2f5f2156-e654cd12})

[comment]: # ({c73e8f15-5a3a9f9f})
### Macro de host

El objeto macro de host define una macro disponible en un host, host prototype o template. Tiene las siguientes propiedades.

|Property|[Type](/manual/api/reference_commentary#data-types)|Description|
|--|--|------|
|hostmacroid|ID|ID de la macro de host.<br><br>[Property behavior](/manual/api/reference_commentary#property-behavior):<br>- *read-only*<br>- *required* for update operations|
|hostid|ID|ID del host al que pertenece la macro.<br><br>[Property behavior](/manual/api/reference_commentary#property-behavior):<br>- *constant*<br>- *required* for create operations|
|macro|string|Cadena de macro.<br><br>[Property behavior](/manual/api/reference_commentary#property-behavior):<br>- *required* for create operations|
|value|string|Valor de la macro.<br><br>[Property behavior](/manual/api/reference_commentary#property-behavior):<br>- *write-only* if `type` is set to "Secret macro"<br>- *required* for create operations|
|type|integer|Tipo de macro.<br><br>Possible values:<br>0 - *(default)* Text macro;<br>1 - Secret macro;<br>2 - Vault secret.|
|description|string|Descripción de la macro.|
|automatic|integer|Define si la macro está controlada por una regla de descubrimiento.<br><br>Possible values:<br>0 - *(default)* Macro is managed by user;<br>1 - Macro is managed by discovery rule.<br><br>User is not allowed to create automatic macro.<br>To update automatic macro, it must be [converted to manual](/manual/api/reference/usermacro/update#change-macro-value-that-was-created-by-discovery-rule).|

[comment]: # ({/c73e8f15-5a3a9f9f})
