# Claim an artist profile

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

Claim an artist profile

## POST /api/artist/{id}/claim

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/artist/{id}/claim": {
      "post": {
        "summary": "Claim an artist profile",
        "operationId": "claimArtistProfile",
        "security": [
          {
            "privyBearer": []
          }
        ],
        "description": "Requests a claim on the artist's profile for the caller and returns the reference code to send to @musicnerdnet on Instagram from the artist's official account. The claim stays pending until an admin approves it. A profile with a pending or approved claim can't be claimed again.",
        "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 claim is pending.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "referenceCode"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    },
                    "referenceCode": {
                      "type": "string",
                      "pattern": "^MN-[A-Z2-9]{4}$",
                      "description": "The code the claimant sends from the artist's account."
                    }
                  }
                },
                "example": {
                  "status": "ok",
                  "referenceCode": "MN-7KQ4"
                }
              }
            }
          },
          "400": {
            "description": "`id` isn't a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "Invalid artist ID"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/NotSignedIn"
          },
          "404": {
            "description": "No artist with that ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "Artist not found"
                }
              }
            }
          },
          "409": {
            "description": "The profile already has a pending or approved claim.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "This artist profile has already been claimed"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "error"
            ]
          },
          "error": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "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"
            }
          }
        }
      },
      "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"
            }
          }
        }
      }
    },
    "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."
      }
    }
  }
}
```
