# Revoke a claim

Source: https://docs.musicnerd.net/api-reference/claims/revoke

Revoke a claim

## POST /api/admin/claims/{id}/revoke

Full OpenAPI specification: https://docs.musicnerd.net/spec/claims.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 claims",
    "version": "1.0.0",
    "description": "Claiming an artist profile and the admin review of claims. A signed-in user requests a claim and gets a reference code to send from the artist's official account; an admin then approves, rejects or revokes it."
  },
  "servers": [
    {
      "url": "https://musicnerd-api.vercel.app",
      "description": "Production"
    },
    {
      "url": "https://musicnerd-api-staging.vercel.app",
      "description": "Staging (staging database)"
    }
  ],
  "paths": {
    "/api/admin/claims/{id}/revoke": {
      "post": {
        "summary": "Revoke a claim",
        "operationId": "revokeClaim",
        "security": [
          {
            "adminBearer": []
          }
        ],
        "description": "Revokes an approved claim and deletes what the claimant added: their uploaded files, sources, Lore, interview and onboarding progress. The profile can then be claimed by someone else. This can't be undone.",
        "parameters": [
          {
            "$ref": "#/components/parameters/claimId"
          }
        ],
        "responses": {
          "200": {
            "description": "The claim is revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    }
                  }
                },
                "example": {
                  "status": "ok"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidClaimId"
          },
          "401": {
            "$ref": "#/components/responses/NotSignedIn"
          },
          "403": {
            "$ref": "#/components/responses/NotAdmin"
          },
          "404": {
            "$ref": "#/components/responses/ClaimNotFound"
          },
          "409": {
            "description": "The claim isn't approved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "Can only revoke approved claims"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "claimId": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "The claim's ID (a UUID).",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "3c0b6f9e-2d4a-4e8b-9f1c-5a7d2e6b8c41"
      }
    },
    "responses": {
      "InvalidClaimId": {
        "description": "`id` isn't a UUID.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "status": "error",
              "error": "Invalid claim ID"
            }
          }
        }
      },
      "NotSignedIn": {
        "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"
            }
          }
        }
      },
      "NotAdmin": {
        "description": "The user is not an admin.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "status": "error",
              "error": "Forbidden"
            }
          }
        }
      },
      "ClaimNotFound": {
        "description": "No claim with that ID.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "status": "error",
              "error": "Claim not found"
            }
          }
        }
      },
      "InternalError": {
        "description": "The database could not be read or written.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "status": "error",
              "error": "Internal server error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "error"
            ]
          },
          "error": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "adminBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Access token",
        "description": "A Music Nerd admin's access token. Copy it at https://musicnerd.net/access after signing in. A signed-in user who is not an admin gets 403."
      }
    }
  }
}
```
