Redirections

Quick Start

Get up and running with the Redirections API in under 30 minutes.

Quick Start

Get up and running with the Redirections API in under 30 minutes.

Prerequisites

  • An active account (if you don't have one, sign up first)
  • Basic familiarity with REST APIs and cURL or HTTP clients

Step 1: Create a Project (via Dashboard)

  1. Navigate to the Dashboard at your account homepage
  2. Click "New Project" button
  3. Enter a project name (e.g., "My Website Redirects")
  4. Click "Create"
  5. Note your Project ID - you'll see it in the project URL and settings

Time: ~2 minutes

Your Project ID is a unique identifier you'll use in all API requests. Keep it handy!

Step 2: Add Redirect Rules (via Dashboard)

  1. Open your newly created project
  2. Click "Add Rule" or "New Redirect" button
  3. Configure your first redirect:
    • Source Path: /blog/old-post
    • Destination Path: /articles/new-post
    • Status Code: 301 (Permanent Redirect)
    • Match Type: Exact
  4. Click "Save" to add the rule
  5. Repeat to add more redirect rules as needed

Time: ~5 minutes

Exact matches are checked first with O(1) lookup speed. Prefix matches are checked in priority order.

Step 3: Generate API Key (via Dashboard)

  1. Navigate to your project Settings tab
  2. Find the "API Keys" section
  3. Click "Generate API Key" or "Create New Key"
  4. Copy the key immediately (format: redir_live_...)
  5. Store it securely - you won't be able to see it again

Time: ~2 minutes

API keys are shown only once. If you lose your key, you'll need to generate a new one.

Step 4: Deploy Configuration (via Dashboard)

  1. Look for the "Deploy" button in your project (usually at the top right)
  2. Click "Deploy" to push your configuration to the edge
  3. Wait for deployment status to show "Live" (typically 60-90 seconds)
  4. Your redirects are now active globally at edge locations

Time: ~2 minutes

Deployments propagate to 300+ edge locations worldwide. First deploy may take up to 90 seconds.

Step 5: Test API Query (via Terminal)

Now test your redirect lookup with a cURL command. Replace the placeholder values:

  • YOUR_PROJECT_ID - Your project ID from Step 1
  • YOUR_API_KEY - The API key you generated in Step 3
curl -X GET "https://api.3xx.app/v1/lookup?project=YOUR_PROJECT_ID&path=/blog/old-post" \
  -H "X-API-Key: YOUR_API_KEY"

Expected Response (200 OK):

{
  "destination": "/articles/new-post",
  "statusCode": 301,
  "matchType": "exact"
}

If the path has no redirect configured, you'll receive a 204 No Content response with an empty body.

Time: ~5 minutes

Success! You've completed your first redirect lookup. The API responded from the nearest edge location with sub-50ms latency.

Step 6: Integrate into Your Application

Choose your programming language and follow the integration guide:

Each guide includes copy-paste ready code examples with error handling.

Time: ~10-15 minutes

Next Steps

Now that you have the API working, explore these resources:


Total Time: ~30 minutes

You now have a working redirect lookup API integrated into your application!