{"swagger":"2.0","info":{"version":"1.0","title":"1upHealth API Collection - All endpoints","contact":{}},"host":"api.1up.health","basePath":"/","securityDefinitions":{},"schemes":["https"],"consumes":["application/json"],"produces":["application/json"],"paths":{"/user-management/v1/user":{"post":{"description":"An application can create users via the following call. You will need to replace clientid and clientsecret with the values you obtained when you registered and created your 1upHealth application (visit https://1up.health/dev/quick-start).\n\nEach response will contain the new user's oneup_user_id, access_token, refresh_token, and app_user_id. The app_user_id helps you keep track of users between the 1up API and your own user management system. This must be a unique value for your application.","summary":"Create New User","tags":["Auth"],"operationId":"CreateNewUser","deprecated":false,"produces":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"},{"name":"app_user_id","in":"query","required":true,"type":"string","description":""},{"name":"client_id","in":"query","required":true,"type":"string","description":""},{"name":"client_secret","in":"query","required":true,"type":"string","description":""}],"responses":{"200":{"description":"","headers":{}}}},"get":{"description":"Get the list of all the users that exist inside your 1up Developer Application, with the option of filtering by specific users","summary":"Get Users","tags":["User Management"],"operationId":"GetUsers","deprecated":false,"produces":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"},{"name":"oneup_user_id","in":"query","required":true,"type":"integer","format":"int32","description":""},{"name":"client_id","in":"query","required":true,"type":"string","description":""},{"name":"client_secret","in":"query","required":true,"type":"string","description":""}],"responses":{"200":{"description":"","headers":{}}}},"put":{"description":"Can be used to modify an existing user object. It is possible to modify the app_user_id, but the oneup_user_id is assigned when the user is created and cannot be changed.","summary":"Update User","tags":["User Management"],"operationId":"UpdateUser","deprecated":false,"produces":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"},{"name":"oneup_user_id","in":"query","required":true,"type":"integer","format":"int32","description":""},{"name":"client_id","in":"query","required":true,"type":"string","description":""},{"name":"client_secret","in":"query","required":true,"type":"string","description":""},{"name":"app_user_id","in":"query","required":true,"type":"string","description":""}],"responses":{"200":{"description":"","headers":{}}}}},"/user-management/v1/user/auth-code":{"post":{"description":"If you need a new auth code for a user you already created on 1upHealth, you can make a request via the following method with clientid and clientsecret values replaced with your registered application's values via the environment variables in the upper right corner.\n\nThe code variable is the OAuth2 access code. You must exchange that to get the OAuth2 access token by following the the OAuth2 token grant steps. The access_token and refresh_token will be used to gain access to user data. Keep those secure via HIPAA compliant means of transmission and storage, along with all other patient data. The auth token expires after 7200 seconds (2 hours).","summary":"Generate New Authorization Code for Existing User","tags":["Auth"],"operationId":"GenerateNewAuthorizationCodeforExistingUser","deprecated":false,"produces":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"},{"name":"app_user_id","in":"query","required":true,"type":"string","description":""},{"name":"client_id","in":"query","required":true,"type":"string","description":""},{"name":"client_secret","in":"query","required":true,"type":"string","description":""}],"responses":{"200":{"description":"","headers":{}}}}},"/oauth2/token":{"post":{"description":"Use the following API call to exchange the OAuth Access Code received in \"1. Create New User\" or \"2. Generate New Auth Code for Existing User\".\n\nThe code variable is the OAuth2 access code. You must exchange that to get the OAuth2 access token by following the the OAuth2 token grant steps. The access_token and refresh_token will be used to gain access to user data. Keep those secure via HIPAA compliant means of transmission and storage, along with all other patient data. The auth token expires after 7200 seconds (2 hours).\n\nYou must also replace the values for clientid and clientsecret with values obtained when registering your application (visit https://1up.health/dev/quick-start).","summary":"Exchange Authorization Code for Access Token","tags":["Auth"],"operationId":"ExchangeAuthorizationCodeforAccessToken","deprecated":false,"produces":["application/json"],"consumes":["application/x-www-form-urlencoded"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"},{"name":"client_id","in":"formData","required":true,"type":"string","description":""},{"name":"client_secret","in":"formData","required":true,"type":"string","description":""},{"name":"code","in":"formData","required":true,"type":"string","description":""},{"name":"grant_type","in":"formData","required":true,"type":"string","description":""}],"responses":{"200":{"description":"","headers":{}}}}},"/r4":{"get":{"description":"An application can make a request to certain 1upHealth APIs with a bearer token which was created from executing the token endpoint above. This access token is safe to sit on the client side because its scope is limited to the user accessing it. However client secrets used to get the access token should remain on the server side. Available options are: dstu2, stu3, r4.","summary":"API Request via OAuth2 Bearer Token Authentication","tags":["Auth"],"operationId":"APIRequestviaOAuth2BearerTokenAuthentication","deprecated":false,"produces":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"}],"responses":{"200":{"description":"","headers":{}}}}},"/r4/Patient":{"post":{"description":"You will need to include your OAuth Access Token as a Bearer Token in the Authorization Header which you can store as an environment variables in the upper right corner. To obtain a Access Token, follow steps 1, 2, and 3 (if you are creating under a new user), or steps 2 and 3 (if creating under an existing user). Of if you have a Refresh Token you can follow Step 4.\n\nOnce you have your OAuth Access Token, you can make the following call to create a FHIR Resource (in this case a Patient resource, but you can also obtain other resources as listed here - https://1up.health/dev/reference/fhir-resources) by including the resource elements in the Body of the request","summary":"Create Patient Resource","tags":["Connect (Patient)"],"operationId":"CreatePatientResource","deprecated":false,"produces":["application/json"],"consumes":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"},{"name":"Content-Type","in":"header","required":true,"type":"string","description":""},{"name":"Body","in":"body","required":true,"description":"","schema":{"$ref":"#/definitions/CreatePatientResourceRequest"}}],"responses":{"200":{"description":"","headers":{}}}},"get":{"description":"You will need to include your OAuth Access Token as a Bearer Token in the Authorization Header. To obtain a Access Token, follow steps 1, 2, and 3 (if you are creating under a new user), or steps 2 and 3 (if creating under an existing user). Of if you have a Refresh Token you can follow Step 4.\n\nOnce you have your OAuth Access Token, you can make the following call to obtain a bundle of available FHIR Resources (in this case Patient, but you can also obtain other resources as listed here - https://1up.health/dev/reference/fhir-resources). You can also include https://api.1up.health/fhir/dstu2/Patient/{{resource_id}} when you know the resource id.","summary":"Get Patient Resource","tags":["Connect (Patient)"],"operationId":"GetPatientResource","deprecated":false,"produces":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"},{"name":"query-param","in":"query","required":true,"type":"string","description":""}],"responses":{"200":{"description":"","headers":{}}}}},"/{FHIRVersion}/Patient/{patientID}/$everything":{"get":{"description":"This endpoint returns a list of all known FHIR® resources for a given patient. This is useful when transmitting batch data or getting the full patient history.","summary":"Get all Patient data (everything query)","tags":["Connect (Patient)"],"operationId":"GetallPatientdata(everythingquery)","deprecated":false,"produces":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"},{"name":"FHIRVersion","in":"path","required":true,"type":"string","description":""},{"name":"patientID","in":"path","required":true,"type":"string","description":""}],"responses":{"200":{"description":"","headers":{}}}}},"/$everything":{"delete":{"description":"This endpoint returns an OperationOutcome resource stating that all the resources for the patient are deleted successfully. This is useful when deleting multiple resource types for a patient at once.","summary":"Delete all Patient data (everything query)","tags":["Connect (Patient)"],"operationId":"DeleteallPatientdata(everythingquery)","deprecated":false,"produces":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"}],"responses":{"200":{"description":"","headers":{}}}}},"/dstu2/Patient/patientid/_permission/123523788":{"put":{"description":"When making a request to the 1upHealth FHIR® API using a user's access_token, the resources returned will be scoped to only the resources that the user has permissions to view. However, sometimes when building an app you might want to support the ability for users to grant access to other users to see certain records. This endpoint allows you to grant access to resources to arbitrary users.","summary":"Grant Permission to User","tags":["User Permissions"],"operationId":"GrantPermissiontoUser","deprecated":false,"produces":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"},{"name":"oneup_user_id","in":"query","required":true,"type":"integer","format":"int32","description":""},{"name":"client_id","in":"query","required":true,"type":"string","description":""},{"name":"client_secret","in":"query","required":true,"type":"string","description":""}],"responses":{"200":{"description":"","headers":{}}}}},"/":{"get":{"description":"This endpoint allows you to remove permissions that have been granted to users to see other users' FHIR® resources.","summary":"Revoke Permission from User","tags":["User Permissions"],"operationId":"RevokePermissionfromUser","deprecated":false,"produces":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"}],"responses":{"200":{"description":"","headers":{}}}}},"/$export":{"get":{"description":"Request the analytics bulk-data endpoint with the FHIR® $export operator to retrieve a list of bulk data files for your client application to download.\n\nhttps://1up.health/dev/doc/fhir-bulk-data-export\n\nThis will return at least one bulk data download file for each resource type for which resources exist. This will only return resources that your given application client id and user id have access to. Optionally include a _type query parameter with a comma-separated list of FHIR® resources to limit the types of resources that you want to export, e.g.\n\nhttps://analytics.1up.health/bulk-data/dstu2/$export?_type=Patient,Observation","summary":"Bulk Data Export","tags":["Analytics (Bulk Data)"],"operationId":"BulkDataExport","deprecated":false,"produces":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"}],"responses":{"200":{"description":"","headers":{}}}}},"/search":{"post":{"description":"The Provider Search API can be used to make custom provider search interface for patients or retrieve results returned by the above iframe. Plug your access_token (Check out our Quick Start Guide - https://1up.health/dev/quick-start - on how to get access tokens) generated with the client_id and client_secret for the applicaton in the header as a Bearer Token and search term as a query parameter in the url.\n\nhttps://1up.health/dev/doc/provider-search-ui\n\nResult is a list a health systems, clinics, hospitals or doctors for the searched term with 1uphealth system id which can be used to direct an user to a quick connect page or a patient portal (using the same access token) to initiate the login process. Check out our Quick Connect Documentation on how to quick connect.","summary":"Provider Search API","tags":["Providers"],"operationId":"ProviderSearchAPI","deprecated":false,"produces":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"},{"name":"query","in":"query","required":true,"type":"string","description":""}],"responses":{"200":{"description":"","headers":{}}}}},"/connect/system/provider/search":{"get":{"description":"Used to run a text search on health systems, often for the purpose of allowing the user to find their health system's authorization portal.","summary":"Provider Search","tags":["Providers"],"operationId":"ProviderSearch","deprecated":false,"produces":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"},{"name":"query","in":"query","required":true,"type":"string","description":""},{"name":"query","in":"header","required":true,"type":"string","description":""}],"responses":{"200":{"description":"","headers":{}}}}},"/r4/Person":{"get":{"description":"This endpoint returns a list of all known FHIR resources for a given patient. This is useful when transmitting batch data or getting the full patient history.","summary":"Get FHIR Resources","tags":["FHIR Resources"],"operationId":"GetFHIRResources","deprecated":false,"produces":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"},{"name":"client_id","in":"query","required":true,"type":"string","description":""},{"name":"client_secret","in":"query","required":true,"type":"string","description":""}],"responses":{"200":{"description":"","headers":{}}}}},"/dstu2/Patient":{"post":{"description":"Used to create a FHIR® resource with a given type.","summary":"Create a FHIR Resource","tags":["FHIR Resources"],"operationId":"CreateaFHIRResource","deprecated":false,"produces":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"},{"name":"client_id","in":"query","required":true,"type":"string","description":""},{"name":"client_secret","in":"query","required":true,"type":"string","description":""},{"name":"Body","in":"body","required":true,"description":"","schema":{"$ref":"#/definitions/CreateaFHIRResourceRequest"}}],"responses":{"200":{"description":"","headers":{}}}}},"/connect/system/clinical":{"get":{"description":"Currently 1upHealth supports 1000s of health systems(https://1up.health/health-systems). You can find the full list by querying the endpoint here.\n\nYou will need the client_id and client_secret environment variables configured in the upper right corner.","summary":"Get All Connected Health Systems","tags":["Clinical"],"operationId":"GetAllConnectedHealthSystems","deprecated":false,"produces":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"},{"name":"client_id","in":"query","required":true,"type":"string","description":""},{"name":"client_secret","in":"query","required":true,"type":"string","description":""}],"responses":{"200":{"description":"","headers":{}}}}},"/stu3/DocumentReference":{"get":{"description":"This endpoint allows you to retrieve Document References.","summary":"Get Document Reference","tags":["Direct (EHR) Connect Reference"],"operationId":"GetDocumentReference","deprecated":false,"produces":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"}],"responses":{"200":{"description":"","headers":{}}}}},"/dstu2/Subscription":{"post":{"description":"Allows developers to \"subscribe\" to a query using a FHIR Subscription Resource. This means that you can be notified for a creation or update event for any FHIR Resource that matches a FHIR query. You can make the FHIR query anything acceptable by FHIR APIs. Periodically (currently in 15 minute intervals), 1upHealth will check for any new or updated resources matching any FHIR Subscription for a user and post that data to a secure endpoint of your choice.","summary":"Subscription","tags":["Subscription"],"operationId":"Subscription","deprecated":false,"produces":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"},{"name":"Body","in":"body","required":true,"description":"","schema":{"$ref":"#/definitions/SubscriptionRequest"}}],"responses":{"200":{"description":"","headers":{}}}}},"/fhir/dstu2/Practitioner":{"get":{"description":"This endpoint enables you to get available Practitioners.","summary":"Practitioner Search","tags":["Practitioners"],"operationId":"PractitionerSearch","deprecated":false,"produces":["application/json"],"parameters":[{"name":"Authorization","in":"header","required":false,"default":"Bearer {token}","type":"string"},{"name":"_public","in":"query","required":true,"type":"boolean","description":""},{"name":"name","in":"query","required":true,"type":"string","description":""}],"responses":{"200":{"description":"","headers":{}}}}}},"definitions":{"CreatePatientResourceRequest":{"title":"CreatePatientResourceRequest","example":{"resourceType":"Patient","id":"johnson","identifier":[{"use":"usual","type":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0203","code":"MR"}]},"system":"urn:oid:1.2.36.146.595.217.0.1","value":"4567890","period":{"start":"2001-05-06"},"assigner":{"display":"Acme Healthcare"}}],"active":true,"name":[{"use":"official","family":"Johnson","given":["Angela"]}],"telecom":[{"use":"home"},{"system":"phone","value":"(512) 123-4567","use":"home","rank":1},{"system":"email","value":"angela.johnson@email.com","use":"home"},{"system":"email","value":"angelaj@work.com","use":"work"}],"gender":"female","birthDate":"1986-09-28","deceasedBoolean":false,"address":[{"use":"home","type":"both","text":"789 Kahakee St. Apt 121 Honolulu, HI 97812","line":["789 Kahakee St. Apt 121"],"city":"Honolulu","state":"HI","postalCode":"97812"}]},"type":"object","properties":{"resourceType":{"type":"string"},"id":{"type":"string"},"identifier":{"type":"array","items":{"$ref":"#/definitions/Identifier"}},"active":{"type":"boolean"},"name":{"type":"array","items":{"$ref":"#/definitions/Name"}},"telecom":{"type":"array","items":{"$ref":"#/definitions/Telecom"}},"gender":{"type":"string"},"birthDate":{"type":"string"},"deceasedBoolean":{"type":"boolean"},"address":{"type":"array","items":{"$ref":"#/definitions/Address"}}},"required":["resourceType","id","identifier","active","name","telecom","gender","birthDate","deceasedBoolean","address"]},"Identifier":{"title":"Identifier","example":{"use":"usual","type":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0203","code":"MR"}]},"system":"urn:oid:1.2.36.146.595.217.0.1","value":"4567890","period":{"start":"2001-05-06"},"assigner":{"display":"Acme Healthcare"}},"type":"object","properties":{"use":{"type":"string"},"type":{"$ref":"#/definitions/Type"},"system":{"type":"string"},"value":{"type":"string"},"period":{"$ref":"#/definitions/Period"},"assigner":{"$ref":"#/definitions/Assigner"}},"required":["use","type","system","value","period","assigner"]},"Type":{"title":"Type","example":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0203","code":"MR"}]},"type":"object","properties":{"coding":{"type":"array","items":{"$ref":"#/definitions/Coding"}}},"required":["coding"]},"Coding":{"title":"Coding","example":{"system":"http://terminology.hl7.org/CodeSystem/v2-0203","code":"MR"},"type":"object","properties":{"system":{"type":"string"},"code":{"type":"string"}},"required":["system","code"]},"Period":{"title":"Period","example":{"start":"2001-05-06"},"type":"object","properties":{"start":{"type":"string"}},"required":["start"]},"Assigner":{"title":"Assigner","example":{"display":"Acme Healthcare"},"type":"object","properties":{"display":{"type":"string"}},"required":["display"]},"Name":{"title":"Name","example":{"use":"official","family":"Johnson","given":["Angela"]},"type":"object","properties":{"use":{"type":"string"},"family":{"type":"string"},"given":{"type":"array","items":{"type":"string"}}},"required":["use","family","given"]},"Telecom":{"title":"Telecom","example":{"use":"home"},"type":"object","properties":{"use":{"type":"string"},"system":{"type":"string"},"value":{"type":"string"},"rank":{"type":"integer","format":"int32"}},"required":["use"]},"Address":{"title":"Address","example":{"use":"home","type":"both","text":"789 Kahakee St. Apt 121 Honolulu, HI 97812","line":["789 Kahakee St. Apt 121"],"city":"Honolulu","state":"HI","postalCode":"97812"},"type":"object","properties":{"use":{"type":"string"},"type":{"type":"string"},"text":{"type":"string"},"line":{"type":"array","items":{"type":"string"}},"city":{"type":"string"},"state":{"type":"string"},"postalCode":{"type":"string"}},"required":["use","type","text","line","city","state","postalCode"]},"CreateaFHIRResourceRequest":{"title":"CreateaFHIRResourceRequest","example":{"resourceType":"Patient","id":"johnson","identifier":[{"use":"usual","type":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0203","code":"MR"}]},"system":"urn:oid:1.2.36.146.595.217.0.1","value":"4567890","period":{"start":"2001-05-06"},"assigner":{"display":"Acme Healthcare"}}],"active":true,"name":[{"use":"official","family":"Johnson","given":["Angela"]}],"telecom":[{"use":"home"},{"system":"phone","value":"(512) 123-4567","use":"home","rank":1},{"system":"email","value":"angela.johnson@email.com","use":"home"},{"system":"email","value":"angelaj@work.com","use":"work"}],"gender":"female","birthDate":"1986-09-28","deceasedBoolean":false,"address":[{"use":"home","type":"both","text":"789 Kahakee St. Apt 121 Honolulu, HI 97812","line":["789 Kahakee St. Apt 121"],"city":"Honolulu","state":"HI","postalCode":"97812"}]},"type":"object","properties":{"resourceType":{"type":"string"},"id":{"type":"string"},"identifier":{"type":"array","items":{"$ref":"#/definitions/Identifier"}},"active":{"type":"boolean"},"name":{"type":"array","items":{"$ref":"#/definitions/Name"}},"telecom":{"type":"array","items":{"$ref":"#/definitions/Telecom"}},"gender":{"type":"string"},"birthDate":{"type":"string"},"deceasedBoolean":{"type":"boolean"},"address":{"type":"array","items":{"$ref":"#/definitions/Address"}}},"required":["resourceType","id","identifier","active","name","telecom","gender","birthDate","deceasedBoolean","address"]},"SubscriptionRequest":{"title":"SubscriptionRequest","example":{"id":"a1dbd476-b706-418a-b93a-7a9cbdb9df72","resourceType":"Subscription","contact":[{"system":"email","value":"email@example.com"}],"criteria":"Observation?patient_id=","reason":"Get updates on a patient's Observations","status":"requested","channel":{"endpoint":"https://www.example.com/v1/hives/1b25ec53-7752-4cb2-8fad-72bec036771f/integrations/a1dbd476-b706-418a-b93a-7a9cbdb9df72/one_up/fhir/dstu2","payload":"application/json","type":"rest-hook","header":"Authorization: Bearer 8e2ff3b4f2395cdbac62a1ebb6beb821176618f7"}},"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"contact":{"type":"array","items":{"$ref":"#/definitions/Contact"}},"criteria":{"type":"string"},"reason":{"type":"string"},"status":{"type":"string"},"channel":{"$ref":"#/definitions/Channel"}},"required":["id","resourceType","contact","criteria","reason","status","channel"]},"Contact":{"title":"Contact","example":{"system":"email","value":"email@example.com"},"type":"object","properties":{"system":{"type":"string"},"value":{"type":"string"}},"required":["system","value"]},"Channel":{"title":"Channel","example":{"endpoint":"https://www.example.com/v1/hives/1b25ec53-7752-4cb2-8fad-72bec036771f/integrations/a1dbd476-b706-418a-b93a-7a9cbdb9df72/one_up/fhir/dstu2","payload":"application/json","type":"rest-hook","header":"Authorization: Bearer 8e2ff3b4f2395cdbac62a1ebb6beb821176618f7"},"type":"object","properties":{"endpoint":{"type":"string"},"payload":{"type":"string"},"type":{"type":"string"},"header":{"type":"string"}},"required":["endpoint","payload","type","header"]}},"tags":[{"name":"Auth"},{"name":"Connect (Patient)"},{"name":"User Management"},{"name":"User Permissions"},{"name":"Analytics (Bulk Data)"},{"name":"Providers"},{"name":"FHIR Resources"},{"name":"Clinical"},{"name":"Direct (EHR) Connect Reference"},{"name":"Subscription"},{"name":"Practitioners"}]}