πŸ”‘Getting API Keys

API Keys are the β€œpower tools” of DevPayr. You don’t have to use them β€” but if you want deeper control, automation, or backend-level access to your project, an API key is your best friend.

If License Keys are your app’s ID card, API Keys are your admin pass: they unlock more abilities, more flexibility, and more integrations.

Let’s walk through everything you need to know.

🧠 What Are API Keys?

An API Key is a secure credential that allows your backend or external systems to interact with DevPayr programmatically.

With an API key, you can:

  • Create or list licenses

  • Fetch license details

  • Suspend or reactivate licenses

  • Manage project domains

  • Handle injectables

  • Access project metadata

  • Use service classes in SDKs

  • Automate workflows and internal tools

But here’s the important part:

⚠️ API Keys are optional. You only need them if you want to perform extra operations beyond simply validating a license. License validation can work on its own with just the License Key.

πŸ•Ή When Should You Use an API Key?

Use an API Key if:

  • You’re building dashboards, admin tools, or internal automation

  • You want your backend to create/update licenses

  • You need to check payment status programmatically

  • You want to upload or fetch injectables

  • You have advanced DevOps or CI/CD workflows

  • You want access to DevPayr SDK service classes (projects, domains, payments, etc.)

Do not use an API key if:

  • You only need license validation

  • You’re calling from the frontend (API keys must stay private!)

  • You don’t need programmatic control

πŸ› οΈ How to Generate an API Key

Follow these steps inside your DevPayr dashboard:

1. In the sidebar, click β€œAPI Keys”

The API Keys page lists all keys you’ve created so far.

2. Click β€œCreate New Key”

This opens the creation form.

3. Choose which project the key belongs to

  • Select Attach to Project β†’ choose a specific project

  • Or leave it as Global Key if your plan supports global keys

A project-scoped key can only act within one project. A global key can operate across all your projects.

4. Select the Scopes for this key

Scopes define exactly what the key is allowed to do.

Examples include:

  • Read projects

  • List licenses

  • Create licenses

  • Manage domains

  • Manage injectables

  • Access payments

  • Update project configurations

Think of scopes like permission levels β€” give the key only what it needs, nothing more.

πŸ’‘ Tip: If a contractor only needs to read license information, give them a read-only scope. No need to grant them β€œfull empire control.”

5. (Optional) Set an Expiration Date

Expiration dates are extremely useful when:

  • Giving temporary access to teammates

  • Working with contractors

  • Running short-term integrations

  • Testing API workflows

If you leave it empty, the key never expires (until you revoke it).

6. Click β€œCreate” and copy your key

Once generated:

  • Store the key securely

  • Never expose it in public code

  • Never use it in frontend environments

  • Rotate or revoke it when no longer needed

πŸ”’ API Key Security Best Practices

  • Never expose API keys in JavaScript, browser code, or HTML

  • Store them in environment variables on your server

  • Rotate them regularly if used by third parties

  • Use scopes to limit abilities

  • Use expiration dates for temporary access

  • Treat them like real credentials β€” because they are

πŸ›‘ If someone gets your API key, they can act on your behalf. Please don’t let β€œsomeone” be your frontend users.

πŸŽ‰ You Now Have an API Key

With your API key ready:

  • You can now use service classes in the SDKs

  • You can automate license management

  • You can build integrations, dashboards, or admin tools

  • You can access advanced project-level features

Last updated