# Export the Lore document

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

Export the Lore document

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

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/export": {
      "get": {
        "summary": "Export the Lore document",
        "operationId": "getKnowledgeDocExport",
        "security": [
          {
            "privyBearer": []
          }
        ],
        "description": "Downloads the artist's Lore document as one self-contained Markdown file: a dated header, the document with its `[n]` citation markers, and the numbered sources it cites. `format=csv` returns the sources as a CSV table instead. Only the artist's approved claimant or an admin may export it.",
        "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"
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "`csv` for the source table. Anything else, or nothing, for the Markdown document.",
            "schema": {
              "type": "string",
              "enum": [
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file, as an attachment named `<artist-slug>-<date>.md` or `<artist-slug>-sources-<date>.csv`.",
            "headers": {
              "Content-Disposition": {
                "description": "`attachment; filename=\"bio-ritmo-2026-10-21.md\"`, or `...-sources-...csv`.",
                "schema": {
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "description": "`Content-Disposition`, so a cross-origin download can read the file name.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                },
                "example": "# Bio Ritmo\n\n> Verified profile compiled by Music Nerd from 2 sources, exported 2026-10-21.\n> Bracketed numbers in the text refer to the numbered sources at the end.\n\nBio Ritmo is a salsa band from Richmond, Virginia, formed in 1991 [1].\n\n## Sources\n\n1. About · bioritmo.com — https://www.bioritmo.com/about\n2. Interview answer: how the band started"
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                },
                "example": "id,kind,label,url,published\n\"1\",\"vault\",\"About · bioritmo.com\",\"https://www.bioritmo.com/about\",\"\"\n\"2\",\"interview\",\"Interview answer: how the band started\",\"\",\"\""
              }
            }
          },
          "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.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "Not your artist"
                }
              }
            }
          },
          "404": {
            "description": "No such artist, or no Lore document yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "No knowledge document yet"
                }
              }
            }
          },
          "500": {
            "description": "The export failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "Export failed"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "error"
            ]
          },
          "error": {
            "type": "string"
          }
        }
      }
    },
    "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."
      }
    }
  }
}
```
