Getting a Host Custom Attribute in a custom Special Agent

I’m trying to develop a custom special agent to pull alerts from an api endpoint on various target services.
I’m open to other options, but the special agent technique seems to be the cleanest way for our particular needs as the api will return a list of services and their statuses.

We cannot rely on the host’s dns name to determine the url to access the api endpoint at as there may be multiple targets on the same hostname with different api paths. We’d like to use a custom host attribute to provide the needed url, as setting a host specific rule for each host is notably more labor intensive than just using a custom attribute.

Is there a way to reference the value of a custom attribute of a host in either the special agent or in the checks referencing it? Since it’s used to get the response from the api, I presume it needs to be in the special_agent_info parameters.

Thank you,