# Remove sources

Source: https://docs.musicnerd.net/api-reference/vault/remove-sources

Remove sources

## DELETE /api/artist/{id}/knowledge/sources

Full OpenAPI specification: https://docs.musicnerd.net/spec/vault.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: vault",
    "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/sources": {
      "delete": {
        "summary": "Remove sources",
        "operationId": "removeArtistSources",
        "security": [
          {
            "privyBearer": []
          }
        ],
        "description": "Deletes several of the artist's sources at once and starts a Lore refresh. Nothing is deleted unless every ID belongs to the artist. Returns how many were deleted.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The artist's ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sourceIds"
                ],
                "properties": {
                  "sourceIds": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 200,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "description": "The sources to delete."
                  }
                }
              },
              "example": {
                "sourceIds": [
                  "2c6f1c6e-4f0a-4b9b-8a6a-3b1f0b2d9e71",
                  "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The sources were deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "count"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    },
                    "count": {
                      "type": "integer",
                      "minimum": 1,
                      "description": "How many sources were deleted."
                    }
                  }
                },
                "example": {
                  "status": "ok",
                  "count": 2
                }
              }
            }
          },
          "400": {
            "description": "`id` isn't a UUID, or `sourceIds` is missing, empty, over 200 long or holds a value that isn't a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "badId": {
                    "summary": "`id` isn't a UUID",
                    "value": {
                      "status": "error",
                      "error": "artistId must be a UUID"
                    }
                  },
                  "badIds": {
                    "summary": "A bad `sourceIds`",
                    "value": {
                      "status": "error",
                      "error": "sourceIds must be 1 to 200 source IDs"
                    }
                  }
                }
              }
            }
          },
          "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 approved claimant nor an admin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "Not your artist"
                }
              }
            }
          },
          "404": {
            "description": "One or more IDs don't belong to the artist. Nothing was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "One or more sources not found"
                }
              }
            }
          },
          "500": {
            "description": "The sources could not be deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "Failed to delete sources"
                }
              }
            }
          }
        }
      }
    }
  },
  "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. The user must be the artist's approved claimant or a Music Nerd admin."
      }
    }
  }
}
```
