---
title: "Generate a case UID"
method: POST
path: "/cases"
---

# Generate a case UID

`POST /cases`

## Request

- Base URL: `https://lpa-uid.api.opg.service.justice.gov.uk`
- URL: `https://lpa-uid.api.opg.service.justice.gov.uk/cases`
- Auth: none required

## Request body

- object
  - `type` 'property-and-affairs' | 'personal-welfare', required
  - `source` 'APPLICANT' | 'PHONE', required
  - `donor` object, required
    - `name` string, required
    - `dob` string, date, required
    - `postcode` string, required

## Response `201`

Case created

- object
  - `uid` string

## Other responses

- `400`: Invalid request

## Changes

- **2024-02-14** `e51e3ea0e4d1`: 2 breaking
  - removed the enum value `hw` of the request property `type`
  - removed the enum value `pfa` of the request property `type`
- **2024-01-25** `9c35ecfe6097`: 2 info
  - added the new `personal-welfare` enum value to the request property `type`
  - added the new `property-and-affairs` enum value to the request property `type`
- **2023-05-05** `d6363df2629c`: 1 info
  - the `uid` response's property pattern was changed from `MTEST-([346789QWERTYUPADFGHJKLXCVBNM]{4})-([346789QWERTYUPADFGHJKLXCVBNM]{4})-([346789QWERTYUPADFGHJKLXCVBNM]{4})` to `M-([346789QWERTYUPADFGHJKLXCVBNM]{4})-([346789QWERTYUPADFGHJKLXCVBNM]{4})-([346789QWERTYUPADFGHJKLXCVBNM]{4})` for the status `201`
- **2023-04-03** `ba21801b5b3a`: 1 info
  - the response property `allOf[subschema #2]/errors/items/detail` became required for the status `400`
- **2023-04-03** `98056b71b73a`: 1 warning, 1 info
  - removed the optional property `id` from the response with the `201` status
  - added the optional property `uid` to the response with the `201` status

[Operation history](https://skmtc.dev/ministryofjustice/apis/lpa-uid-service/changes/cases/post.md)

---

[API](https://skmtc.dev/ministryofjustice/apis/lpa-uid-service.md) - [All operations](https://skmtc.dev/ministryofjustice/apis/lpa-uid-service/llms.txt) - [OpenAPI document](https://skmtc.dev/ministryofjustice/apis/lpa-uid-service/revisions/e51e3ea0e4d1?raw)
