API Documentation
Sales Website
  • Introduction
  • Authentication
  • Errors
  • Pagination
  • Rate Limits
  • API reference
    • Account
    • Host
    • Link
    • Redirect
    • Workspace
      • Subscription
  • Specification
Powered by GitBook
On this page
  1. API reference

Redirect

PreviousLinkNextWorkspace

Get details about a specific redirect by id

get
Authorizations
Path parameters
idstring · stringRequired

redirect id

Example: 1639562002248499321
Responses
200
success
application/json
get
GET /v1/redirect/{id} HTTP/1.1
Host: api.redirhub.com
Authorization: YOUR_API_KEY
Accept: */*
200

success

{
  "id": "72288a61-034e-4596-80c9-88751cf0a937",
  "host": "www.example.com",
  "url": "www.example.com",
  "file": "www.example.com/*",
  "https": true,
  "destination": "https://www.google.com",
  "destinations": "[]",
  "type": "301",
  "status": "active",
  "forward_path": false,
  "forward_query": false,
  "created_at": "2023-11-15T15:09:14.000000Z",
  "updated_at": "2023-11-15T15:09:14.000000Z"
}

delete redirect

delete
Authorizations
Path parameters
idstring · stringRequired

redirect id

Example: 1639562002248499321
Responses
200
success
application/json
delete
DELETE /v1/redirect/{id} HTTP/1.1
Host: api.redirhub.com
Authorization: YOUR_API_KEY
Accept: */*
200

success

{
  "data": null
}
  • GETlist of redirects
  • POSTcreate redirect
  • GETGet details about a specific redirect by id
  • PUTupdate redirect
  • DELETEdelete redirect

list of redirects

get

Get all redirects

Authorizations
Responses
200
success
application/json
get
GET /v1/redirect HTTP/1.1
Host: api.redirhub.com
Authorization: YOUR_API_KEY
Accept: */*
200

success

{
  "data": [
    {
      "id": "72288a61-034e-4596-80c9-88751cf0a937",
      "host": "www.example.com",
      "url": "www.example.com",
      "file": "www.example.com/*",
      "https": true,
      "destination": "https://www.google.com",
      "destinations": "[]",
      "type": "301",
      "status": "active",
      "forward_path": false,
      "forward_query": false,
      "created_at": "2023-11-15T15:09:14.000000Z",
      "updated_at": "2023-11-15T15:09:14.000000Z"
    }
  ]
}

create redirect

post
Authorizations
Body
urlstringOptional

URL

Example: www.example.com
destinationstringOptional

Destination URL

Example: https://www.google.com
destinationsarray[string]Optional

More Destinations

Example: []
typestringOptional

Type

Example: 301
forward_pathbooleanOptional

whether forwarding slug to destination

Example: false
forward_querybooleanOptional

whether forwarding query params to destination

Example: false
Responses
200
success
application/json
post
POST /v1/redirect HTTP/1.1
Host: api.redirhub.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 140

{
  "url": "www.example.com",
  "destination": "https://www.google.com",
  "destinations": "[]",
  "type": "301",
  "forward_path": false,
  "forward_query": false
}
200

success

{
  "data": null
}

update redirect

put
Authorizations
Path parameters
idstring · stringRequired

redirect id

Example: 1639562002248499321
Body
urlstringOptional

URL

Example: www.example.com
destinationstringOptional

Destination URL

Example: https://www.google.com
destinationsarray[string]Optional

More Destinations

Example: []
typestringOptional

Type

Example: 301
forward_pathbooleanOptional

whether forwarding slug to destination

Example: false
forward_querybooleanOptional

whether forwarding query params to destination

Example: false
Responses
200
success
application/json
put
PUT /v1/redirect/{id} HTTP/1.1
Host: api.redirhub.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 140

{
  "url": "www.example.com",
  "destination": "https://www.google.com",
  "destinations": "[]",
  "type": "301",
  "forward_path": false,
  "forward_query": false
}
200

success

{
  "data": null
}