# ai.newnal.illi.mydata.deleteRecord

> Root or main admin deletes one My Data record of the parent and its provenance; the previous value goes to the audit log. expectedCid as in putRecord.

- Kind: procedure
- Authority: mydata.illi.newnal.ai
- Lexicon: 1
- Published by [illi-service.newnal.id](https://lexicon.garden/identity/did:plc:uztm7bi2ce42dez3uu3qafro), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.mydata.deleteRecord)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.mydata.deleteRecord/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.mydata.deleteRecord/analytics)

## Procedure (`ai.newnal.illi.mydata.deleteRecord`)

Type: procedure · POST

### Input (application/json)

- `collection` (ref, required)
  - Reference: `ai.newnal.illi.mydata.defs#collection`
- `expectedCid` (string · cid)
- `homeId` (string · tid, required)
- `requestKey` (string, required): Idempotency key chosen by the client; a replay with the same key and input returns the first result.
  - Constraints: minLength: 1, maxLength: 64
- `rkey` (string · record-key, required)
- `slot` (integer, required): The parent slot, 1 or 2.
  - Constraints: minimum: 1, maximum: 2

### Output (application/json)

- `deleted` (boolean, required)

### Errors

- `NotMember`: No description in schema.
- `NotAdmin`: No description in schema.
- `HomeNotFound`: No description in schema.
- `ParentNotLinked`: No description in schema.
- `RecordNotFound`: No description in schema.
- `RecordChanged`: No description in schema.
- `DelegationUnavailable`: No description in schema.
- `PdsUnavailable`: No description in schema.
- `RequestConflict`: No description in schema.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Root or main admin deletes one My Data record of the parent and its provenance; the previous value goes to the audit log. expectedCid as in putRecord.",
      "errors": [
        {
          "name": "NotMember"
        },
        {
          "name": "NotAdmin"
        },
        {
          "name": "HomeNotFound"
        },
        {
          "name": "ParentNotLinked"
        },
        {
          "name": "RecordNotFound"
        },
        {
          "name": "RecordChanged"
        },
        {
          "name": "DelegationUnavailable"
        },
        {
          "name": "PdsUnavailable"
        },
        {
          "name": "RequestConflict"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "collection": {
              "ref": "ai.newnal.illi.mydata.defs#collection",
              "type": "ref"
            },
            "expectedCid": {
              "format": "cid",
              "type": "string"
            },
            "homeId": {
              "format": "tid",
              "type": "string"
            },
            "requestKey": {
              "description": "Idempotency key chosen by the client; a replay with the same key and input returns the first result.",
              "maxLength": 64,
              "minLength": 1,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "type": "string"
            },
            "rkey": {
              "format": "record-key",
              "type": "string"
            },
            "slot": {
              "description": "The parent slot, 1 or 2.",
              "maximum": 2,
              "minimum": 1,
              "type": "integer"
            }
          },
          "required": [
            "homeId",
            "slot",
            "collection",
            "rkey",
            "requestKey"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "deleted": {
              "type": "boolean"
            }
          },
          "required": [
            "deleted"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "ai.newnal.illi.mydata.deleteRecord",
  "lexicon": 1
}
```
