> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.joincandidhealth.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.joincandidhealth.com/_mcp/server.

# Create

POST https://pre-api.joincandidhealth.com/organization-external-providers/v1
Content-Type: application/json

Creates a new organization external provider. BadRequestError is returned when the NPI is already in use.

Reference: https://docs.joincandidhealth.com/api-reference/pre-encounter/organization-external-providers/v-1/create

## Authentication

- OAuth2 — send the obtained token as `Authorization: Bearer <token>`

## Servers

- `https://pre-api.joincandidhealth.com` (Production, default)
- `https://pre-api-staging.joincandidhealth.com` (Staging)
- `https://sandbox-pre-api.joincandidhealth.com` (CandidSandbox)
- `https://staging-pre-api.joincandidhealth.com` (CandidStaging)
- `http://localhost:4000` (Local)

## Request

### Body (application/json)

This endpoint expects a MutableOrganizationExternalProvider.

- `name` (HumanName, required)
- `types` (list of enum, required)
  - Allowed values: `REFERRING`, `PRIMARY`, `TREATING`
- `npi` (string, optional)
- `tax_id` (string, optional)
- `taxonomy_code` (string, optional)
- `phone_number` (string, optional)
- `other_phone_numbers` (list of string, optional)
- `fax_number` (string, optional)
- `other_fax_numbers` (list of string, optional)
- `emails` (list of string, optional)
- `license_type` (enum, optional)
  - Allowed values: `MD`, `NP`, `PA`, `LMFT`, `LCPC`, `LCSW`, `PMHNP`, `FNP`, `LPCC`, `DO`, `RD`, `SLP`, `APRN`, `LPC`, `PHD`, `PSYD`, `LMSW`, `LMHC`, `OTHER_MASTERS`, `BCBA`, `UNKNOWN`, `RPH`, `PHT`, `LAC`, `LMT`, `DC`, `ND`, `MA`, `PT`, `IBCLC`, `RN`, `DPT`, `LCMHC`, `CNM`, `RNFA`, `ACSW`, `APC`, `BCABA`, `BHA`, `OD`, `DPM`, `DA`, `DDS`, `DEH`, `DMD`, `PTA`, `LCADC`, `LCAT`, `LCMHCS`, `LCMHCA`, `LCSWA`, `LICSW`, `LISW`, `LMFTS`, `LMFTA`, `LPCI`, `LSCSW`, `MHCA`, `MHT`, `RBT`, `RCSWI`, `RHMCI`, `LPN`, `OTD`, `OMS`, `MFTA`, `APCC`, `DNP`, `AGNPBC`, `ANP`, `FNPPP`, `LCSWR`, `ALC`, `RMFTI`, `LAMFT`, `LPCA`, `LSWI`, `CSW`, `CPC`, `LGMFT`, `LLPC`, `PLPC`, `PLMFT`, `LMHCA`, `CIT`, `CT`, `MFT`, `LSW`, `PLMHP`, `PCMSW`, `LMHP`, `OTR/L`, `RPA`, `COTA`, `CRNP`, `SLP-CF`, `NP-C`, `PA-C`, `AMFT`, `CDN`, `CGC`, `CNS`, `MDPHD`, `AuD`, `ATC`, `LAT`, `OTA`, `LSSP`, `SLPA`
- `addresses` (list of Address, optional)

## Response

### 200

- `deactivated` (boolean, required) — True if the object is deactivated. Deactivated objects are not returned in search results but are returned in all other endpoints including scan.
- `id` (UUID, required) — The unique identifier for an OrganizationExternalProvider in the database
- `name` (HumanName, required)
- `organization_id` (string, required) — The organization that owns this object.
- `types` (list of enum, required)
  - Allowed values: `REFERRING`, `PRIMARY`, `TREATING`
- `updated_at` (datetime, required)
- `updating_user_id` (string, required) — The user ID of the user who last updated the object.
- `version` (integer, required) — The version of the object. Any update to any property of an object object will create a new version.
- `addresses` (list of Address, optional)
- `emails` (list of string, optional)
- `fax_number` (string, optional)
- `license_type` (enum, optional)
  - Allowed values: `MD`, `NP`, `PA`, `LMFT`, `LCPC`, `LCSW`, `PMHNP`, `FNP`, `LPCC`, `DO`, `RD`, `SLP`, `APRN`, `LPC`, `PHD`, `PSYD`, `LMSW`, `LMHC`, `OTHER_MASTERS`, `BCBA`, `UNKNOWN`, `RPH`, `PHT`, `LAC`, `LMT`, `DC`, `ND`, `MA`, `PT`, `IBCLC`, `RN`, `DPT`, `LCMHC`, `CNM`, `RNFA`, `ACSW`, `APC`, `BCABA`, `BHA`, `OD`, `DPM`, `DA`, `DDS`, `DEH`, `DMD`, `PTA`, `LCADC`, `LCAT`, `LCMHCS`, `LCMHCA`, `LCSWA`, `LICSW`, `LISW`, `LMFTS`, `LMFTA`, `LPCI`, `LSCSW`, `MHCA`, `MHT`, `RBT`, `RCSWI`, `RHMCI`, `LPN`, `OTD`, `OMS`, `MFTA`, `APCC`, `DNP`, `AGNPBC`, `ANP`, `FNPPP`, `LCSWR`, `ALC`, `RMFTI`, `LAMFT`, `LPCA`, `LSWI`, `CSW`, `CPC`, `LGMFT`, `LLPC`, `PLPC`, `PLMFT`, `LMHCA`, `CIT`, `CT`, `MFT`, `LSW`, `PLMHP`, `PCMSW`, `LMHP`, `OTR/L`, `RPA`, `COTA`, `CRNP`, `SLP-CF`, `NP-C`, `PA-C`, `AMFT`, `CDN`, `CGC`, `CNS`, `MDPHD`, `AuD`, `ATC`, `LAT`, `OTA`, `LSSP`, `SLPA`
- `npi` (string, optional)
- `other_fax_numbers` (list of string, optional)
- `other_phone_numbers` (list of string, optional)
- `phone_number` (string, optional)
- `tax_id` (string, optional)
- `taxonomy_code` (string, optional)

## Errors

### 400 Bad Request Error

- `errorName` ("BadRequestError", required)
- `content` (ErrorBase4xx, required)

## Types

### HumanName

- `family` (string, required)
- `given` (list of string, required)
- `use` (enum, required)
  - Allowed values: `USUAL`, `OFFICIAL`, `TEMP`, `NICKNAME`, `ANONYMOUS`, `OLD`, `MAIDEN`
- `period` (Period, optional)
- `suffix` (string, optional)

### Address

- `use` (enum, required)
  - Allowed values: `HOME`, `WORK`, `TEMP`, `OLD`, `BILLING`
- `line` (list of string, required)
- `city` (string, required)
- `state` (string, required)
- `postal_code` (string, required)
- `country` (string, required)
- `administrative_area` (string, optional) — The top-level administrative subdivision of the country for addresses outside the US — for example a Canadian province, a UK county, or a Japanese prefecture. Only permitted on international addresses: `country` must be present and non-US, and `state` must be "FC" (the X12 foreign-country sentinel). For US addresses use `state` instead.
- `county` (string, optional)
- `period` (Period, optional)

### ErrorBase4xx

- `message` (string, required)
- `data` (any, optional)

### Period

- `start` (date, optional)
- `end` (date, optional)

## Examples

**Request**

```json
{
  "name": {
    "family": "family",
    "given": [
      "given",
      "given"
    ],
    "use": "USUAL"
  },
  "types": [
    "REFERRING",
    "REFERRING"
  ]
}
```

**Response**

```json
{
  "deactivated": true,
  "id": "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  "name": {
    "family": "family",
    "given": [
      "given",
      "given"
    ],
    "use": "USUAL",
    "period": {
      "start": "2023-01-15",
      "end": "2023-01-15"
    },
    "suffix": "suffix"
  },
  "organization_id": "organization_id",
  "types": [
    "REFERRING",
    "REFERRING"
  ],
  "updated_at": "2024-01-15T09:30:00Z",
  "updating_user_id": "updating_user_id",
  "version": 1,
  "addresses": [
    {
      "use": "HOME",
      "line": [
        "line",
        "line"
      ],
      "city": "city",
      "state": "state",
      "postal_code": "postal_code",
      "country": "country",
      "administrative_area": "administrative_area",
      "county": "county",
      "period": {
        "start": "2023-01-15",
        "end": "2023-01-15"
      }
    },
    {
      "use": "HOME",
      "line": [
        "line",
        "line"
      ],
      "city": "city",
      "state": "state",
      "postal_code": "postal_code",
      "country": "country",
      "administrative_area": "administrative_area",
      "county": "county",
      "period": {
        "start": "2023-01-15",
        "end": "2023-01-15"
      }
    }
  ],
  "emails": [
    "emails",
    "emails"
  ],
  "fax_number": "fax_number",
  "license_type": "MD",
  "npi": "npi",
  "other_fax_numbers": [
    "other_fax_numbers",
    "other_fax_numbers"
  ],
  "other_phone_numbers": [
    "other_phone_numbers",
    "other_phone_numbers"
  ],
  "phone_number": "phone_number",
  "tax_id": "tax_id",
  "taxonomy_code": "taxonomy_code"
}
```

**SDK Code**

```python
import requests

url = "https://pre-api.joincandidhealth.com/organization-external-providers/v1"

payload = {
    "name": {
        "family": "family",
        "given": ["given", "given"],
        "use": "USUAL"
    },
    "types": ["REFERRING", "REFERRING"]
}
headers = {
    "Authorization": "<token>.",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://pre-api.joincandidhealth.com/organization-external-providers/v1';
const options = {
  method: 'POST',
  headers: {Authorization: '<token>.', 'Content-Type': 'application/json'},
  body: '{"name":{"family":"family","given":["given","given"],"use":"USUAL"},"types":["REFERRING","REFERRING"]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://pre-api.joincandidhealth.com/organization-external-providers/v1"

	payload := strings.NewReader("{\n  \"name\": {\n    \"family\": \"family\",\n    \"given\": [\n      \"given\",\n      \"given\"\n    ],\n    \"use\": \"USUAL\"\n  },\n  \"types\": [\n    \"REFERRING\",\n    \"REFERRING\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "<token>.")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://pre-api.joincandidhealth.com/organization-external-providers/v1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<token>.'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": {\n    \"family\": \"family\",\n    \"given\": [\n      \"given\",\n      \"given\"\n    ],\n    \"use\": \"USUAL\"\n  },\n  \"types\": [\n    \"REFERRING\",\n    \"REFERRING\"\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://pre-api.joincandidhealth.com/organization-external-providers/v1")
  .header("Authorization", "<token>.")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": {\n    \"family\": \"family\",\n    \"given\": [\n      \"given\",\n      \"given\"\n    ],\n    \"use\": \"USUAL\"\n  },\n  \"types\": [\n    \"REFERRING\",\n    \"REFERRING\"\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://pre-api.joincandidhealth.com/organization-external-providers/v1', [
  'body' => '{
  "name": {
    "family": "family",
    "given": [
      "given",
      "given"
    ],
    "use": "USUAL"
  },
  "types": [
    "REFERRING",
    "REFERRING"
  ]
}',
  'headers' => [
    'Authorization' => '<token>.',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://pre-api.joincandidhealth.com/organization-external-providers/v1");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<token>.");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": {\n    \"family\": \"family\",\n    \"given\": [\n      \"given\",\n      \"given\"\n    ],\n    \"use\": \"USUAL\"\n  },\n  \"types\": [\n    \"REFERRING\",\n    \"REFERRING\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "<token>.",
  "Content-Type": "application/json"
]
let parameters = [
  "name": [
    "family": "family",
    "given": ["given", "given"],
    "use": "USUAL"
  ],
  "types": ["REFERRING", "REFERRING"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://pre-api.joincandidhealth.com/organization-external-providers/v1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```