Title: REST API create redirect example
Last modified: February 16, 2023

---

# REST API create redirect example

 *  Resolved [theheartypixel](https://wordpress.org/support/users/theheartypixel/)
 * (@theheartypixel)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/rest-api-create-redirect-example/)
 * Hi there, we would like to use the REST API to create vanity URL redirects in
   a small Javascript application we are creating, and we saw your API documentation
   found here: [https://redirection.me/developer/rest-api/](https://redirection.me/developer/rest-api/)
   
   Does the data need to be POST as JSON? Can you provide a Javascript code snippet
   showing how to use the REST API to create a simple redirect with a source and
   target URL? We appreciate any help you can provide.

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

 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/rest-api-create-redirect-example/#post-16478135)
 * It uses the WordPress REST API so you can use it in anyway that it supports. 
   WordPress is pretty flexible how data is sent, and the plugin does nothing special
   to change this.
 * [https://developer.wordpress.org/rest-api/](https://developer.wordpress.org/rest-api/)
 * I don’t have any specific examples. The plugin uses the same API from JS so maybe
   inspecting network requests and replicating that would be the quickest route.
 *  Thread Starter [theheartypixel](https://wordpress.org/support/users/theheartypixel/)
 * (@theheartypixel)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/rest-api-create-redirect-example/#post-16478287)
 * Ah, thank you! We’ll give this a go.

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

The topic ‘REST API create redirect example’ 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/)

 * 2 replies
 * 2 participants
 * Last reply from: [theheartypixel](https://wordpress.org/support/users/theheartypixel/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/rest-api-create-redirect-example/#post-16478287)
 * Status: resolved