# net.olamaelcu.livtet.biblio.readingGoal.set

> Upsert the reading goal at rkey 'current'.

- Kind: procedure
- Authority: readingGoal.biblio.livtet.olamaelcu.net
- Lexicon: 1
- Published by [biblio.livtet.olamaelcu.net](https://lexicon.garden/identity/did:plc:e2x3ihw2ntxt7pcgzmtu3abi), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:e2x3ihw2ntxt7pcgzmtu3abi/net.olamaelcu.livtet.biblio.readingGoal.set)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:e2x3ihw2ntxt7pcgzmtu3abi/net.olamaelcu.livtet.biblio.readingGoal.set/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:e2x3ihw2ntxt7pcgzmtu3abi/net.olamaelcu.livtet.biblio.readingGoal.set/analytics)

## Procedure (`net.olamaelcu.livtet.biblio.readingGoal.set`)

Type: procedure · POST

### Input (application/json)

- `booksGoal` (integer, required): Number of books to finish in the period.
  - Constraints: minimum: 1
- `period` (string, required): weekly = Mon-Sun, monthly = calendar month, annual = calendar year.
  - Constraints: knownValues: weekly | monthly | annual
- `year` (integer, required): Calendar year the goal belongs to.
  - Constraints: minimum: 1900, maximum: 9999

### Output (application/json)

- `booksGoal` (integer, required): The goal that was written.
- `period` (string, required): The period that was written.
- `uri` (string · at-uri, required): AT-URI of the readingGoal record.
- `year` (integer, required): The year that was written.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Upsert the reading goal at rkey 'current'.",
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "booksGoal": {
              "description": "Number of books to finish in the period.",
              "minimum": 1,
              "type": "integer"
            },
            "period": {
              "description": "weekly = Mon-Sun, monthly = calendar month, annual = calendar year.",
              "knownValues": [
                "weekly",
                "monthly",
                "annual"
              ],
              "type": "string"
            },
            "year": {
              "description": "Calendar year the goal belongs to.",
              "maximum": 9999,
              "minimum": 1900,
              "type": "integer"
            }
          },
          "required": [
            "period",
            "year",
            "booksGoal"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "booksGoal": {
              "description": "The goal that was written.",
              "type": "integer"
            },
            "period": {
              "description": "The period that was written.",
              "type": "string"
            },
            "uri": {
              "description": "AT-URI of the readingGoal record.",
              "format": "at-uri",
              "type": "string"
            },
            "year": {
              "description": "The year that was written.",
              "type": "integer"
            }
          },
          "required": [
            "uri",
            "period",
            "year",
            "booksGoal"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Set the caller's reading goal. The readingGoal record lives at rkey 'current', which the getReadingGoal query reads.",
  "id": "net.olamaelcu.livtet.biblio.readingGoal.set",
  "lexicon": 1
}
```
