# Read the Lore document

Source: https://docs.musicnerd.net/api-reference/artist-bio/knowledge-doc

Read the Lore document

## GET /api/artist/{id}/knowledge-doc

Full OpenAPI specification: https://docs.musicnerd.net/spec/artist-bio.json

## Authentication

This operation requires one of the security alternatives in the specification below. Security scheme definitions are included where present in the published specification.

[Authentication guide](https://docs.musicnerd.net/authentication)

## Operation and referenced schemas

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Music Nerd API: artist bio",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://musicnerd-api.vercel.app",
      "description": "Production"
    },
    {
      "url": "https://musicnerd-api-staging.vercel.app",
      "description": "Staging (staging database)"
    }
  ],
  "paths": {
    "/api/artist/{id}/knowledge-doc": {
      "get": {
        "summary": "Read the Lore document",
        "operationId": "getKnowledgeDoc",
        "security": [
          {
            "privyBearer": []
          }
        ],
        "description": "Returns the artist's Lore document, the numbered sources it cites, and the corrections the artist has made to it. Only the artist's approved claimant or an admin may read it. An artist with no document yet gets `content: null` and empty lists.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The artist's ID (a UUID).",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "aab92f80-f9e1-4299-aa33-7dd85c8de5d3"
          }
        ],
        "responses": {
          "200": {
            "description": "The document, its sources and its corrections.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeDoc"
                },
                "examples": {
                  "doc": {
                    "summary": "A document with one correction",
                    "value": {
                      "status": "ok",
                      "content": "Bio Ritmo is a salsa band from Richmond, Virginia, formed in 1991 [1].",
                      "sources": [
                        {
                          "id": 1,
                          "kind": "vault",
                          "label": "About · bioritmo.com",
                          "url": "https://www.bioritmo.com/about",
                          "publishedAt": null
                        }
                      ],
                      "corrections": [
                        {
                          "id": "8e1d2c3b-4a5f-4e6d-8c7b-9a0f1e2d3c4b",
                          "claim": "Bio Ritmo is a salsa band from Richmond, Virginia, formed in 1991.",
                          "correction": "Bio Ritmo is a salsa band from Richmond, Virginia, formed in 1985.",
                          "kind": "fix"
                        }
                      ]
                    }
                  },
                  "none": {
                    "summary": "No document yet",
                    "value": {
                      "status": "ok",
                      "content": null,
                      "sources": [],
                      "corrections": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`id` isn't a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "artistId must be a UUID"
                }
              }
            }
          },
          "401": {
            "description": "No token, an invalid or expired token, or no Music Nerd user for it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "Not signed in"
                }
              }
            }
          },
          "403": {
            "description": "The user is neither the artist's claimant nor an admin, or the artist's claim changed during the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "Not your artist"
                }
              }
            }
          },
          "500": {
            "description": "The read failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "Failed to load knowledge document"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "KnowledgeDoc": {
        "type": "object",
        "required": [
          "status",
          "content",
          "sources",
          "corrections"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          },
          "content": {
            "type": [
              "string",
              "null"
            ],
            "description": "The document as Markdown with `[n]` citation markers, or null when there is none."
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocSource"
            }
          },
          "corrections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocCorrection"
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "error"
            ]
          },
          "error": {
            "type": "string"
          }
        }
      },
      "DocSource": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "label",
          "url"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "The number the document cites as `[n]`."
          },
          "kind": {
            "type": "string",
            "enum": [
              "vault",
              "interview",
              "social"
            ]
          },
          "label": {
            "type": "string"
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null for an interview answer."
          },
          "publishedAt": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the source says it was published, if known."
          }
        }
      },
      "DocCorrection": {
        "type": "object",
        "required": [
          "id",
          "claim",
          "correction",
          "kind"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "claim": {
            "type": "string",
            "description": "The corrected claim, as stored."
          },
          "correction": {
            "type": [
              "string",
              "null"
            ],
            "description": "The artist's wording; null for `wrong`."
          },
          "kind": {
            "type": "string",
            "enum": [
              "wrong",
              "fix"
            ]
          }
        }
      }
    },
    "securitySchemes": {
      "privyBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Access token",
        "description": "The signed-in user's access token. Copy it at https://musicnerd.net/access after signing in. Each operation says who may call it: any signed-in user, or the artist's approved claimant or a Music Nerd admin."
      }
    }
  }
}
```
