Skip to main content

Overview

AudioPod AI supports two authentication methods:
  • API Key: Use X-API-Key header (recommended for servers)
  • JWT Token: Use Authorization: Bearer {token} header (for sessions)

Registration

Step 1: Initiate Registration

curl -X POST "https://api.audiopod.ai/api/v1/auth/initiate-registration" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "SecurePass123",
    "full_name": "Developer Name"
  }'
Response:
{
  "message": "Verification code sent to your email. Please check your inbox."
}

Step 2: Verify Email

curl -X POST "https://api.audiopod.ai/api/v1/auth/verify-registration" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "verification_code": "123456"
  }'
Response:
{
  "user": {
    "id": "uuid",
    "email": "[email protected]",
    "full_name": "Developer Name",
    "is_verified": true
  },
  "access_token": "eyJhbGciOiJIUzI1NiIs...",
  "refresh_token": "eyJhbGciOiJIUzI1NiIs...",
  "token_type": "bearer",
  "expires_in": 3600
}

Login

curl -X POST "https://api.audiopod.ai/api/v1/auth/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "[email protected]&password=SecurePass123"
Response: Same as verify-registration.

API Keys

Create API Key

Use JWT token from login/registration:
curl -X POST "https://api.audiopod.ai/api/v1/auth/api-keys" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "production-key",
    "scopes": ["*"],
    "expires_in_days": null
  }'
Response:
{
  "id": "key-uuid",
  "name": "production-key",
  "api_key": "ap_xxxxxxxxxxxxxxxx",
  "scopes": ["*"],
  "created_at": "2025-01-01T00:00:00Z",
  "expires_at": null
}
The api_key is only shown once. Save it immediately!

List API Keys

curl -X GET "https://api.audiopod.ai/api/v1/auth/api-keys" \
  -H "X-API-Key: $AUDIOPOD_API_KEY"

Revoke API Key

curl -X DELETE "https://api.audiopod.ai/api/v1/auth/api-keys/{key_id}" \
  -H "X-API-Key: $AUDIOPOD_API_KEY"

Password Reset

Request Reset

curl -X POST "https://api.audiopod.ai/api/v1/auth/forgot-password" \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]"}'

Confirm Reset

curl -X POST "https://api.audiopod.ai/api/v1/auth/reset-password" \
  -H "Content-Type: application/json" \
  -d '{
    "token": "reset_token_from_email",
    "new_password": "NewSecurePass123"
  }'

Token Refresh

curl -X POST "https://api.audiopod.ai/api/v1/auth/refresh" \
  -H "Content-Type: application/json" \
  -d '{"refresh_token": "eyJhbGciOiJIUzI1NiIs..."}'

Get Current User

curl -X GET "https://api.audiopod.ai/api/v1/auth/me" \
  -H "X-API-Key: $AUDIOPOD_API_KEY"
Response:
{
  "id": "uuid",
  "email": "[email protected]",
  "full_name": "Developer Name",
  "is_verified": true,
  "created_at": "2025-01-01T00:00:00Z"
}

Errors

CodeErrorDescription
401invalid_credentialsWrong email or password
401token_expiredAccess token expired
400email_already_registeredEmail already in use
400invalid_verification_codeWrong or expired code
429rate_limit_exceededToo many requests

Quick Reference

EndpointMethodAuthDescription
/auth/initiate-registrationPOSTNoneStart registration
/auth/verify-registrationPOSTNoneVerify email
/auth/tokenPOSTNoneLogin
/auth/refreshPOSTNoneRefresh token
/auth/forgot-passwordPOSTNoneRequest reset
/auth/reset-passwordPOSTNoneConfirm reset
/auth/meGETRequiredGet user info
/auth/api-keysGETRequiredList API keys
/auth/api-keysPOSTRequiredCreate API key
/auth/api-keys/{id}DELETERequiredRevoke API key