Create a Redirect
helpcenter_create_redirectSend an old path of the help center ('from') on to one of its pages ('to') with a 301, for as long as nothing else on the help center answers that path. A path that already has a redirect is re-pointed, never duplicated.
Works once the user has claimed the help center, verified their email address and activated a plan; until then it answers capability_locked with the user's next step (helpcenter_get_help_center shows it too).
The target must be a published page of this help center, given as its path: a redirect to another site is refused (external_target_forbidden), and so is one to a page that does not exist or is still a draft (target_not_found). Also refused: a path no visitor's request could reach (source_not_redirectable — for example a one-segment path like '/pricing', which the help center reads as a language), a loop (redirect_loop), and a chain of more than 3 redirects (too_many_hops).
For many redirects at once, use helpcenter_bulk_create_redirects.
Args:
from (string, required): like '/hc/en-us/articles/360001-Billing'.
to (string, required): like '/en/content/billing'.
Returns: { action: "created" | "updated", redirect: { id, from, to } }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Where it goes: a page of THIS help center, as a path like '/en/content/billing' (an agent key may not redirect to another site). | |
| from | Yes | A path of the old help center, like '/hc/en-us/articles/360001-Billing': no scheme or host, no query or fragment, not the home page. | |
| agent_key | Yes | The api_key helpcenter_create_help_center returned for this help center, exactly as returned. Required on every call: this endpoint has no sign-in, so the key is how each call says which help center it acts on. It is sent to HelpCenter.io as this call's credential and nowhere else, and it is never shown again: keep it for the whole task, and never show it to the user or write it into content. |