{"openapi":"3.1.0","info":{"title":"Blueberry Pharmacy Patient-Authorized Actions","version":"1.0.0","description":"Public submission-only interface for capable agents. Permission is an attestation, not identity verification. Pharmacy review remains required. No patient records or prescription status are available."},"servers":[{"url":"/","description":"Same origin as this document; use HTTPS on the published site."}],"paths":{"/api/agent/v1/refill":{"post":{"operationId":"requestPrescriptionRefill","summary":"Request a refill for pharmacy review","description":"Requires explicit permission for this exact submission. No identity verification or dispensing approval. Do not retry with a different key when delivery is uncertain.","x-openai-isConsequential":true,"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Random UUID or similar random key, unique to one approved action. Never include patient information. Reuse the identical key and JSON for retries within seven days.","schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9_-]{16,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["authorization","request"],"properties":{"authorization":{"type":"object","additionalProperties":false,"required":["confirmed","authority"],"description":"Attestation only, not identity verification. Obtain explicit permission for this exact submission before sending.","properties":{"confirmed":{"type":"boolean","const":true},"authority":{"type":"string","enum":["patient","authorized_representative"]}}},"agent":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":100}}},"request":{"type":"object","additionalProperties":false,"required":["firstName","lastName","email","dateOfBirth","medications","deliveryPreference"],"properties":{"firstName":{"type":"string","minLength":1,"maxLength":500},"lastName":{"type":"string","minLength":1,"maxLength":500},"email":{"type":"string","minLength":1,"maxLength":320,"format":"email"},"phone":{"type":"string","minLength":0,"maxLength":30},"dateOfBirth":{"type":"string","minLength":1,"maxLength":20,"description":"Use MM/DD/YYYY as on the patient form; Unknown is permitted for a pet with unknown DOB. Do not invent information."},"medications":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","minLength":1,"maxLength":500},"description":"Prescription numbers or medication names provided by the patient."},"deliveryPreference":{"type":"string","enum":["pickup","delivery"]},"address":{"type":["object","null"],"additionalProperties":false,"required":["streetAddress","city","zipCode"],"properties":{"streetAddress":{"type":"string","minLength":1,"maxLength":500},"streetAddress2":{"type":"string","minLength":0,"maxLength":500},"city":{"type":"string","minLength":1,"maxLength":500},"zipCode":{"type":"string","pattern":"^\\d{5}(?:-\\d{4})?$"}}}},"allOf":[{"if":{"properties":{"deliveryPreference":{"const":"delivery"}},"required":["deliveryPreference"]},"then":{"required":["address"],"properties":{"address":{"type":"object"}}}}]}}},"example":{"authorization":{"confirmed":true,"authority":"patient"},"agent":{"name":"Example assistant"},"request":{"firstName":"Example","lastName":"Patient","email":"patient@example.test","dateOfBirth":"01/02/1990","medications":["Rx# EXAMPLE-NOT-REAL"],"deliveryPreference":"pickup","address":null}}}}},"responses":{"200":{"description":"forwarded: successful response from the notification endpoint, or a replay of that receipt. Not confirmation of clinical review or readiness.","headers":{"Retry-After":{"description":"Seconds to wait, when processing or rate limited.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionResult"}}}},"400":{"description":"invalid_request: correct the fields and obtain permission again if changing the proposed submission.","headers":{"Retry-After":{"description":"Seconds to wait, when processing or rate limited.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionResult"}}}},"403":{"description":"authorization_required: obtain explicit permission before submission.","headers":{"Retry-After":{"description":"Seconds to wait, when processing or rate limited.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionResult"}}}},"409":{"description":"key_conflict: key already used for different content; or processing: wait and retry the identical key/body.","headers":{"Retry-After":{"description":"Seconds to wait, when processing or rate limited.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionResult"}}}},"413":{"description":"invalid_request: body exceeds the 64 KB limit; do not bulk-submit.","headers":{"Retry-After":{"description":"Seconds to wait, when processing or rate limited.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionResult"}}}},"429":{"description":"rate_limited: honor Retry-After. Shared-IP limit includes browser and agent attempts, including retries.","headers":{"Retry-After":{"description":"Seconds to wait, when processing or rate limited.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionResult"}}}},"503":{"description":"not_attempted or delivery_unknown: follow the returned guidance. Unknown outcomes must not be automatically resubmitted through any route.","headers":{"Retry-After":{"description":"Seconds to wait, when processing or rate limited.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionResult"}}}}}}},"/api/agent/v1/contact":{"post":{"operationId":"contactPharmacy","summary":"Send a message to the pharmacy","description":"Requires explicit permission for this exact submission. No identity verification or dispensing approval. Do not retry with a different key when delivery is uncertain.","x-openai-isConsequential":true,"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Random UUID or similar random key, unique to one approved action. Never include patient information. Reuse the identical key and JSON for retries within seven days.","schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9_-]{16,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["authorization","request"],"properties":{"authorization":{"type":"object","additionalProperties":false,"required":["confirmed","authority"],"description":"Attestation only, not identity verification. Obtain explicit permission for this exact submission before sending.","properties":{"confirmed":{"type":"boolean","const":true},"authority":{"type":"string","enum":["patient","authorized_representative"]}}},"agent":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":100}}},"request":{"type":"object","additionalProperties":false,"required":["name","email","message"],"properties":{"name":{"type":"string","minLength":1,"maxLength":500},"email":{"type":"string","minLength":1,"maxLength":320,"format":"email"},"phone":{"type":"string","minLength":0,"maxLength":30},"message":{"type":"string","minLength":1,"maxLength":2000},"urgent":{"type":"boolean","default":false,"description":"Priority flag only, not a guarantee of immediate response. Not an emergency service."}}}}},"example":{"authorization":{"confirmed":true,"authority":"authorized_representative"},"agent":{"name":"Example assistant"},"request":{"name":"Example Patient","email":"patient@example.test","message":"Fictional example: please contact me about a routine pharmacy question.","urgent":false}}}}},"responses":{"200":{"description":"forwarded: successful response from the notification endpoint, or a replay of that receipt. Not confirmation of clinical review or readiness.","headers":{"Retry-After":{"description":"Seconds to wait, when processing or rate limited.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionResult"}}}},"400":{"description":"invalid_request: correct the fields and obtain permission again if changing the proposed submission.","headers":{"Retry-After":{"description":"Seconds to wait, when processing or rate limited.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionResult"}}}},"403":{"description":"authorization_required: obtain explicit permission before submission.","headers":{"Retry-After":{"description":"Seconds to wait, when processing or rate limited.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionResult"}}}},"409":{"description":"key_conflict: key already used for different content; or processing: wait and retry the identical key/body.","headers":{"Retry-After":{"description":"Seconds to wait, when processing or rate limited.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionResult"}}}},"413":{"description":"invalid_request: body exceeds the 64 KB limit; do not bulk-submit.","headers":{"Retry-After":{"description":"Seconds to wait, when processing or rate limited.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionResult"}}}},"429":{"description":"rate_limited: honor Retry-After. Shared-IP limit includes browser and agent attempts, including retries.","headers":{"Retry-After":{"description":"Seconds to wait, when processing or rate limited.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionResult"}}}},"503":{"description":"not_attempted or delivery_unknown: follow the returned guidance. Unknown outcomes must not be automatically resubmitted through any route.","headers":{"Retry-After":{"description":"Seconds to wait, when processing or rate limited.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionResult"}}}}}}}},"components":{"schemas":{"SubmissionResult":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"type":"string","enum":["forwarded","invalid_request","authorization_required","key_conflict","processing","not_attempted","delivery_unknown","rate_limited"]},"receipt":{"type":"string","format":"uuid"},"replayed":{"type":"boolean"},"message":{"type":"string"},"error":{"type":"string"},"fields":{"type":"array","maxItems":20,"items":{"type":"string"}}}}}}}