API

Reassigning API Keys

Gigantics makes it easy to change which API keys are assigned to an endpoint without disrupting your existing integrations. When you reassign keys, the endpoint URL remains unchanged, ensuring that any systems or clients already using the endpoint continue to work seamlessly.

Why Reassign Keys?

There are several common scenarios where you might need to reassign API keys to an endpoint:

  • Key Rotation: Replace old keys with new ones during security updates
  • Access Management: Grant or revoke access for specific teams or partners
  • Key Consolidation: Consolidate multiple keys into fewer, better-managed ones
  • Emergency Revocation: Quickly remove compromised keys while maintaining service

Endpoint URL Stability

The most important thing to understand about reassigning API keys is that the endpoint URL never changes. Whether you assign one key or ten, remove keys, or swap keys entirely, the endpoint URL remains consistent.

Initial assignment:
https://yourserver/api/org/proj/model/1/dataset/42?api_key=old-key-123

After reassigning different keys:
https://yourserver/api/org/proj/model/1/dataset/42?api_key=new-key-456
                                      ?
                         Same URL path, different key

This means:

  • ? Your API integrations continue working (they just need updated keys)
  • ? You don't need to update documentation or configurations
  • ? The endpoint itself is preserved and stable
  • ? Changing keys doesn't affect the underlying dataset or pipeline

How Reassignment Works

Step-by-Step Process

  1. Navigate to the endpoint: Go to either:

    • Model ? Datasets and click the share icon (??) on a dataset
    • Model ? Pipelines and click the share icon (??) on a pipeline
  2. Open the assignment modal: The modal shows all available API keys in your project

  3. Change your selection:

    • Click "Assign" to add a key to the endpoint
    • Click "Assigned" to remove a key from the endpoint
    • You can select multiple keys at once
  4. Confirm: Click "Confirm" to save your changes

What Happens Behind the Scenes

When you reassign keys, Gigantics performs a smooth update:

┌─────────────────────────────────────────────────────────────┐
│ Before Reassignment                                         │
├─────────────────────────────────────────────────────────────┤
│ Endpoint: /api/org/proj/model/1/dataset/42                  │
│ Assigned Keys:                                              │
│   │ production-key-2024                                     │
│   │ backup-key-2024                                         │
└─────────────────────────────────────────────────────────────┘

                    │ You change to:

┌─────────────────────────────────────────────────────────────┐
│ After Reassignment                                          │
├─────────────────────────────────────────────────────────────┤
│ Endpoint: /api/org/proj/model/1/dataset/42                  │
│ Assigned Keys:                                              │
│   │ production-key-2025                                     │
│   │ partner-key-acme                                        │
└─────────────────────────────────────────────────────────────┘

                    │ Endpoint URL stays the same │
                    │ Old keys stop working       │
                    │ New keys start working      │

Immediate UI Updates

When you reassign keys, the interface updates immediately without requiring a page refresh:

API Keys Page Updates

On the Project ? API Keys page, each key shows which endpoints it can access. When you reassign keys:

  • ? Keys that gain access immediately show the new endpoint in their list
  • ? Keys that lose access immediately see the endpoint removed from their list
  • ? The changes are reflected instantly across all views

Dataset and Pipeline Pages

On dataset and pipeline pages:

  • ? The endpoint information updates to show current key assignments
  • ? No duplicate endpoints are created
  • ? The endpoint URL displayed remains consistent

Key Rotation Example

Here's a practical example of rotating keys without service interruption:

Day 1: Initial Setup

You have one production key assigned to your dataset endpoint:

  • Endpoint: /api/org/proj/model/1/dataset/42
  • Assigned Key: prod-key-2024

Day 2: Add New Key

You create a new key and assign both old and new:

  • Endpoint: /api/org/proj/model/1/dataset/42 (same URL)
  • Assigned Keys:
    • prod-key-2024 (old)
    • prod-key-2025 (new)

Both keys work during this transition period.

Day 3: Update Clients

You update all your clients to use the new key. The old key still works as a backup.

Day 4: Remove Old Key

Once all clients are migrated, you reassign to remove the old key:

  • Endpoint: /api/org/proj/model/1/dataset/42 (same URL)
  • Assigned Keys:
    • prod-key-2025 (new)

The old key stops working, but the endpoint URL never changed, so your integrations remain intact.

Best Practices

Graceful Key Rotation

  1. Create the new key first before removing the old one
  2. Assign both keys to the endpoint during transition
  3. Update clients gradually while both keys are active
  4. Monitor usage to ensure all clients have migrated
  5. Remove the old key only after migration is complete

Access Management

  • Assign descriptive purposes to keys (e.g., "Partner A - Q1 2025") to track reassignments
  • Review assignments regularly to ensure keys are still needed
  • Document key changes in your internal tracking systems
  • Use multiple keys for different purposes rather than sharing a single key

Emergency Scenarios

If a key is compromised:

  1. Reassign immediately to remove the compromised key
  2. Keep other keys active to maintain service
  3. Create a replacement key and assign it
  4. Notify affected parties to update their integrations

The endpoint URL remains unchanged, so clients only need to update their API key, not their integration code.

Troubleshooting

"My endpoint disappeared after reassigning"

The endpoint URL is stable, but if you've removed all keys from an endpoint, you'll need to assign at least one key again. The endpoint itself isn't deleted?it just needs an active key assignment.

"Old keys still work after reassigning"

After reassigning keys, old keys stop working immediately. If old keys still work, check:

  • Did you actually click "Confirm" in the modal?
  • Are you testing with the correct endpoint URL?
  • Is there a caching issue in your client application?

"The endpoint list isn't updating"

The UI updates immediately after reassignment. If you don't see changes:

  • Refresh the page (though it shouldn't be necessary)
  • Check that you have the correct permissions (ManageAPIKeys)
  • Verify you're looking at the correct project