{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Write a record of one of the collections a frame app names in its writes in the person's own repository (com.atproto.repo.createRecord), its $type set by HUD and the record checked against the collection's lexicon first, once they have allowed the app (place.hud.allowAppEntries) and signed in asking to write that collection. Never in a private instance: in one, the app writes to the public network as outside it. Requires auth: the workspace's web session (its cookie, with X-HUD: 1 and the server's own Origin) or a HUD access token as Bearer.",
      "errors": [
        {
          "description": "HUD has no frame app of this id.",
          "name": "NotFound"
        },
        {
          "description": "The collection is not one the app names in its writes, the record does not match its lexicon, or the input is not what the method takes.",
          "name": "InvalidRequest"
        },
        {
          "description": "The person has not allowed this app to save for them: ask them, then place.hud.allowAppEntries.",
          "name": "ConsentRequired"
        },
        {
          "description": "No live web session or HUD access token, or the person's sign-in at their PDS ended: sign in.",
          "name": "AuthRequired"
        },
        {
          "description": "Their PDS refused the write; or they signed in before the app asked to write this collection, which the message says: sign in again.",
          "name": "UpstreamFailure"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "app": {
              "description": "The app's place.hud.app record.",
              "format": "at-uri",
              "type": "string"
            },
            "collection": {
              "description": "Which of the collections it writes.",
              "format": "nsid",
              "type": "string"
            },
            "record": {
              "description": "The record, an object as the collection's lexicon describes it; its $type left out or the collection.",
              "type": "unknown"
            }
          },
          "required": [
            "app",
            "collection",
            "record"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "cid": {
              "format": "cid",
              "type": "string"
            },
            "uri": {
              "format": "at-uri",
              "type": "string"
            }
          },
          "required": [
            "uri",
            "cid"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Write a record a frame app makes in the person's own repository.",
  "id": "place.hud.createAppRecord",
  "lexicon": 1
}
