# ai.newnal.illi.artwork.ackDelivery

> Device app. Acknowledges one delivery: outcome received after the whole file was downloaded, its CID, size and sha256 matched the manifest and a decoder frame was prepared without starting playback (playbackReady true); outcome failed with the failure stage otherwise. received is final and counts the work's originals as used; a failure consumes nothing. The same requestKey replays the first answer.

- Kind: procedure
- Authority: artwork.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.artwork.ackDelivery)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.artwork.ackDelivery/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:uztm7bi2ce42dez3uu3qafro/ai.newnal.illi.artwork.ackDelivery/analytics)

## Procedure (`ai.newnal.illi.artwork.ackDelivery`)

Type: procedure · POST

### Input (application/json)

- `blobCid` (string · cid)
- `byteSize` (integer)
  - Constraints: minimum: 0, maximum: 314572800
- `contentHash` (string)
  - Constraints: maxLength: 128
- `deliveryId` (string, required)
  - Constraints: maxLength: 64
- `failure` (string)
  - Constraints: knownValues: download | size | hash | storage | metadata | decode
- `homeId` (string · tid, required)
- `outcome` (string, required)
  - Constraints: knownValues: received | failed
- `playbackReady` (boolean): Required true for received after complete metadata and decoder-frame verification, without starting playback.
- `requestKey` (string, required): Client-chosen idempotency key (1 to 64 characters of A-Za-z0-9._:-), new for each user action and reused when the same request is sent again after a lost answer. The same key with the same input replays the first answer; the same key with other input is RequestConflict.
  - Constraints: minLength: 1, maxLength: 64

### Output (application/json)

- `delivery` (ref, required)
  - Reference: `ai.newnal.illi.artwork.defs#deliveryView`
- `recorded` (boolean, required): false when the same acknowledgement had been recorded before.

### Errors

- `NotMember`: No description in schema.
- `DeliveryNotFound`: No description in schema.
- `NotDevice`: No description in schema.
- `DeliveryMismatch`: No description in schema.
- `DeliveryWithdrawn`: No description in schema.
- `RequestConflict`: No description in schema.
- `DeliveryExpired`: No description in schema.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Device app. Acknowledges one delivery: outcome received after the whole file was downloaded, its CID, size and sha256 matched the manifest and a decoder frame was prepared without starting playback (playbackReady true); outcome failed with the failure stage otherwise. received is final and counts the work's originals as used; a failure consumes nothing. The same requestKey replays the first answer.",
      "errors": [
        {
          "name": "NotMember"
        },
        {
          "name": "DeliveryNotFound"
        },
        {
          "name": "NotDevice"
        },
        {
          "name": "DeliveryMismatch"
        },
        {
          "name": "DeliveryWithdrawn"
        },
        {
          "name": "RequestConflict"
        },
        {
          "name": "DeliveryExpired"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "blobCid": {
              "format": "cid",
              "type": "string"
            },
            "byteSize": {
              "maximum": 314572800,
              "minimum": 0,
              "type": "integer"
            },
            "contentHash": {
              "maxLength": 128,
              "type": "string"
            },
            "deliveryId": {
              "maxLength": 64,
              "type": "string"
            },
            "failure": {
              "knownValues": [
                "download",
                "size",
                "hash",
                "storage",
                "metadata",
                "decode"
              ],
              "type": "string"
            },
            "homeId": {
              "format": "tid",
              "type": "string"
            },
            "outcome": {
              "knownValues": [
                "received",
                "failed"
              ],
              "type": "string"
            },
            "playbackReady": {
              "description": "Required true for received after complete metadata and decoder-frame verification, without starting playback.",
              "type": "boolean"
            },
            "requestKey": {
              "description": "Client-chosen idempotency key (1 to 64 characters of A-Za-z0-9._:-), new for each user action and reused when the same request is sent again after a lost answer. The same key with the same input replays the first answer; the same key with other input is RequestConflict.",
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          "required": [
            "homeId",
            "deliveryId",
            "outcome",
            "requestKey"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "delivery": {
              "ref": "ai.newnal.illi.artwork.defs#deliveryView",
              "type": "ref"
            },
            "recorded": {
              "description": "false when the same acknowledgement had been recorded before.",
              "type": "boolean"
            }
          },
          "required": [
            "delivery",
            "recorded"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "ai.newnal.illi.artwork.ackDelivery",
  "lexicon": 1
}
```
