Catch up on highlights from Firebase at Google I/O 2023. Learn more

Create Dynamic Links with the REST API

You can create short Dynamic Links with the Firebase Dynamic Links REST API. This API accepts either a long Dynamic Link or an object containing Dynamic Link parameters, and returns a URL like the following example:

Short Dynamic Links created with the API and client (Android/Apple) SDK do not show up in the Firebase console. Such Dynamic Links are intended for user-to-user sharing. For marketing use cases, continue to create your links directly through the Dynamic Links page of the Firebase console.

Before you begin

  1. Get your API key. You will need an API key to authenticate your requests to the API. To find your API key:
    1. Open the Settings page of the Firebase console. If you are prompted to choose a project, select your Firebase project from the menu.
    2. Take note of the value of the Web API Key field.
  2. In the Firebase console, open the Dynamic Links section.
  3. If you have not already accepted the terms of service and set a domain for your Dynamic Links, do so when prompted.

    If you already have a Dynamic Links domain, take note of it. You need to provide a Dynamic Links domain when you programmatically create Dynamic Links.

You can use the Firebase Dynamic Links API to shorten a long Dynamic Link. To do so, make an HTTP POST request to the shortLinks endpoint, specifying the long Dynamic Link in the longDynamicLink parameter. For example:

Content-Type: application/json

   "longDynamicLink": ""

See Manually construct a URL to learn how to create long Dynamic Links.

You can also create a short Dynamic Link by specifying the Dynamic Link parameters directly. To do so, make an HTTP POST request to the shortLinks endpoint, specifying the Dynamic Link parameters in the dynamicLinkInfo parameter. For example:

Content-Type: application/json

  "dynamicLinkInfo": {
    "domainUriPrefix": "",
    "link": "",
    "androidInfo": {
      "androidPackageName": ""
    "iosInfo": {
      "iosBundleId": "com.example.ios"

For a complete specification of the dynamicLinkInfo object, see the API reference.

Set the length of a short Dynamic Link

You can also set the suffix parameter to specify how the path component of the short Dynamic Link is generated.

By default, or if you set the parameter to "UNGUESSABLE", the path component will be a 17-character string, such as in the following example:

Such strings are created by base62-encoding randomly generated 96-bit numbers. Use this setting to prevent your Dynamic Links URLs from being guessed and crawled, which can potentially expose sensitive information to unintended recipients.

If you set the parameter to "SHORT", the path component will be a string that is only as long as needed to be unique, with a minimum length of 4 characters.

Use this method if sensitive information would not be exposed if a short Dynamic Link URL were guessed.

The following example shows how you can set the suffix parameter:

Content-Type: application/json

   "longDynamicLink": "",
   "suffix": {
     "option": "UNGUESSABLE"

At minimum, the deep-link value provided must begin with http:// or https:// schemes. It must also match any URL patterns whitelist entered in the console. Else, the creation API will fail with HTTP error code 400.

Next steps

Now that you've created Dynamic Links, you need to set up your app to receive Dynamic Links and send users to the right place in your app after a user opens them.

To receive Dynamic Links in your app, see the documentation for iOS, Android, C++, and Unity.

Requests are limited to 5 requests/IP address/second, and 200,000 requests/day. If exceeded, then the response will return HTTP error code 429. To request for more quota, fill out this form.