Authentication

Learn how to authenticate with the AIDP Platform API.

Overview

AIDP uses JWT (JSON Web Tokens) for authentication. All API requests require a valid API key or JWT token.

Authentication Flow

JWT Authentication Flow

Getting an API Key

1. Sign Up

Create an account at platform.aidp.devarrow-up-right

2. Generate API Key

  1. Navigate to SettingsAPI Keys

  2. Click Create New API Key

  3. Give it a descriptive name (e.g., "Production API")

  4. Copy the key immediately (it won't be shown again)

  5. Store securely (never commit to version control)

3. Use API Key

Include in the Authorization header:

API Key Types

Test Keys

For development and testing:

Characteristics:

  • Access to sandbox environment

  • No real charges

  • Rate limited (100 req/hour)

  • Test data only

Live Keys

For production use:

Characteristics:

  • Access to production environment

  • Real charges apply

  • Higher rate limits

  • Real data

Authentication Methods

Simple and secure for server-to-server communication.

TypeScript:

Python:

cURL:

2. JWT Tokens

For user-specific authentication (web/mobile apps).

Login:

Response:

Use Token:

3. OAuth 2.0

For third-party integrations.

Authorization URL:

Exchange Code for Token:

Token Refresh

Access tokens expire after 1 hour. Use refresh tokens to get new ones:

Response:

Scopes

Control access with OAuth scopes:

Scope
Description

read:businesses

Read business profiles

write:businesses

Create/update profiles

read:bookings

View bookings

write:bookings

Create/manage bookings

read:analytics

Access analytics data

read:reviews

View reviews

write:reviews

Submit reviews

Example:

Security Best Practices

Storing API Keys

Do:

  • Use environment variables

  • Use secret management services (AWS Secrets Manager, HashiCorp Vault)

  • Rotate keys regularly

  • Use different keys for dev/staging/prod

Don't:

  • Commit keys to version control

  • Hardcode in source code

  • Share keys via email/chat

  • Use same key across environments

Example (.env):

Example (code):

Key Rotation

Rotate API keys regularly:

  1. Generate new key

  2. Update applications with new key

  3. Test thoroughly

  4. Revoke old key

Monitoring

Monitor API key usage:

  • Track requests per key

  • Set up alerts for unusual activity

  • Review access logs regularly

Error Handling

401 Unauthorized

Causes:

  • Missing Authorization header

  • Invalid API key

  • Expired token

  • Revoked key

Solution:

  • Check API key is correct

  • Ensure header is included

  • Refresh expired tokens

  • Generate new key if revoked

403 Forbidden

Causes:

  • Missing required scope

  • Account suspended

  • Resource access denied

Solution:

  • Check OAuth scopes

  • Verify account status

  • Ensure proper permissions

Rate Limiting

API keys have rate limits based on plan:

Plan
Rate Limit

Free

100 req/hour

Professional

1,000 req/hour

Enterprise

10,000 req/hour

Headers:

Learn more about rate limiting →

Examples

TypeScript/JavaScript

Python

cURL

Testing

Sandbox Environment

Test authentication without affecting production:

Postman Collection

Import our Postman collection for easy testing:

Support

Need help with authentication?

Next Steps

Last updated