> 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.

# Update diagnosis

PATCH https://api.joincandidhealth.com/api/diagnoses/v2/{diagnosis_id}
Content-Type: application/json

Updates the diagnosis record matching the provided `diagnosis_id`

Reference: https://docs.joincandidhealth.com/api-reference/diagnoses/update

## Authentication

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

## Servers

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

## Request

### Path parameters

- `diagnosis_id` (UUID, required)

### Body (application/json)

This endpoint expects an object.

- `name` (string, optional) — Empty string not allowed.
- `code_type` (enum, optional) — Typically, providers submitting claims to Candid are using ICD-10 diagnosis codes. If you are using ICD-10 codes, the primary diagnosis code listed on the claim should use the ABK code_type. If more than one diagnosis is being submitted on a claim, please use ABF for the rest of the listed diagnoses. If you are using ICD-9 diagnosis codes, use BK and BF for the principal and following diagnosis code(s) respectively.
  - Allowed values: `ABF`, `ABJ`, `ABK`, `APR`, `BF`, `BJ`, `BK`, `PR`, `DR`, `LOI`
- `code` (string, optional) — Empty string not allowed. Should be of the appropriate format for the provided `code_type`. Must obey the ICD-10 format if an ICD-10 code_type is provided, specifically: - Letter - Digit - Digit or the letter `A` or `B` - (Optional) Period `.` - Up to 4 (or as few as 0) letters and digits
- `present_on_admission_indicator` (enum, optional) — For Institutional claims only. A "Y" indicates that the onset occurred prior to admission to the hospital. An "N" indicates that the onset did NOT occur prior to admission to the hospital. A "U" indicates that it is unknown whether the onset occurred prior to admission to the hospital or not.
  - Allowed values: `YES`, `NO`, `UNKNOWN`, `NOT_APPLICABLE`

## Response

### 200

- `code` (string, required) — Empty string not allowed. Should be of the appropriate format for the provided `code_type`. Must obey the ICD-10 format if an ICD-10 code_type is provided, specifically: - Letter - Digit - Digit or the letter `A` or `B` - (Optional) Period `.` - Up to 4 (or as few as 0) letters and digits
- `code_type` (enum, required) — Typically, providers submitting claims to Candid are using ICD-10 diagnosis codes. If you are using ICD-10 codes, the primary diagnosis code listed on the claim should use the ABK code_type. If more than one diagnosis is being submitted on a claim, please use ABF for the rest of the listed diagnoses. If you are using ICD-9 diagnosis codes, use BK and BF for the principal and following diagnosis code(s) respectively.
  - Allowed values: `ABF`, `ABJ`, `ABK`, `APR`, `BF`, `BJ`, `BK`, `PR`, `DR`, `LOI`
- `created_at` (datetime, required)
- `diagnosis_id` (UUID, required)
- `encounter_id` (UUID, required)
- `updated_at` (datetime, required)
- `name` (string, optional) — Empty string not allowed.
- `present_on_admission_indicator` (enum, optional) — For Institutional claims only. A "Y" indicates that the onset occurred prior to admission to the hospital. An "N" indicates that the onset did NOT occur prior to admission to the hospital. A "U" indicates that it is unknown whether the onset occurred prior to admission to the hospital or not.
  - Allowed values: `YES`, `NO`, `UNKNOWN`, `NOT_APPLICABLE`

## Errors

### 404 Diagnosis Not Found HTTP Error

- `errorName` ("DiagnosisNotFoundHTTPError", required)
- `content` (DiagnosisNotFoundError, required)

### 422 Disallow Multiple Primary Diagnosis HTTP Error

- `errorName` ("DisallowMultiplePrimaryDiagnosisHTTPError", required)
- `content` (DisallowMultiplePrimaryDiagnosisError, required)

## Types

### DiagnosisNotFoundError

- `message` (string, required)
- `diagnosis_id` (UUID, optional)

### DisallowMultiplePrimaryDiagnosisError

- `existing_primary_diagnosis_id` (UUID, required)
- `new_primary_diagnosis_id` (UUID, required)
- `message` (string, required)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "code": "code",
  "code_type": "ABF",
  "created_at": "2024-01-15T09:30:00Z",
  "diagnosis_id": "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  "encounter_id": "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  "updated_at": "2024-01-15T09:30:00Z",
  "name": "name",
  "present_on_admission_indicator": "YES"
}
```

**SDK Code**

```python
import requests

url = "https://api.joincandidhealth.com/api/diagnoses/v2/d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"

payload = {}
headers = {
    "Authorization": "<token>.",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.joincandidhealth.com/api/diagnoses/v2/d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32';
const options = {
  method: 'PATCH',
  headers: {Authorization: '<token>.', 'Content-Type': 'application/json'},
  body: '{}'
};

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://api.joincandidhealth.com/api/diagnoses/v2/d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PATCH", 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://api.joincandidhealth.com/api/diagnoses/v2/d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<token>.'
request["Content-Type"] = 'application/json'
request.body = "{}"

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.patch("https://api.joincandidhealth.com/api/diagnoses/v2/d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
  .header("Authorization", "<token>.")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.joincandidhealth.com/api/diagnoses/v2/d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32', [
  'body' => '{}',
  'headers' => [
    'Authorization' => '<token>.',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.joincandidhealth.com/api/diagnoses/v2/d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "<token>.");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "<token>.",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.joincandidhealth.com/api/diagnoses/v2/d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```