# Remove an artist link

Source: https://docs.musicnerd.net/api-reference/artist-links/remove-artist-data

Remove an artist link

## POST /api/removeArtistData

Full OpenAPI specification: https://docs.musicnerd.net/spec/artist-links.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 links",
    "version": "1.0.0",
    "description": "Writing, ordering, checking and reviewing the platform links on an artist's profile."
  },
  "servers": [
    {
      "url": "https://musicnerd-api.vercel.app",
      "description": "Production"
    },
    {
      "url": "https://musicnerd-api-staging.vercel.app",
      "description": "Staging (staging database)"
    }
  ],
  "paths": {
    "/api/removeArtistData": {
      "post": {
        "summary": "Remove an artist link",
        "operationId": "postRemoveArtistData",
        "security": [
          {
            "privyBearer": []
          }
        ],
        "description": "Empties one platform link on an artist, for any whitelisted user or admin, not only the claimant. The contributor's original submission is kept so their credit stands. For `wallets`, only the artist's own ID is removed from the list. For Spotify or Deezer, disconnect requires `expectedValue`, the account ID actually displayed to the user (explicit null means an empty slot). The server rechecks the current identity, claim generation and authorization, archives the complete matching mapping provenance privately, removes that active mapping, clears the direct link and cancels pending identity-match jobs atomically. A stale or divergent mapping is refused for review. No exclusion is added, and a later explicit valid replacement still uses normal collision checks. The private archive is not returned.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "artistId",
                  "siteName"
                ],
                "properties": {
                  "artistId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "siteName": {
                    "type": "string",
                    "description": "The platform column to empty."
                  },
                  "expectedValue": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "description": "Required for Spotify/Deezer clear. Send the displayed account ID, not a freshly inferred replacement. Explicit null means already disconnected; omission is invalid. Other platforms do not require it."
                  }
                }
              },
              "example": {
                "artistId": "6cb3d81a-3d02-4c57-a711-bb7902a9af1b",
                "siteName": "instagram"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Removed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "success",
                    "message"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    },
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "status": "ok",
                  "success": true,
                  "message": "Artist data removed"
                }
              }
            }
          },
          "400": {
            "description": "The body is not JSON (`Invalid request body`) or a field is missing (`artistId and siteName are required`). Catalog disconnect without a valid `expectedValue` is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "artistId and siteName are required"
                }
              }
            }
          },
          "401": {
            "description": "No valid access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "Not signed in"
                }
              }
            }
          },
          "403": {
            "description": "The user is neither whitelisted nor an admin (`Unauthorized`), the column is not a writable link (`Invalid platform column`), or the write failed (`Error removing artist data`). Catalog writes recheck the current approved claim generation and live role; a changed claim or revoked role is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "Unauthorized"
                }
              }
            }
          },
          "409": {
            "description": "The displayed catalog identity or full mapping changed, or a retained mapping does not match the direct account. Refresh and review before retrying. No stale mapping is silently removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The user could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "Internal server error"
                }
              }
            }
          },
          "503": {
            "description": "Catalog disconnect could not be confirmed because its storage capability or transaction was unavailable. Refresh before retrying; a transport failure during commit can have an uncertain outcome. There is no field-only fallback.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "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. Link writes need the artist's approved claimant or a Music Nerd admin; `removeArtistData` accepts any whitelisted user too."
      }
    }
  }
}
```
