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

# Create diagnosis

POST https://api.taigabilling.com/api/diagnoses/v2
Content-Type: application/json

Creates a new diagnosis for an encounter

Reference: https://docs.taigabilling.com/api-reference/diagnoses/create

## Authentication

- `Authorization` header (bearer token, required) — Send your Taiga API key as a Bearer token. Create and manage keys in the Taiga developer portal.

## Servers

- `https://api.taigabilling.com` (Production, default)
- `https://api-staging.taigabilling.com` (Staging)

## Request

### Body (application/json)

This endpoint expects a StandaloneDiagnosisCreate.

- `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 Taiga 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`
- `encounter_id` (string, required)
- `name` (string, optional, nullable) — Empty string not allowed.
- `present_on_admission_indicator` (enum, optional, nullable) — 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 Taiga 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` (string, required)
- `encounter_id` (string, required)
- `updated_at` (datetime, required)
- `name` (string, optional, nullable) — Empty string not allowed.
- `present_on_admission_indicator` (enum, optional, nullable) — 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 Not Found Error

The encounter does not exist or is outside your scope.

- `message` (enum, required)
  - Allowed values: `Not found`

### 422 Unprocessable Entity Error

The request failed validation. `encounter_id` is required and must be the UUID of an encounter you can read; Taiga returns a field-level `errors` array naming it. An encounter you cannot read returns 404.

- `Diagnoses_createRequestUnprocessableEntityError`
  - GatewayValidationError: GatewayValidationError

## Types

### GatewayValidationError

A field-level validation failure detected by Taiga before the request was submitted for billing. Correct the listed fields and retry; the request is not retryable as sent.

- `errors` (list of GatewayValidationErrorErrorsItems, required)
- `message` (string, required) — Summary of why the request was rejected.

### GatewayValidationErrorErrorsItems

- `field` (string, required) — The request-body field the failure applies to (e.g. `provider_type`).
- `message` (string, required) — Human-readable explanation of the failure.
- `expected` (string, optional) — The value the field must take, when known.
- `received` (string, optional) — The value that was submitted, when known.

## Examples

**Request**

```json
{
  "code": "string",
  "code_type": "ABF",
  "encounter_id": "string"
}
```

**Response**

```json
{
  "code": "string",
  "code_type": "ABF",
  "created_at": "2023-01-01T00:00:00Z",
  "diagnosis_id": "string",
  "encounter_id": "string",
  "updated_at": "2023-01-01T00:00:00Z",
  "name": "string",
  "present_on_admission_indicator": "YES"
}
```

**SDK Code**

```python
import requests

url = "https://api.taigabilling.com/api/diagnoses/v2"

payload = {
    "code": "string",
    "code_type": "ABF",
    "encounter_id": "string"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```