# Your artists

Source: https://docs.musicnerd.net/api-reference/users/profile-artists

Your artists

## GET /api/profile/artists

Full OpenAPI specification: https://docs.musicnerd.net/spec/users.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: users and profile",
    "version": "1.0.0",
    "description": "The signed-in user's own account and profile: their user name, profile photo, approved claim, contributed artists, contribution summary and the updates feed. Every route answers about the caller only; the account comes from the token, never from the request."
  },
  "servers": [
    {
      "url": "https://musicnerd-api.vercel.app",
      "description": "Production"
    },
    {
      "url": "https://musicnerd-api-staging.vercel.app",
      "description": "Staging (staging database)"
    }
  ],
  "paths": {
    "/api/profile/artists": {
      "get": {
        "summary": "Your artists",
        "operationId": "getProfileArtists",
        "security": [
          {
            "privyBearer": []
          }
        ],
        "description": "The artists the caller has contributed to (added, had a link accepted on, or edited as the claimant), 24 per page in name order, with an optional name search. `imageUrl` is the stored portrait when it is a local path or a credential-free HTTPS URL, else null.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProfileAccountRequired"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Where the page starts. Up to six digits; defaults to 0.",
            "schema": {
              "type": "string",
              "pattern": "^\\d{1,6}$",
              "default": "0"
            },
            "example": "0"
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "A case-insensitive name search, up to 200 characters.",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "example": "ritmo"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of artists. `Cache-Control: private, no-store`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "userId",
                    "artists",
                    "total",
                    "next"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    },
                    "userId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "artists": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProfileArtist"
                      }
                    },
                    "total": {
                      "type": "integer",
                      "description": "How many artists match."
                    },
                    "next": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "The `offset` for the next page, or null on the last page."
                    }
                  }
                },
                "example": {
                  "status": "ok",
                  "userId": "6f1d2e3a-4b5c-4d6e-8f90-a1b2c3d4e5f6",
                  "artists": [
                    {
                      "artistId": "aab92f80-f9e1-4299-aa33-7dd85c8de5d3",
                      "artistName": "Bio Ritmo",
                      "imageUrl": null
                    }
                  ],
                  "total": 1,
                  "next": null
                }
              }
            }
          },
          "400": {
            "description": "`offset` isn't one to six digits, or `q` is longer than 200 characters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "Invalid artist search"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/NotSignedIn"
          },
          "409": {
            "$ref": "#/components/responses/AccountChanged"
          },
          "503": {
            "description": "The database could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "Could not load your artists"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "ProfileAccountRequired": {
        "name": "X-Profile-Account",
        "in": "header",
        "required": true,
        "description": "The user id the page believes is signed in. Must equal the token's user, or the response is 409 so the page can refresh instead of showing another account's data.",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "6f1d2e3a-4b5c-4d6e-8f90-a1b2c3d4e5f6"
      }
    },
    "schemas": {
      "ProfileArtist": {
        "type": "object",
        "required": [
          "artistId",
          "artistName",
          "imageUrl"
        ],
        "properties": {
          "artistId": {
            "type": "string",
            "format": "uuid"
          },
          "artistName": {
            "type": "string",
            "description": "The artist's name, or `Unknown artist`."
          },
          "imageUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "A local path or credential-free HTTPS URL, or null."
          }
        }
      },
      "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"
            }
          }
        }
      },
      "AccountChanged": {
        "description": "`X-Profile-Account` is missing or is not the caller's id.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "status": "error",
              "error": "Account changed. Refresh and try again."
            }
          }
        }
      }
    },
    "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. Every route here answers about that user only."
      }
    }
  }
}
```
