canonical: https://jentic.com/apis/swaggerhub.alayacare/external-medications

# Alayacare External Medications

swaggerhub.alayacare/api-medication-external version 1.2.0. The API exposes 9 endpoints secured with basic authentication.

## For AI agents

Programmatically create a new medication for a specific client, fetch a list of medications by client. Covers 9 operations with basic authentication.

## Scope

Does not handle payments, communications, or crm - use for developer tools only.

## Capabilities

- Create a new medication for a specific client
- Fetch a list of medications by client
- Update a medication status
- Query and filter External Medications records by parameters
- Monitor External Medications operational status and events

## Use cases

### Developer Tools Operations

Use the External Medications to perform developer tools operations programmatically. The API provides 9 endpoints covering core functionality including create a new medication for a specific client, fetch a list of medications by client, create a new medication for a specific client.

Example prompt: Call POST /client/{client_id}/medications to create a new medication for a specific client

### Automated Client Management

Automate client operations by combining multiple External Medications endpoints. Agents can fetch a list of medications by client and then create a new medication for a specific client in a single workflow.

Example prompt: Call GET /client/{client_id}/medications to fetch a list of medications by client, then verify the result

### AI Agent Integration via Jentic

AI agents discover and call External Medications endpoints through Jentic without managing credentials directly. An agent searches for the required operation by intent, receives the matching endpoint schema, and executes the call with Jentic-managed authentication. This eliminates the need to read API documentation or handle basic tokens manually.

Example prompt: Search Jentic for 'create a new medication for a specific client', load the operation schema, and execute with Jentic-managed credentials

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /client/{client_id}/medications | Create a new medication for a specific client |
| GET | /client/{client_id}/medications | Fetch a list of medications by client |
| POST | /client/by_id/{external_client_id}/medications | Create a new medication for a specific client |
| GET | /client/by_id/{external_client_id}/medications | Fetch a medication by external client id |
| GET | /medications/{medication_id} | Fetch a medication by id |
| POST | /medications/{medication_id}/change_status/{new_status} | Update a medication status |
| GET | /medication_settings/{branch_id} | Fetch the list of medication settings for a given branch_id |
| GET | /medication_settings/{branch_id}/{type} | Fetch a list of medication settings for given branch_id and type |

## Key resources

- **Client** — Operations for client
- **Medication_Settings** — Operations for medication_settings
- **Medications** — Operations for medications

## Why Jentic

- **Setup:** Wiring External Medications by hand means setting up its HTTP basic auth over https and calling client medication operations yourself against the AlayaCare Canada clinical host, including status changes and branch settings. Through Jentic you install once, import External Medications from the API Directory, store the basic credential once, and your agent calls it.
- **Permission scoping:** External Medications puts the client id and medication id in the URL path (/client/{client_id}/medications, /medications/{medication_id}), so a rule can pin your agent to one client's medications: it can read them and nothing else. You choose the operations it may call, so ones that change state like medication creation or change status are not included unless you add them.
- **Credential handling:** Your External Medications basic credential is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create a medication for a client' or 'read a medication by id', and Jentic returns the matching External Medications operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Github** — Alternative developer tools API
- **Gitlab** — Alternative developer tools API

## FAQ

### What authentication does the External Medications use?

The External Medications uses HTTP Basic authentication with username and password. Through Jentic, these credentials are stored encrypted in your Jentic One instance and injected at execution time, so raw secrets never enter the agent context.

### Can I create a new medication for a specific client with the External Medications?

Yes. Use the POST /client/{client_id}/medications endpoint. The API returns structured JSON responses that agents can parse and act on directly.

### What are the rate limits for the External Medications?

Rate limits are not specified in the OpenAPI spec. Check the vendor documentation for current limits. Through Jentic, rate limiting is handled automatically with retry logic built into the execution layer.

### How do I create a new medication for a specific client through Jentic?

Install the Jentic SDK with pip install jentic, authenticate through Jentic One, the self-hosted execution layer, then search for 'create a new medication for a specific client'. Jentic returns the matching External Medications operation with its input schema. Load the schema and execute the call - credentials are injected automatically.

### How many endpoints does the External Medications have?

The External Medications exposes 9 endpoints covering client, medication_settings, medications operations.

### Can I limit what my agent is allowed to do with the External Medications API?

Yes. Jentic One is self-hosted, so your own rules decide which External Medications operations and credentials the agent may use. Because the client id and medication id sit in the URL path, such as /client/{client_id}/medications and /medications/{medication_id}, you can pin the agent to a single client's medications and grant read-only access with GET while withholding the state-changing calls. Operations like POST creation and the change-status endpoint stay off limits unless you explicitly add them.
