Hi @anon37139604,
You are correct, portfolios can have custom fields set on them, and while it’s not documented, one can get those values (more on that in this forum thread).
While I didn’t try it, I thought it might also be possible to set those custom field values. Did you try that, using an equivalent syntax as one uses to set the custom field value on a task or project?