Introducing Programmatic Redirect URIs

The Nylas API now makes it easy to manage customer subdomains with programmatic redirect of URIs.

Tasia Potasinski | November 25, 2019

When new customers sign-up for your platform and you generate a unique URI for them, it can help improve the customer onboarding experience if you can programmatically create redirect URIs for those customers.

Take Slack for example. All Slack users have unique slack URLs to access the app on the web, following a structure like With programmatic redirect URIs on Nylas, all Nylas customers can automatically generate redirect URIs each time they’d like to provision a new customer.

Want a PDF of this article?

Share it with a friend or save it for later reading.

How? Let’s take a look.

First, if you’d like to simply see your current redirect URIs (and other application info), you can do this by making a GET call to the `a/{client_id}/` endpoint.

curl -X GET "" \

-H "Content-Type: application/json" \

-H "Authorization: Basic mysUp3RS3crEtCl1EntS3crET="


The client_id is the ID of your Nylas developer application and the authorization is the client secret, passed in as an HTTP Basic Auth username.

curl -X PUT "" \

-H "Content-Type: application/json" \

-d '{

    "application_name": "My New App Name",

    "redirect_uris": [







Next, in order to update the URIs, make a PUT call to the a/{client_id}endpoint.

The authorization for this endpoint follows the same pattern as other account management endpoints, so the authorization is the client secret, passed in as an HTTP Basic Auth username.

The application_name  parameter is optional and will update the app’s name. If this field is omitted, no changes will be made to the application name. 

The redirect_uris parameter takes an array of strings; each string is a single redirect_uri for the application. Keep in mind that this is a PUT call, so you will need to include every redirect URI each time you update, rather than just adding a single redirect URI at a time. For example, in the code snippet above, if you had one redirect URI to start: http://localhost:5555/login_callback and wanted to add both localhost and, you will need to pass all three strings to the array as shown. 

Sign up today to get a free API key and try it out, or if you’re already a customer, test out the new features and let us know what you think!

Tasia Potasinski

Tasia is the Director of Product Marketing at Nylas. She's passionate about communications and helping connect the world through APIs. In her free time, she writes and produces music.