# ai.newnal.illi.media.receiveArtworkEvent

> Server-to-server only. Called by the Newnal media service with a service JWT (`iss` = the configured media DID, `lxm` = this method). Apps must not call it.

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

## Procedure (`ai.newnal.illi.media.receiveArtworkEvent`)

Type: procedure · POST

### Input (application/json)

- `compositionVersion` (integer, required)
  - Constraints: minimum: 1
- `event` (string, required): failed means a version failed while no published version exists. Unknown nonempty event values are accepted but ignored without storing or applying the event.
  - Constraints: minLength: 1, knownValues: created | updated | failed
- `eventId` (string, required)
  - Constraints: minLength: 1
- `occurredAt` (string · datetime, required)
- `resource` (ref, required)
  - Reference: `ai.newnal.illi.media.defs#artworkEventSnapshot`
- `resourceId` (string, required)
  - Constraints: minLength: 1
- `resourceType` (string, required)
  - Constraints: const: "artwork"
- `revision` (integer, required)
  - Constraints: minimum: 1
- `serviceKey` (string, required)
  - Constraints: minLength: 1
- `spaceKey` (string, required)
  - Constraints: minLength: 1

### Output (application/json)


### Errors

- `InvalidRequest`: No description in schema.
- `AuthenticationRequired`: No description in schema.
- `MediaAuthUnavailable`: No description in schema.
- `MediaInboxUnavailable`: No description in schema.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Server-to-server only. Called by the Newnal media service with a service JWT (`iss` = the configured media DID, `lxm` = this method). Apps must not call it.",
      "errors": [
        {
          "name": "InvalidRequest"
        },
        {
          "name": "AuthenticationRequired"
        },
        {
          "name": "MediaAuthUnavailable"
        },
        {
          "name": "MediaInboxUnavailable"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "description": "The envelope's serviceKey, spaceKey, resourceId, revision and compositionVersion must equal the snapshot's serviceKey, spaceKey, artworkId, revision and compositionVersion (the receiver checks this). occurredAt is a datetime with an offset.",
          "properties": {
            "compositionVersion": {
              "minimum": 1,
              "type": "integer"
            },
            "event": {
              "description": "failed means a version failed while no published version exists. Unknown nonempty event values are accepted but ignored without storing or applying the event.",
              "knownValues": [
                "created",
                "updated",
                "failed"
              ],
              "minLength": 1,
              "type": "string"
            },
            "eventId": {
              "minLength": 1,
              "type": "string"
            },
            "occurredAt": {
              "format": "datetime",
              "type": "string"
            },
            "resource": {
              "ref": "ai.newnal.illi.media.defs#artworkEventSnapshot",
              "type": "ref"
            },
            "resourceId": {
              "minLength": 1,
              "type": "string"
            },
            "resourceType": {
              "const": "artwork",
              "type": "string"
            },
            "revision": {
              "minimum": 1,
              "type": "integer"
            },
            "serviceKey": {
              "minLength": 1,
              "type": "string"
            },
            "spaceKey": {
              "minLength": 1,
              "type": "string"
            }
          },
          "required": [
            "eventId",
            "occurredAt",
            "event",
            "serviceKey",
            "spaceKey",
            "resourceType",
            "resourceId",
            "revision",
            "compositionVersion",
            "resource"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {},
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "ai.newnal.illi.media.receiveArtworkEvent",
  "lexicon": 1
}
```
