curl --request PUT \
--url https://sandbox-api.instockrx.com/groups/npi-list \
--header 'Content-Type: application/json' \
--header 'X-InStockRx-Api-Key: <api-key>' \
--data '
{
"npis": [
"1234567890"
]
}
'const options = {
method: 'PUT',
headers: {'X-InStockRx-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({npis: ['1234567890']})
};
fetch('https://sandbox-api.instockrx.com/groups/npi-list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox-api.instockrx.com/groups/npi-list"
payload = { "npis": ["1234567890"] }
headers = {
"X-InStockRx-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"added": [
"1234567890"
],
"invited": [
"1234567890"
],
"removed": [
"1234567890"
],
"unchangedCount": 1
}{
"type": "https://api.instockrx.com/problems/listing-not-available",
"title": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"type": "https://api.instockrx.com/problems/listing-not-available",
"title": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}Replace the NPI roster for the credential's group
Scope: pharmacies:write.
Idempotent replace. Pair with GET /groups/npi-list to capture the
current state before sending — PUT is replace (not append), so
sending an incremental list without reading first will remove every
other NPI from the group.
Provide the full desired list of NPIs that should be members of the credential’s group:
- NPIs in the input that correspond to existing InStockRx pharmacies are added to the group if not already present.
- NPIs already in the group but not in the input are removed. (Group invitations to unregistered NPIs that are no longer in the input are also revoked.)
- NPIs in the input that don’t correspond to any registered InStockRx
pharmacy yet create a
GroupInvitation: the pharmacy will be auto-joined to the group when it registers. This matches V1’s implicit behavior.
The response returns three lists so partners can verify what happened:
added— pharmacies newly joined to the group.invited— placeholder invitations created for NPIs without a registered pharmacy (auto-join pending).removed— pharmacies/invitations no longer in the group.unchangedCount— count of NPIs that were already members.
curl --request PUT \
--url https://sandbox-api.instockrx.com/groups/npi-list \
--header 'Content-Type: application/json' \
--header 'X-InStockRx-Api-Key: <api-key>' \
--data '
{
"npis": [
"1234567890"
]
}
'const options = {
method: 'PUT',
headers: {'X-InStockRx-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({npis: ['1234567890']})
};
fetch('https://sandbox-api.instockrx.com/groups/npi-list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox-api.instockrx.com/groups/npi-list"
payload = { "npis": ["1234567890"] }
headers = {
"X-InStockRx-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"added": [
"1234567890"
],
"invited": [
"1234567890"
],
"removed": [
"1234567890"
],
"unchangedCount": 1
}{
"type": "https://api.instockrx.com/problems/listing-not-available",
"title": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"type": "https://api.instockrx.com/problems/listing-not-available",
"title": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}Authorizations
Headers
Which pharmacy in your group you are acting as. Required whenever your group holds more than one pharmacy — omitting it is then 400 missing-pharmacy-context. With exactly one pharmacy it may be omitted, but send it anyway: the call starts failing the day a second pharmacy is added.
The ETag from your most recent read of this resource, to avoid overwriting a change someone else made in the meantime. A stale value is 412 stale-resource and nothing is modified. * means "any current version". Omitting it is not an error — it means last write wins.
"W/\"AAAAAAAAB9E=\""
"*"
Body
Wraps the bare V1 array ([1234567890, …]) in a typed object.
V1 accepted List<long> directly; V2 normalizes around the
rest of the spec's { field: … } body convention and
preserves leading-zero NPIs via string typing.
10000NPI as a fixed-width 10-digit string. v2 treats an NPI as an opaque identifier
rather than a number, consistent with how it handles NDC, GTIN and other
healthcare identifiers. CMS-issued NPIs always start with 1 or 2, so
leading-zero NPIs do not arise in practice, but string typing rules out the
broader class of integer-identifier truncation bugs that v1 was open to.
^\d{10}$Response
OK
NPIs newly joined to the group (pharmacy already registered with InStockRx).
NPI as a fixed-width 10-digit string. v2 treats an NPI as an opaque identifier
rather than a number, consistent with how it handles NDC, GTIN and other
healthcare identifiers. CMS-issued NPIs always start with 1 or 2, so
leading-zero NPIs do not arise in practice, but string typing rules out the
broader class of integer-identifier truncation bugs that v1 was open to.
^\d{10}$NPIs for which a placeholder invitation was created (pharmacy not yet registered; will auto-join on signup).
NPI as a fixed-width 10-digit string. v2 treats an NPI as an opaque identifier
rather than a number, consistent with how it handles NDC, GTIN and other
healthcare identifiers. CMS-issued NPIs always start with 1 or 2, so
leading-zero NPIs do not arise in practice, but string typing rules out the
broader class of integer-identifier truncation bugs that v1 was open to.
^\d{10}$NPIs previously in the group (or invited) that are no longer in the input.
NPI as a fixed-width 10-digit string. v2 treats an NPI as an opaque identifier
rather than a number, consistent with how it handles NDC, GTIN and other
healthcare identifiers. CMS-issued NPIs always start with 1 or 2, so
leading-zero NPIs do not arise in practice, but string typing rules out the
broader class of integer-identifier truncation bugs that v1 was open to.
^\d{10}$