Custom Drug Endpoints
Delete Organization Custom Drug
Deletes one organization-level custom drug.
DELETE
/
v1
/
organizations
/
{organization_id}
/
custom-drugs
/
{custom_drug_id}
cURL
curl --request DELETE \
--url https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id} \
--header 'Authorization: Bearer <token>' \
--header 'x-organization-secret: <x-organization-secret>'import requests
url = "https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}"
headers = {
"x-organization-secret": "<x-organization-secret>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {
'x-organization-secret': '<x-organization-secret>',
Authorization: 'Bearer <token>'
}
};
fetch('https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_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}/custom-drugs/{custom_drug_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-organization-secret", "<x-organization-secret>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}")
.header("x-organization-secret", "<x-organization-secret>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-organization-secret"] = '<x-organization-secret>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"message": "Success",
"data": {},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_abc123",
"code": "SUCCESS",
"pagination": {
"count": 123,
"hasNext": true,
"limit": 123,
"offset": 123,
"lastKey": "<string>"
}
}{
"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"
}
}Deletes one organization-level custom drug.
custom_drug_id is the custom_drug_id from the catalog list or the bulk-create created[] array.
To clear the whole catalog use the bulk delete endpoint instead.
Example Response
{
"success": true,
"statusCode": 200,
"message": "Custom drug deleted successfully",
"code": "SUCCESS",
"data": null,
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_abc123"
}
Status Codes
| Code | Meaning |
|---|---|
| 200 | Deleted, or no such drug (idempotent) |
| 401 | Authentication failed, or the token’s user is not an organization owner or admin |
| 500 | Unexpected server error |
Notes
- Requires the
delete:custom_drugscope. - Idempotent: deleting an id that does not exist still returns
200. - User-level drugs are never affected.
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
custom_drug_id from the catalog or bulk-create response
Response
Custom drug deleted successfully
Indicates if the request was successful
Example:
true
HTTP status code
Example:
200
Human-readable success message
Example:
"Success"
Response payload data
ISO 8601 timestamp of the response
Example:
"2024-01-15T10:30:00.000Z"
Unique identifier for request tracing
Example:
"req_1705312200000_abc123"
Machine-readable operation code
Example:
"SUCCESS"
Pagination information for list operations
Show child attributes
Show child attributes
Was this page helpful?
⌘I
cURL
curl --request DELETE \
--url https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id} \
--header 'Authorization: Bearer <token>' \
--header 'x-organization-secret: <x-organization-secret>'import requests
url = "https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}"
headers = {
"x-organization-secret": "<x-organization-secret>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {
'x-organization-secret': '<x-organization-secret>',
Authorization: 'Bearer <token>'
}
};
fetch('https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_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}/custom-drugs/{custom_drug_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-organization-secret", "<x-organization-secret>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}")
.header("x-organization-secret", "<x-organization-secret>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.parchmenthealth.io/external/v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-organization-secret"] = '<x-organization-secret>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"message": "Success",
"data": {},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_1705312200000_abc123",
"code": "SUCCESS",
"pagination": {
"count": 123,
"hasNext": true,
"limit": 123,
"offset": 123,
"lastKey": "<string>"
}
}{
"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"
}
}
