API Key Management

GET /api/v1/api-keyRetrieves information about the authenticated API key. Use the list_all=true query parameter to list all API keys for the organization (requires a root API key).HEADER PARAMETERS
REQUIREDX-Scrubs-Clinic-Api-Keystring
Your API key for authentication.
REQUIREDX-Scrubs-Clinic-Providerstring
Provider ID associated with your EHR application.
QUERY PARAMETERS
OPTIONALlist_allstring
Optional. Set to "true" to list all API keys for the organization. Requires a root API key.
Domain
BASE URL
1https://usescrubs.com
Sample Request
CURL
Node.JS
Python
Go
CURL
1curl --location --request GET 'https://usescrubs.com/api/v1/api-key' \
2--header 'X-Scrubs-Clinic-Api-Key: your_api_key_here' \
3--header 'X-Scrubs-Clinic-Provider: your_provider_id'
4
5# To list all API keys (requires root key):
6curl --location --request GET 'https://usescrubs.com/api/v1/api-key?list_all=true' \
7--header 'X-Scrubs-Clinic-Api-Key: your_root_api_key_here' \
8--header 'X-Scrubs-Clinic-Provider: your_provider_id'
Sample Response
JSON
1{
2  "id": "key_123456789",
3  "friendly_name": "Clinic Main API Key",
4  "created": "2024-01-15T10:30:00Z",
5  "clinic_id": "00A123",
6  "usage_limit": 1000,
7  "root": false
8}
POST /api/v1/api-keyCreates a new API key for a clinic. This endpoint requires a root API key and will automatically create an anonymous clinic if one doesn't exist for the specified clinic ID.HEADER PARAMETERS
REQUIREDX-Scrubs-Clinic-Api-Keystring
Your API key for authentication.
REQUIREDX-Scrubs-Clinic-Providerstring
Provider ID associated with your EHR application.
BODY PARAMETERS
REQUIREDclinic_idstring
The clinic identification code for the clinic that will use this API key.
REQUIREDfriendly_namestring
A human-readable name for the API key.
OPTIONALusage_limitnumber
Optional. The maximum number of API calls allowed. Defaults to 5 if not specified.
Domain
BASE URL
1https://usescrubs.com
Sample Request
CURL
NodeJS
Python
Go
CURL
1curl --location --request POST 'https://usescrubs.com/api/v1/api-key' \
2--header 'X-Scrubs-Clinic-Api-Key: your_root_api_key_here' \
3--header 'X-Scrubs-Clinic-Provider: your_provider_id' \
4--header 'Content-Type: application/json' \
5--data '{
6  "clinic_id": "00A123",
7  "friendly_name": "New Clinic API Key",
8  "usage_limit": 100
9}'
Sample Response
JSON
1{
2  "apiKey": "sk_live_123456789abcdef",
3  "friendly_name": "New Clinic API Key",
4  "created": "2024-01-25T09:15:00Z",
5  "clinic_id": "00A123",
6  "usage_limit": 100,
7  "root": false
8}
PUT /api/v1/api-keyUpdates an existing API key. Root keys can update subkeys and themselves, but cannot update other root keys. Subkeys cannot update any keys.HEADER PARAMETERS
REQUIREDX-Scrubs-Clinic-Api-Keystring
Your API key for authentication.
REQUIREDX-Scrubs-Clinic-Providerstring
Provider ID associated with your EHR application.
BODY PARAMETERS
REQUIREDidstring
The ID of the API key to update.
OPTIONALfriendly_namestring
Optional. New friendly name for the API key.
OPTIONALusage_limitnumber
Optional. New usage limit for the API key.
Domain
BASE URL
1https://usescrubs.com
Sample Request
CURL
NodeJS
Python
Go
CURL
1curl --location --request PUT 'https://usescrubs.com/api/v1/api-key' \
2--header 'X-Scrubs-Clinic-Api-Key: your_root_api_key_here' \
3--header 'X-Scrubs-Clinic-Provider: your_provider_id' \
4--header 'Content-Type: application/json' \
5--data '{
6  "id": "key_123456789",
7  "friendly_name": "Updated Clinic API Key",
8  "usage_limit": 1500
9}'
Sample Response
JSON
1{
2  "id": "key_123456789",
3  "friendly_name": "Updated Clinic API Key",
4  "created": "2024-01-15T10:30:00Z",
5  "clinic_id": "00A123",
6  "usage_limit": 1500,
7  "root": false
8}
DELETE /api/v1/api-keyDeletes an API key. This endpoint requires a root API key and will permanently remove the specified API key.HEADER PARAMETERS
REQUIREDX-Scrubs-Clinic-Api-Keystring
Your API key for authentication.
REQUIREDX-Scrubs-Clinic-Providerstring
Provider ID associated with your EHR application.
QUERY PARAMETERS
REQUIREDidstring
The ID of the API key to delete.
Domain
BASE URL
1https://usescrubs.com
Sample Request
CURL
NodeJS
Python
Go
CURL
1curl --location --request DELETE 'https://usescrubs.com/api/v1/api-key?id=key_123456789' \
2--header 'X-Scrubs-Clinic-Api-Key: your_root_api_key_here' \
3--header 'X-Scrubs-Clinic-Provider: your_provider_id'
Sample Response
JSON
1{
2  "message": "API key deleted successfully"
3}
Contact us: support@usescrubs.com