Prescrypto Medics API

Medic (prescriber) accounts managed by an admin/manager token.

OpenAPI Specification

prescrypto-medics-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Prescrypto Integration Hospitals Medics API
  version: '2.0'
  description: 'REST API for the Prescrypto electronic-prescription (eRx) platform used across Mexico and LATAM. It lets integrated systems (EHRs, hospital software, telemedicine apps and pharmacies) manage medics, hospitals, patients and prescriptions, generate legally-valid electronic prescriptions (verified against NOM-151-SCFI-2016 via the RexChain blockchain notary), download prescription PDFs, and let pharmacies search and dispense (burn) prescribed medications. All responses are JSON. Authentication uses HTTP Token auth (Authorization: Token <key>); keys are issued through direct communication with Prescrypto.'
  contact:
    name: Prescrypto
    url: https://www.prescrypto.com/contact/
  x-apis-json-provenance:
    generated: '2026-07-20'
    method: generated
    source: github.com/wilsotobianco/prescrypto-docs (official Prescrypto API docs) + Prescrypto_Integration_Endpoints_V2 Postman collection (s3-us-west-2.amazonaws.com/precript-collections)
servers:
- url: https://integration.prescrypto.com
  description: Production integration API (documented base URL)
security:
- TokenAuth: []
tags:
- name: Medics
  description: Medic (prescriber) accounts managed by an admin/manager token.
paths:
  /api/v2/medics/:
    get:
      operationId: listMedics
      tags:
      - Medics
      summary: List medics
      description: List the medic users created under the calling admin/manager token. Supports the created_filter and email query filters.
      parameters:
      - name: email
        in: query
        schema:
          type: string
        description: Filter by medic email.
      - name: created_filter
        in: query
        schema:
          type: string
        description: Return the full list of created users.
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/Offset'
      responses:
        '200':
          description: Paginated list of medics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedMedics'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createMedic
      tags:
      - Medics
      summary: Create a medic
      description: Create a new medic user, optionally attached to a hospital. Save the returned id and token fields, which are only returned on creation.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MedicCreate'
      responses:
        '201':
          description: Medic created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Medic'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /api/v2/medics/{medic_id}/:
    parameters:
    - name: medic_id
      in: path
      required: true
      schema:
        type: integer
    get:
      operationId: getMedic
      tags:
      - Medics
      summary: Get medic by id
      responses:
        '200':
          description: Medic detail
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Medic'
        '404':
          $ref: '#/components/responses/NotFound'
    patch:
      operationId: updateMedic
      tags:
      - Medics
      summary: Update medic fields (also used to deactivate an account)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Medic'
      responses:
        '200':
          description: Medic updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Medic'
        '400':
          $ref: '#/components/responses/BadRequest'
  /api/v2/profile/:
    get:
      operationId: getProfile
      tags:
      - Medics
      summary: View the authenticated medic profile
      responses:
        '200':
          description: Profile detail
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Medic'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /api/v2/profile/update/:
    patch:
      operationId: updateProfile
      tags:
      - Medics
      summary: Update the authenticated medic profile
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Medic'
      responses:
        '200':
          description: Profile updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Medic'
components:
  schemas:
    Hospital:
      type: object
      properties:
        id:
          type: integer
        patron:
          type: string
          description: Hospital / clinic name.
        location:
          type: string
    SimpleError:
      type: object
      description: Prescrypto error envelope. Errors carry either an "error" or a "message" field.
      properties:
        error:
          type: string
        message:
          type: string
        status:
          type: string
    Medic:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        email:
          type: string
        token:
          type: string
          description: API token — returned only on creation.
        hospital:
          $ref: '#/components/schemas/Hospital'
    MedicCreate:
      type: object
      required:
      - name
      - email
      properties:
        name:
          type: string
        email:
          type: string
        hospital:
          type: integer
          description: Hospital id to attach the medic to (optional).
    PaginatedMedics:
      type: object
      properties:
        count:
          type: integer
        next:
          type: string
          nullable: true
        previous:
          type: string
          nullable: true
        results:
          type: array
          items:
            $ref: '#/components/schemas/Medic'
  responses:
    BadRequest:
      description: Bad request — malformed or missing required parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SimpleError'
    Unauthorized:
      description: Authentication failed or invalid token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SimpleError'
    NotFound:
      description: The requested resource could not be found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SimpleError'
  parameters:
    Limit:
      name: limit
      in: query
      schema:
        type: integer
      description: Number of results to return per page.
    Offset:
      name: offset
      in: query
      schema:
        type: integer
      description: The initial index from which to return results.
  securitySchemes:
    TokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'HTTP Token auth. Send: Authorization: Token <your-key>. Keys are issued by Prescrypto via direct communication.'
    JWTAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'JWT auth for the standard-drug (products) endpoint. Send: Authorization: JWT <token>.'