P
Pharmako
Pricing
Docs
Docs/Authentication

On this page

  • Overview
  • API Keys
  • OAuth 2.0
  • JWT Tokens
  • Scopes & Permissions
  • Best Practices
Security

Authentication

Secure your API requests with industry-standard authentication methods. Pharmako supports API keys, OAuth 2.0, and JWT tokens.

Overview

All API requests to Pharmako require authentication. We support multiple authentication methods to fit your integration needs:

API Keys

Simple authentication for server-to-server integrations

OAuth 2.0

User-authorized access for third-party applications

JWT Tokens

Short-lived tokens for enhanced security

API Keys

API keys are the simplest way to authenticate requests. Include your API key in the Authorization header:

curl -X GET "https://api.pharmako.dev/v1/patients" \
  -H "Authorization: Bearer pk_live_xxxxxxxxxxxxx" \
  -H "Content-Type: application/json"

Keep your API keys secure

Never expose API keys in client-side code or public repositories. Use environment variables to store keys securely.

OAuth 2.0

For applications that need to access data on behalf of users, implement OAuth 2.0 authorization:

1

Redirect to Authorization URL

https://auth.pharmako.dev/oauth/authorize
2

User Grants Permission

User reviews requested scopes and approves access

3

Exchange Code for Token

POST https://auth.pharmako.dev/oauth/token
4

Access API with Token

Use the access token in the Authorization header

JWT Tokens

JWT tokens provide short-lived access with automatic expiration. Token structure:

{
  "sub": "user_123456",
  "org": "org_789012", 
  "scope": ["patients:read", "labs:write"],
  "iat": 1699000000,
  "exp": 1699003600
}

Tokens expire after 1 hour. Use the refresh token to obtain new access tokens.

Scopes & Permissions

Control access with granular scopes:

ScopeDescription
patients:readRead patient records
patients:writeCreate/update patients
labs:readRead lab results
labs:writeSubmit lab orders
webhooks:manageConfigure webhooks

Best Practices

Use environment variables for API keys
Rotate keys regularly (every 90 days recommended)
Use the minimum required scopes
Implement token refresh before expiration
Monitor API usage for anomalies
Enable IP allowlisting for production keys
QuickstartAPI Reference
P
Pharmako

Powering the future of healthcare with modern API infrastructure.

TwitterGitHubLinkedIn

Product

  • Overview
  • Features
  • Pricing
  • Changelog
  • Documentation

Developers

  • API Reference
  • SDKs
  • Webhooks
  • Status
  • Community

Company

  • About
  • Blog
  • Careers
  • Press
  • Contact

Legal

  • Privacy
  • Terms
  • Security
  • HIPAA

© 2025 Pharmako, Inc. All rights reserved.

All systems operational