# requestOrgSharingRemoval

Source: /openapi/thomas-federated.openapi.json

## Operation

| Method | URL |
|---|---|
| POST | https://staging-api.thomas.co/v1/sharing/organisations/{organisationId}/request-removal |

| Field | Value |
|---|---|
| operationId | requestOrgSharingRemoval |
| method | POST |
| server | https://staging-api.thomas.co/v1 |
| path | /sharing/organisations/{organisationId}/request-removal |
| tags | `Sharing` |
| summary | Request removal of the results one organisation holds |
| badges | None |

## Request Parameters

| Name | In | Required | Schema | Description |
|---|---|---|---|---|
| organisationId | path | true | string:uuid | The organisation to stop sharing with (a tenant id) |

## Request Body

None.

## Responses

| Status | Description | Schema refs |
|---|---|---|
| 201 | The organisation's updated sharing row. Deliberately carries no DSR id — a candidate surface has no use for the engine's internal identifier. | #/components/schemas/RequestOrgSharingRemovalResponseDto |
| 400 | organisationId is not a valid UUID (ParseUUIDPipe) | #/components/schemas/ApiErrorResponseDto |
| 401 | Invalid or missing authentication token (AUTH_TOKEN_INVALID) | #/components/schemas/ApiErrorResponseDto |
| 404 | The caller does not share results with that organisation. Deliberately 404 rather than 403, so the response cannot confirm whether the organisation exists. | #/components/schemas/ApiErrorResponseDto |
| 409 | A removal request for that organisation is already under review. | #/components/schemas/ApiErrorResponseDto |

## Artifact Examples

### Response 400 example

```json
{
  "statusCode": 400,
  "message": "Validation failed (uuid is expected)",
  "error": "HTTP_BAD_REQUEST"
}
```

### Response 401 example

```json
{
  "statusCode": 401,
  "message": "Invalid or missing authentication token",
  "error": "AUTH_TOKEN_INVALID"
}
```

### Response 404 example

```json
{
  "statusCode": 404,
  "message": "You are not sharing results with that organisation.",
  "error": "ORG_SHARING_ORGANISATION_NOT_FOUND"
}
```

### Response 409 example

```json
{
  "statusCode": 409,
  "message": "You already have a removal request under review for that organisation.",
  "error": "ORG_SHARING_REMOVAL_ALREADY_REQUESTED"
}
```
