<div class="endpoint"><span class="method">POST</span><code>/api/v1/workspaces/&#123;workspaceId&#125;/patients</code></div>

**Operation ID:** `patients.create` · **Access:** PAT with `write` scope and authorized workspace where applicable · **Effect:** `write`.

Read the [patients workflow](/guides/data-model/) before this operation.

## Parameters

| Name | In | Required | Type / allowed values |
| --- | --- | --- | --- |
| `workspaceId` | path | Yes | string |
| `idempotency-key` | header | No | string |

## Request body

**Content type:** `application/json` · **Required:** yes.

Schema: [PatientInput](/reference/schemas/patient-input/). [Browse schema fields](/reference/schemas/).

<details>
<summary>Example: request</summary>

Synthetic contract example. Replace identifiers and clinical data with authorized values. This example does not prove ministry acceptance.

[Download JSON](/examples/patients-create-request.json)

```json
{
  "documentType": "CC",
  "documentNumber": "1000000002",
  "firstName": "Paciente",
  "lastName": "Ejemplo",
  "birthDate": "1990-01-01",
  "userType": "01",
  "sexCode": "F",
  "countryResidenceCode": "170",
  "countryOriginCode": "170",
  "municipalityResidenceCode": "11001",
  "territorialZoneCode": "01",
  "incapacityCertificate": "NO"
}
```

</details>

## Responses

| HTTP | Content | Schema |
| --- | --- | --- |
| 201 | `application/json` | [Patient](/reference/schemas/patient/) |
| 400 | `application/json` | [ApiError](/reference/schemas/api-error/) |
| 401 | `application/json` | [ApiError](/reference/schemas/api-error/) |
| 403 | `application/json` | [ApiError](/reference/schemas/api-error/) |
| 404 | `application/json` | [ApiError](/reference/schemas/api-error/) |
| 409 | `application/json` | [ApiError](/reference/schemas/api-error/) |
| 413 | `application/json` | [ApiError](/reference/schemas/api-error/) |
| 415 | `application/json` | [ApiError](/reference/schemas/api-error/) |
| 428 | `application/json` | [ApiError](/reference/schemas/api-error/) |
| 500 | `application/json` | [ApiError](/reference/schemas/api-error/) |

Use `error.code`, `error.issues`, and `requestId` for JSON errors. [Error and recovery guide](/guides/errors-and-retries/).

## cURL

Set the connection variables from the [quickstart](/guides/quickstart/). Set each path variable to an authorized identifier or an allowed parameter value from the table above.

Save your authorized JSON input as `request.json`. Use the request schema and examples above; replace synthetic data before use.

```bash
curl --fail-with-body --request POST \
  "$RIPSCLOUD_BASE_URL/api/v1/workspaces/$WORKSPACE_ID/patients" \
  --header "Authorization: Bearer $RIPSCLOUD_TOKEN" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data-binary @request.json
```
