User Management Endpoints
Update user
Updates a user in Parchment
PUT
/
v1
/
organizations
/
{organization_id}
/
users
/
{user_id}
cURL
curl --request PUT \
--url https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/users/{user_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-organization-secret: <x-organization-secret>' \
--data '
{
"full_name": "Darlene Scott",
"provider_details": {
"given_name": "Darlene",
"family_name": "Cameron",
"date_of_birth": "1969-10-02",
"sex": "F",
"hpii_number": "8003614900029560",
"phone": "0412345678",
"title": "Dr",
"prescriber_number": "1234567",
"provider_number": "123456789",
"prescriber_type": "M",
"ahpra_number": "MED0000932846",
"qualifications": "MBBS, FRACGP",
"hospital_provider_number": "H123456",
"erx_entity_id": "AB12C"
}
}
'import requests
url = "https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/users/{user_id}"
payload = {
"full_name": "Darlene Scott",
"provider_details": {
"given_name": "Darlene",
"family_name": "Cameron",
"date_of_birth": "1969-10-02",
"sex": "F",
"hpii_number": "8003614900029560",
"phone": "0412345678",
"title": "Dr",
"prescriber_number": "1234567",
"provider_number": "123456789",
"prescriber_type": "M",
"ahpra_number": "MED0000932846",
"qualifications": "MBBS, FRACGP",
"hospital_provider_number": "H123456",
"erx_entity_id": "AB12C"
}
}
headers = {
"x-organization-secret": "<x-organization-secret>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-organization-secret': '<x-organization-secret>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
full_name: 'Darlene Scott',
provider_details: {
given_name: 'Darlene',
family_name: 'Cameron',
date_of_birth: '1969-10-02',
sex: 'F',
hpii_number: '8003614900029560',
phone: '0412345678',
title: 'Dr',
prescriber_number: '1234567',
provider_number: '123456789',
prescriber_type: 'M',
ahpra_number: 'MED0000932846',
qualifications: 'MBBS, FRACGP',
hospital_provider_number: 'H123456',
erx_entity_id: 'AB12C'
}
})
};
fetch('https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/users/{user_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/users/{user_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'full_name' => 'Darlene Scott',
'provider_details' => [
'given_name' => 'Darlene',
'family_name' => 'Cameron',
'date_of_birth' => '1969-10-02',
'sex' => 'F',
'hpii_number' => '8003614900029560',
'phone' => '0412345678',
'title' => 'Dr',
'prescriber_number' => '1234567',
'provider_number' => '123456789',
'prescriber_type' => 'M',
'ahpra_number' => 'MED0000932846',
'qualifications' => 'MBBS, FRACGP',
'hospital_provider_number' => 'H123456',
'erx_entity_id' => 'AB12C'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-organization-secret: <x-organization-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/users/{user_id}"
payload := strings.NewReader("{\n \"full_name\": \"Darlene Scott\",\n \"provider_details\": {\n \"given_name\": \"Darlene\",\n \"family_name\": \"Cameron\",\n \"date_of_birth\": \"1969-10-02\",\n \"sex\": \"F\",\n \"hpii_number\": \"8003614900029560\",\n \"phone\": \"0412345678\",\n \"title\": \"Dr\",\n \"prescriber_number\": \"1234567\",\n \"provider_number\": \"123456789\",\n \"prescriber_type\": \"M\",\n \"ahpra_number\": \"MED0000932846\",\n \"qualifications\": \"MBBS, FRACGP\",\n \"hospital_provider_number\": \"H123456\",\n \"erx_entity_id\": \"AB12C\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-organization-secret", "<x-organization-secret>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/users/{user_id}")
.header("x-organization-secret", "<x-organization-secret>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"full_name\": \"Darlene Scott\",\n \"provider_details\": {\n \"given_name\": \"Darlene\",\n \"family_name\": \"Cameron\",\n \"date_of_birth\": \"1969-10-02\",\n \"sex\": \"F\",\n \"hpii_number\": \"8003614900029560\",\n \"phone\": \"0412345678\",\n \"title\": \"Dr\",\n \"prescriber_number\": \"1234567\",\n \"provider_number\": \"123456789\",\n \"prescriber_type\": \"M\",\n \"ahpra_number\": \"MED0000932846\",\n \"qualifications\": \"MBBS, FRACGP\",\n \"hospital_provider_number\": \"H123456\",\n \"erx_entity_id\": \"AB12C\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/users/{user_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-organization-secret"] = '<x-organization-secret>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"full_name\": \"Darlene Scott\",\n \"provider_details\": {\n \"given_name\": \"Darlene\",\n \"family_name\": \"Cameron\",\n \"date_of_birth\": \"1969-10-02\",\n \"sex\": \"F\",\n \"hpii_number\": \"8003614900029560\",\n \"phone\": \"0412345678\",\n \"title\": \"Dr\",\n \"prescriber_number\": \"1234567\",\n \"provider_number\": \"123456789\",\n \"prescriber_type\": \"M\",\n \"ahpra_number\": \"MED0000932846\",\n \"qualifications\": \"MBBS, FRACGP\",\n \"hospital_provider_number\": \"H123456\",\n \"erx_entity_id\": \"AB12C\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"message": "User updated successfully",
"data": {
"user_id": "usr_abc123def456"
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_abc123"
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 422,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "VALIDATION_ERROR",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}Integration Notes
- Provider fields go in
provider_details.access_rolesandemailare ignored. - Send
hpii_number,given_name,family_name,date_of_birthandsextogether — all five must match the Services Australia record. full_namefollows the provider names unless you setfull_nameyourself.
HPI-I updates and partial user creation
Update User is how you repair a user that Create User returned with aUSER_CREATED_PROVIDER_* code. Send the corrected values in provider_details. If the user has no provider record, Parchment creates one; if a record exists, Parchment updates it.
When Parchment re-checks the HI Service
Parchment runs an HI Service lookup when you sendprovider_details and either:
- the user’s provider record is not active (this includes a user with no provider record at all), or
- the
hpii_numberor the demographics on an active provider record change.
hpii_number, given_name, family_name, date_of_birth and sex. Values you send are used first, and anything you omit is taken from the existing record. Send all five together when you repair a partial creation, so the lookup does not mix new values with stale ones.
What the response tells you
| Response | code | What to do |
|---|---|---|
200 “User updated successfully” | SUCCESS | Applied. Confirm readiness with is_escript_ready.can_prescribe on Read User. |
400 “Invalid HPII number” / “Invalid organization HPIO number” | INVALID_USER_PARAMETERS | Correct the value. The org HPI-O case needs Parchment support. |
404 “User not found” | RESOURCE_NOT_FOUND | Check the user_id. |
409 “IHI already assigned to another provider” | USER_ALREADY_EXISTS | Another active provider holds this HPI-I. Find the duplicate account or use the correct number. |
422 per-field validation[] | VALIDATION_ERROR | Correct the fields named. REQUIRED_FIELD means the identity set is incomplete in both the request and the stored record. |
422 HI_SERVICE_NO_MATCH | VALIDATION_ERROR | The HPI-I does not match the demographics. Do not retry the same values. |
422 HI_SERVICE_NOT_VERIFIED | VALIDATION_ERROR | The lookup returned no status. Nothing was saved. Retry later or contact support. |
500 | INTERNAL_ERROR | The HI Service was unreachable. Retry later. |
requestId for support.
Repair sequence
PUT .../users/{user_id}with the correctedprovider_details. Send all five identity fields together.GET .../users/{user_id}and checkis_escript_ready.can_prescribe.
200 means the provider record was written; can_prescribe then tells you whether it is usable.
Request
Update Basic User Information
{
"full_name": "Darlene Scott"
}
Update Provider Details
{
"provider_details": {
"given_name": "Darlene",
"family_name": "Scott",
"prescriber_type": "M",
"prescriber_number": "1234567",
"qualifications": "MBBS, FRACGP",
"ahpra_number": "MED0001234567",
"provider_number": "123456789"
}
}
Update Both User and Provider Information
{
"full_name": "Darlene Scott",
"provider_details": {
"given_name": "Darlene",
"family_name": "Cameron",
"date_of_birth": "1969-10-02",
"sex": "F",
"title": "Dr",
"prescriber_type": "M",
"prescriber_number": "1234567",
"qualifications": "MBBS, FRACGP",
"ahpra_number": "MED0001234567",
"hospital_provider_number": "H123456"
}
}
Repair a Partial User Creation
Send the full identity set so the HI Service lookup uses only current values.{
"provider_details": {
"given_name": "Darlene",
"family_name": "Cameron",
"date_of_birth": "1969-10-02",
"sex": "F",
"hpii_number": "8003614900029560",
"prescriber_type": "M",
"prescriber_number": "1234567",
"qualifications": "MBBS, FRACGP"
}
}
User Fields
| Field | Type | Required | Description |
|---|---|---|---|
full_name | string | No | User’s given name |
Provider Details
When updating provider-specific information, use theprovider_details object:
| Field | Type | Required When | Description |
|---|---|---|---|
given_name | string | No | Prescriber’s given name |
family_name | string | No | Prescriber’s family name |
date_of_birth | string | No | Date of birth in YYYY-MM-DD format |
sex | string | No | Sex (M/F/I/N) |
hpii_number | string | No | Healthcare Provider Identifier |
phone | string | No | Provider phone number |
title | string | No | Professional title |
prescriber_number | string | When prescriber_type is not ‘T’ (podiatrist) | Max 10 characters |
provider_number | string | No | Max 10 characters |
prescriber_type | string | No | Prescriber type (M/E/U/F/D/V/T/C) |
ahpra_number | string | No | AHPRA registration number |
qualifications | string | When prescriber_type is provided | Professional qualifications |
hospital_provider_number | string | No | Hospital provider number |
erx_entity_id | string | No | ERX Entity ID provided by ERX |
Validation Rules
- Prescriber Number: Must be 10 characters or less
- Provider Number: Must be 10 characters or less
- Provider Details Dependencies:
- If
prescriber_typeis provided,qualificationsmust also be provided - If
prescriber_typeis not ‘T’ (podiatrist),prescriber_numberis required
- If
- Date Format: Date of birth must be in YYYY-MM-DD format
- Sex Values: Must be one of: M (Male), F (Female), I (Indeterminate), N (Not-stated)
Prescriber Types
Valid values forprescriber_type:
M(Medical Practitioner)E(Eye/Optometrist)U(Nurse)F(Midwife)D(Dentist)V(Veterinarian)T(Podiatrist)C(Pharmacist)
Response
Success Response (200 OK)
{
"success": true,
"statusCode": 200,
"message": "User updated successfully",
"code": "SUCCESS",
"data": {
"user_id": "usr_abc123def456"
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_abc123"
}
Validation Error (422 Unprocessable Entity)
{
"success": false,
"statusCode": 422,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"validation": [
{
"field": "date_of_birth",
"message": "Invalid date",
"code": "VALIDATION_ERROR"
},
{
"field": "provider_details",
"message": "When providing provider_details with prescriber_type, qualifications and prescriber_number (if not podiatrist) are required",
"code": "VALIDATION_ERROR"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456"
}
User Not Found (404 Not Found)
{
"success": false,
"statusCode": 404,
"error": {
"type": "https://parchment.health/errors/not-found",
"title": "Not found",
"detail": "User not found"
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_ghi789"
}
HPI-I Already Held by Another Provider (409 Conflict)
{
"success": false,
"statusCode": 409,
"code": "USER_ALREADY_EXISTS",
"error": {
"type": "https://parchment.health/errors/resource-conflict",
"title": "Resource conflict",
"detail": "IHI already assigned to another provider"
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_stu901"
}
HI Service Could Not Match the HPI-I (422)
The HPI-I did not match the given name, family name, date of birth and sex. Correct them; do not retry the same values.{
"success": false,
"statusCode": 422,
"code": "VALIDATION_ERROR",
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "No Healthcare Provider records have been found.",
"validation": [
{
"field": "provider_details",
"message": "No Healthcare Provider records have been found.",
"code": "HI_SERVICE_NO_MATCH"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_vwx234"
}
Incomplete Provider Identity (422)
A provider record cannot be created or verified without all five identity fields. Missing values are taken from the stored record first; these were absent from both.{
"success": false,
"statusCode": 422,
"code": "VALIDATION_ERROR",
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "The provider identity could not be assembled. These fields are missing from both this request and the stored provider record, and all of them are required to verify an HPI-I.",
"validation": [
{
"field": "provider_details.given_name",
"message": "given_name is required to verify and save a provider record",
"code": "REQUIRED_FIELD"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_yza567"
}
Unauthorized (401)
{
"success": false,
"statusCode": 401,
"code": "UNAUTHORIZED",
"error": {
"type": "https://parchment.health/errors/authentication-required",
"title": "Unauthorized",
"detail": "Valid authentication token is required"
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_jkl012"
}
Insufficient Scope (401 Unauthorized)
{
"success": false,
"statusCode": 401,
"code": "UNAUTHORIZED",
"error": {
"type": "https://parchment.health/errors/authentication-required",
"title": "Unauthorized",
"detail": "Insufficient scope"
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_mno345"
}
Rate Limited (429 Too Many Requests)
{
"success": false,
"statusCode": 429,
"error": {
"type": "https://parchment.health/errors/rate-limit",
"title": "Rate limit exceeded",
"detail": "Too many requests. Please try again later."
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_pqr678"
}
Response Fields
Success Response Data
| Field | Type | Description |
|---|---|---|
user_id | string | Parchment’s unique user identifier |
Status Codes
| Code | Status | Description |
|---|---|---|
200 | OK | User successfully updated |
400 | Bad Request | Invalid request format, or an invalid HPI-I / organisation HPI-O |
401 | Unauthorized | Authentication required, token invalid, or the token lacks the update:user scope |
404 | Not Found | User not found, or the provider record was not found |
409 | Conflict | The HPI-I is already held by another active provider in this organization |
422 | Unprocessable Entity | Schema validation failed, the identity set is incomplete, or the HPI-I could not be verified |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | HI Service unreachable, or an unexpected fault |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Organization secret for authentication - provided by Parchment
Path Parameters
Organization ID
User ID
Body
application/json
User data to update in Parchment
Fields to update. Send only the fields you want to change. access_roles and email are ignored — use the update-user-roles endpoint to change roles.
Response
User updated successfully
Indicates if the request was successful
Example:
true
Example:
200
Example:
"User updated successfully"
Always SUCCESS. A provider write that fails returns 4xx, not 200.
Example:
"SUCCESS"
Show child attributes
Show child attributes
ISO 8601 timestamp of the response
Example:
"2024-01-15T10:30:00.000Z"
Unique identifier for request tracing
Example:
"req_1705312200000_abc123"
Was this page helpful?
⌘I
cURL
curl --request PUT \
--url https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/users/{user_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-organization-secret: <x-organization-secret>' \
--data '
{
"full_name": "Darlene Scott",
"provider_details": {
"given_name": "Darlene",
"family_name": "Cameron",
"date_of_birth": "1969-10-02",
"sex": "F",
"hpii_number": "8003614900029560",
"phone": "0412345678",
"title": "Dr",
"prescriber_number": "1234567",
"provider_number": "123456789",
"prescriber_type": "M",
"ahpra_number": "MED0000932846",
"qualifications": "MBBS, FRACGP",
"hospital_provider_number": "H123456",
"erx_entity_id": "AB12C"
}
}
'import requests
url = "https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/users/{user_id}"
payload = {
"full_name": "Darlene Scott",
"provider_details": {
"given_name": "Darlene",
"family_name": "Cameron",
"date_of_birth": "1969-10-02",
"sex": "F",
"hpii_number": "8003614900029560",
"phone": "0412345678",
"title": "Dr",
"prescriber_number": "1234567",
"provider_number": "123456789",
"prescriber_type": "M",
"ahpra_number": "MED0000932846",
"qualifications": "MBBS, FRACGP",
"hospital_provider_number": "H123456",
"erx_entity_id": "AB12C"
}
}
headers = {
"x-organization-secret": "<x-organization-secret>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-organization-secret': '<x-organization-secret>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
full_name: 'Darlene Scott',
provider_details: {
given_name: 'Darlene',
family_name: 'Cameron',
date_of_birth: '1969-10-02',
sex: 'F',
hpii_number: '8003614900029560',
phone: '0412345678',
title: 'Dr',
prescriber_number: '1234567',
provider_number: '123456789',
prescriber_type: 'M',
ahpra_number: 'MED0000932846',
qualifications: 'MBBS, FRACGP',
hospital_provider_number: 'H123456',
erx_entity_id: 'AB12C'
}
})
};
fetch('https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/users/{user_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/users/{user_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'full_name' => 'Darlene Scott',
'provider_details' => [
'given_name' => 'Darlene',
'family_name' => 'Cameron',
'date_of_birth' => '1969-10-02',
'sex' => 'F',
'hpii_number' => '8003614900029560',
'phone' => '0412345678',
'title' => 'Dr',
'prescriber_number' => '1234567',
'provider_number' => '123456789',
'prescriber_type' => 'M',
'ahpra_number' => 'MED0000932846',
'qualifications' => 'MBBS, FRACGP',
'hospital_provider_number' => 'H123456',
'erx_entity_id' => 'AB12C'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-organization-secret: <x-organization-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/users/{user_id}"
payload := strings.NewReader("{\n \"full_name\": \"Darlene Scott\",\n \"provider_details\": {\n \"given_name\": \"Darlene\",\n \"family_name\": \"Cameron\",\n \"date_of_birth\": \"1969-10-02\",\n \"sex\": \"F\",\n \"hpii_number\": \"8003614900029560\",\n \"phone\": \"0412345678\",\n \"title\": \"Dr\",\n \"prescriber_number\": \"1234567\",\n \"provider_number\": \"123456789\",\n \"prescriber_type\": \"M\",\n \"ahpra_number\": \"MED0000932846\",\n \"qualifications\": \"MBBS, FRACGP\",\n \"hospital_provider_number\": \"H123456\",\n \"erx_entity_id\": \"AB12C\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-organization-secret", "<x-organization-secret>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/users/{user_id}")
.header("x-organization-secret", "<x-organization-secret>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"full_name\": \"Darlene Scott\",\n \"provider_details\": {\n \"given_name\": \"Darlene\",\n \"family_name\": \"Cameron\",\n \"date_of_birth\": \"1969-10-02\",\n \"sex\": \"F\",\n \"hpii_number\": \"8003614900029560\",\n \"phone\": \"0412345678\",\n \"title\": \"Dr\",\n \"prescriber_number\": \"1234567\",\n \"provider_number\": \"123456789\",\n \"prescriber_type\": \"M\",\n \"ahpra_number\": \"MED0000932846\",\n \"qualifications\": \"MBBS, FRACGP\",\n \"hospital_provider_number\": \"H123456\",\n \"erx_entity_id\": \"AB12C\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/users/{user_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-organization-secret"] = '<x-organization-secret>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"full_name\": \"Darlene Scott\",\n \"provider_details\": {\n \"given_name\": \"Darlene\",\n \"family_name\": \"Cameron\",\n \"date_of_birth\": \"1969-10-02\",\n \"sex\": \"F\",\n \"hpii_number\": \"8003614900029560\",\n \"phone\": \"0412345678\",\n \"title\": \"Dr\",\n \"prescriber_number\": \"1234567\",\n \"provider_number\": \"123456789\",\n \"prescriber_type\": \"M\",\n \"ahpra_number\": \"MED0000932846\",\n \"qualifications\": \"MBBS, FRACGP\",\n \"hospital_provider_number\": \"H123456\",\n \"erx_entity_id\": \"AB12C\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"message": "User updated successfully",
"data": {
"user_id": "usr_abc123def456"
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_abc123"
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 422,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "VALIDATION_ERROR",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}{
"success": false,
"statusCode": 400,
"error": {
"type": "https://parchment.health/errors/validation-error",
"title": "Validation failed",
"detail": "There were some problems with your input.",
"instance": "/patients/123",
"validation": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_def456",
"code": "RESOURCE_NOT_FOUND",
"meta": {
"apiVersion": "1.0"
}
}
