Redirects

Create a new redirect. Specify the target host by hostId or hostName.

post/v1/redirects/

Request

  • Base URL: https://api.redirectboss.com
  • URL: https://api.redirectboss.com/v1/redirects/
  • Auth: API key in header X-Api-Key

Request body

hostIdstring uuid

UUID of the host to associate this redirect with. Either hostId or hostName is required.

hostNamestring hostname

Domain name of the host (e.g. "example.com"). Used as an alternative to hostId: the host will be looked up by name. Either hostId or hostName is required.

matchType'host' | 'exact' | 'prefix' required

How to match incoming requests: "host" matches any request to the domain, "exact" matches an exact path, "prefix" matches any path starting with the given prefix

pathstring http-path nullable

Required for "exact" and "prefix" match types, forbidden for "host" match type. Must start with /

destinationUrlstring redirect-url required

Target URL for the redirect. Must be a valid HTTP/HTTPS URL with a proper hostname.

statusCode301 | 302 | 303 | 307 required

HTTP status code for the redirect (301=permanent, 302/303/307=temporary)

preserveQueryStringboolean

Forward the original query string to the destination URL

appendPathboolean

Append the original request path to the destination URL. Useful with "host" match type to forward all paths.

descriptionstring nullable

Optional note or label for this redirect

Response

Default Response

Changes

No recorded changes to this operation across all 1 revision of this API.