Skip to content
LydieDevelopers
Menu

Change a database's properties

View as Markdown
POST/v1/databases/{databaseId}/schema

Adds, changes and removes properties in one step. update can rename (name), change the type (values are converted), the frontmatter key or the config (options, relation, number format, formula expression). Removed properties keep their values in the rows.

docs:writeUndoableCannot be undone
Request
curl -X POST "https://api.lydie.co/v1/databases/01JCQ3V5MZ8G4ZK2X7T9R6N1PB/schema" \
  -H "Authorization: Bearer $LYDIE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Path parameters

Body

  • addobject[]

    Default []

    Show 4 fields
    • namestringrequired· 1–200 chars
    • typestringrequired

      One oftitletextnumberselectmultiSelectstatusdatecheckboxurlemailphonepersonfilesrelationrollupformulauniqueIdcreatedTimeupdatedTimecreatedByupdatedBy

    • keystring· 1–128 chars
    • configPropertyConfigSpecInput
      Show 11 fields
      • optionsobject[]

        select, multiSelect, status

        Show 4 fields
        • idULID
        • namestringrequired· 1–200 chars
        • colorstring

          One ofdefaultgraybrownorangeyellowgreenbluepurplepinkred

          Default "default"

        • groupstring

          One oftodoinProgresscomplete

      • One ofnumberintegercommaspercentcurrency

      • decimalsinteger· 0–10
      • currencystring· 3–3 chars

        ISO 4217 code, with numberFormat currency

      • date: values carry a time

      • rangeboolean

        date: values may carry an end (start/end)

      • relationRelationConfigInput
        Show 4 fields
        • databaseIdULIDrequired

          The database whose rows this relation points at.

        • twoWayboolean

          Default false

        • The synced property on the other database (two-way relations).

          Default null

        • limitstring

          One ofonemany

          Default "many"

      • rollupRollupConfigInput
        Show 3 fields
        • relationPropertyIdULIDrequired
        • targetPropertyIdULIDrequired

          A property of the related database.

        • functionstringrequired

          One ofshowOriginalshowUniquecountcountValuescountUniquecountEmptycountNotEmptypercentEmptypercentNotEmptysumaveragemedianminmaxrangeearliestlatestcheckeduncheckedpercentCheckedpercentUnchecked

      • formula: an Obsidian Bases expression

      • prefixstring· ≤ 16 chars

        uniqueId: shown before the number ("LYD" → LYD-12)

      • extraobject
  • updateobject[]

    Default []

    Show 5 fields
    • propertystringrequired· ≥ 1 chars

      A property's id, frontmatter key or name (case-insensitive).

    • namestring· 1–200 chars
    • typestring

      One oftitletextnumberselectmultiSelectstatusdatecheckboxurlemailphonepersonfilesrelationrollupformulauniqueIdcreatedTimeupdatedTimecreatedByupdatedBy

    • keystring· 1–128 chars
    • configPropertyConfigSpecInput
      Show 11 fields
      • optionsobject[]

        select, multiSelect, status

        Show 4 fields
        • idULID
        • namestringrequired· 1–200 chars
        • colorstring

          One ofdefaultgraybrownorangeyellowgreenbluepurplepinkred

          Default "default"

        • groupstring

          One oftodoinProgresscomplete

      • One ofnumberintegercommaspercentcurrency

      • decimalsinteger· 0–10
      • currencystring· 3–3 chars

        ISO 4217 code, with numberFormat currency

      • date: values carry a time

      • rangeboolean

        date: values may carry an end (start/end)

      • relationRelationConfigInput
        Show 4 fields
        • databaseIdULIDrequired

          The database whose rows this relation points at.

        • twoWayboolean

          Default false

        • The synced property on the other database (two-way relations).

          Default null

        • limitstring

          One ofonemany

          Default "many"

      • rollupRollupConfigInput
        Show 3 fields
        • relationPropertyIdULIDrequired
        • targetPropertyIdULIDrequired

          A property of the related database.

        • functionstringrequired

          One ofshowOriginalshowUniquecountcountValuescountUniquecountEmptycountNotEmptypercentEmptypercentNotEmptysumaveragemedianminmaxrangeearliestlatestcheckeduncheckedpercentCheckedpercentUnchecked

      • formula: an Obsidian Bases expression

      • prefixstring· ≤ 16 chars

        uniqueId: shown before the number ("LYD" → LYD-12)

      • extraobject
  • removestring[]

    Default []

Response

  • idULID
  • propertiesobject[]
    Show 4 fields
    • idULID
    • namestring
    • typestring

      One oftitletextnumberselectmultiSelectstatusdatecheckboxurlemailphonepersonfilesrelationrollupformulauniqueIdcreatedTimeupdatedTimecreatedByupdatedBy

    • keystring
  • viewsobject[]
    Show 3 fields
    • idULID
    • namestring
    • typestring

      One oftableboardlistcalendargallery

200
{
  "id": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
  "properties": [
    {
      "id": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
      "name": "Notes",
      "type": "title",
      "key": "string"
    }
  ],
  "views": [
    {
      "id": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
      "name": "Notes",
      "type": "table"
    }
  ]
}

Errors use one envelope for every endpoint. See Errors and versions.