Title: Add redirection via API
Last modified: January 2, 2024

---

# Add redirection via API

 *  Resolved [cosmins](https://wordpress.org/support/users/cosmins/)
 * (@cosmins)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/add-redirection-via-api/)
 * Hey guys,
 * For some reason adding a redirection through such a link: [https://smartstars.ro/wp-json/redirection/v1/redirect](https://smartstars.ro/wp-json/redirection/v1/redirect)
   simply doesn’t work – the response shows all redirections but doesn’t add them.
 * The body payload is:
 * {“id”:0,”url”:”/test”,”title”:””,”match_data”:{“source”:{“flag_regex”:false,”
   flag_trailing”:true,”flag_case”:true,”flag_query”:”exact”},”options”:{}},”match_type”:”
   url”,”action_type”:”url”,”position”:0,”group_id”:1,”action_code”:301,”action_data”:{“
   url”:”[https://google.com&#8221](https://google.com&#8221);}}
 * So I get a 200 response but it’s not adding the new redirect. How could I debug
   it? Am I missing smth?
 * Thank you!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fadd-redirection-via-api%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/add-redirection-via-api/#post-17312667)
 * You can find the developer documentation here:
 * [https://redirection.me/developer/rest-api/](https://redirection.me/developer/rest-api/)
 * You can also see what the plugin itself is doing in requests – it uses the API.
 *  Thread Starter [cosmins](https://wordpress.org/support/users/cosmins/)
 * (@cosmins)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/add-redirection-via-api/#post-17312823)
 * I’ve been taking the same body params as what the plugin uses but I don’t get
   the same results – with the plugin I get it inserted while through the API I 
   only get it to show the items and not the actual record added.
 * Also I’m authentificating via Application Passwords, could this be the cause 
   somehow?
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/add-redirection-via-api/#post-17312875)
 * The plugin uses the standard WordPress REST API and does no authentication itself–
   this is all provided by WordPress. I cannot say if there is anything else you
   need to do for application passwords and this is not something the plugin is 
   involved with.
 * If you make an identical request to the plugin then you will get an identical
   result. If you don’t then your request is not the same.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Add redirection via API’ is closed to new replies.

 * ![](https://ps.w.org/redirection/assets/icon-256x256.jpg?rev=983639)
 * [Redirection](https://wordpress.org/plugins/redirection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/redirection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/redirection/)
 * [Active Topics](https://wordpress.org/support/plugin/redirection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redirection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redirection/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [John Godley](https://wordpress.org/support/users/johnny5/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/add-redirection-via-api/#post-17312875)
 * Status: resolved