> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apps.filed.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deep links

> Generate deep links to redirect tax firm users to Filed

Deep links allow you to seamlessly redirect tax firm users to Filed. These links can be used at any time to send users from a specific tax firm to their workspace and specific pages within Filed.

## Base URL

```
https://app.filed.com/sign-in
```

## Format

**Recommended approach**: Use the workspace slug to ensure customers are routed to the correct workspace:

```
https://app.filed.com/sign-in?deep_link=/w/{workspaceSlug}/<restofthepath>
```

**Convenience option**: If you don't have the workspace slug available, you can use `/w/redirect/` instead:

```
https://app.filed.com/sign-in?deep_link=/w/redirect/<restofthepath>
```

<Warning>
  **Important**: Always use the workspace slug format (`/w/{workspaceSlug}/`) when available to ensure customers are directed to the correct workspace. This prevents routing errors and ensures proper workspace isolation.
</Warning>

<Note>
  The convenience option (`/w/redirect/`) automatically routes users to the correct workspace based on their authentication. However, using the workspace slug is the recommended approach for reliability.
</Note>

## Parameters

<ParamField query="deep_link" type="string" required>
  The path within Filed to redirect users to. Must be URL-encoded.

  **Format options:**

  * `/w/{workspaceSlug}/<restofthepath>` - Recommended: Explicitly routes to a specific workspace
  * `/w/redirect/<restofthepath>` - Convenience: Routes based on user authentication

  **Examples:**

  * `/w/smith-associates-tax-firm` - Workspace dashboard
  * `/w/smith-associates-tax-firm/connect/tax-software` - Tax software connection page
  * `/w/redirect/connect/tax-software` - Tax software connection (convenience format)
</ParamField>

## Common Redirect Paths

### Tax Software Connection Page

Redirect tax firm users to set up tax software connections.

**Recommended (with workspace slug):**

```
https://app.filed.com/sign-in?deep_link=/w/{workspaceSlug}/connect/tax-software
```

**Example:**

```
https://app.filed.com/sign-in?deep_link=/w/smith-associates-tax-firm/connect/tax-software
```

**Convenience option (without workspace slug):**

```
https://app.filed.com/sign-in?deep_link=/w/redirect/connect/tax-software
```

### Tax Prep Page

Redirect to a specific tax preparation.

**Recommended (with workspace slug):**

```
https://app.filed.com/sign-in?deep_link=/w/{workspaceSlug}/taxpreps/{taxPrepId}/files
```

**Example:**

```
https://app.filed.com/sign-in?deep_link=/w/smith-associates-tax-firm/taxpreps/prep_123456/files
```

**Convenience option (without workspace slug):**

```
https://app.filed.com/sign-in?deep_link=/w/redirect/taxpreps/{taxPrepId}/files
```

### Workspace Dashboard

Redirect to the main workspace dashboard.

**Recommended (with workspace slug):**

```
https://app.filed.com/sign-in?deep_link=/w/{workspaceSlug}
```

**Example:**

```
https://app.filed.com/sign-in?deep_link=/w/smith-associates-tax-firm
```

**Convenience option (without workspace slug):**

```
https://app.filed.com/sign-in?deep_link=/w/redirect
```

## Example

<RequestExample>
  ```javascript JavaScript theme={null}
  // Recommended: Generate deep link with workspace slug
  function generateDeepLink(workspaceSlug, path = '') {
    const baseUrl = 'https://app.filed.com/sign-in';
    const deepLink = path 
      ? `/w/${workspaceSlug}${path}`
      : `/w/${workspaceSlug}`;
    
    return `${baseUrl}?deep_link=${encodeURIComponent(deepLink)}`;
  }

  // Convenience option: Generate deep link without workspace slug (using redirect)
  function generateDeepLinkRedirect(path = '') {
    const baseUrl = 'https://app.filed.com/sign-in';
    const deepLink = path 
      ? `/w/redirect${path}`
      : `/w/redirect`;
    
    return `${baseUrl}?deep_link=${encodeURIComponent(deepLink)}`;
  }

  // Example usage (recommended - with workspace slug)
  const workspaceSlug = 'smith-associates-tax-firm';
  const integrationLink = generateDeepLink(workspaceSlug, '/connect/tax-software');
  const taxPrepLink = generateDeepLink(workspaceSlug, '/taxpreps/prep_123456/files');
  const dashboardLink = generateDeepLink(workspaceSlug);

  console.log('Integration Link:', integrationLink);
  console.log('Tax Prep Link:', taxPrepLink);
  console.log('Dashboard Link:', dashboardLink);

  // Example usage (convenience - without workspace slug)
  // Only use this if you don't have the workspace slug available
  const integrationLinkRedirect = generateDeepLinkRedirect('/connect/tax-software');
  ```

  ```python Python theme={null}
  from urllib.parse import quote

  # Recommended: Generate deep link with workspace slug
  def generate_deep_link(workspace_slug, path=''):
      base_url = 'https://app.filed.com/sign-in'
      deep_link = f'/w/{workspace_slug}{path}' if path else f'/w/{workspace_slug}'
      return f'{base_url}?deep_link={quote(deep_link)}'

  # Convenience option: Generate deep link without workspace slug
  def generate_deep_link_redirect(path=''):
      base_url = 'https://app.filed.com/sign-in'
      deep_link = f'/w/redirect{path}' if path else '/w/redirect'
      return f'{base_url}?deep_link={quote(deep_link)}'

  # Example usage
  workspace_slug = 'smith-associates-tax-firm'
  integration_link = generate_deep_link(workspace_slug, '/connect/tax-software')
  tax_prep_link = generate_deep_link(workspace_slug, '/taxpreps/prep_123456/files')
  dashboard_link = generate_deep_link(workspace_slug)
  ```
</RequestExample>

## Notes

* Deep links can be generated at any time and don't expire
* Always URL-encode the `deep_link` parameter
* Tax firm users will be prompted to sign in if not already authenticated
* Use the workspace slug format when available for reliable routing
* The convenience option (`/w/redirect/`) relies on user authentication to route to the correct workspace

## Troubleshooting

**Problem**: Deep links not redirecting correctly

**Solutions**:

* **Always use workspace slug format** (`/w/{workspaceSlug}/`) when available to ensure correct routing
* Verify the workspace slug corresponds to the correct tax firm customer
* Ensure `deep_link` parameter is properly URL-encoded
* Check that the path exists in Filed's application
* Double-check that you're using the correct workspace slug for each tax firm customer
