Skip to content

Get Artists

Returns the artists your account is attached to. Row-level permissions scope the result automatically — a bare artists query returns your artists and no one else's, so no where clause is needed for the common case.

Request

graphql
query GetArtists {
  artists {
    id
    spotify_id
    name
    username
    avatar_url
    plan
    active_plan
    domains {
      id
      domain
    }
  }
}

Response

json
{
  "data": {
    "artists": [
      {
        "id": "3aad8009-a307-4429-a586-8b3dbe39cdda",
        "spotify_id": "1uNFoZAHBGtllmzznpCI3s",
        "name": "Example Artist",
        "username": "exampleartist",
        "avatar_url": "https://cdn.artisthub.io/avatars/....jpg",
        "plan": "pro",
        "active_plan": "pro",
        "domains": { "id": "b1f0...", "domain": "vibe.to" }
      }
    ]
  }
}

Fields

FieldTypeDescription
iduuid!The artist ID used by nearly every other operation.
spotify_idStringSpotify artist ID.
nameStringDisplay name.
usernameStringArtistHub handle.
avatar_urlStringProfile image URL.
planStringSubscribed plan.
active_planStringPlan currently in effect, which can differ from plan during a change or trial.
current_planStringPlan the billing system is charging for.
dsp_orderjsonbPreferred ordering of streaming services on this artist's links.
block_botsBooleanWhether bot traffic is filtered from this artist's links.
emails_enabledBooleanEmail capture enabled.
instagram_tokenStringConnected Instagram token, if any.
monthly_chargenumericCurrent monthly charge.
first_billing_date, next_billing_datedateBilling cycle.
braintree_subscription_statusStringBilling subscription state.
billing_user_iduuidThe user who pays for this artist.

Relationships

RelationshipKindDescription
linksarrayEvery smart link for this artist.
socialsarraySocial profiles rendered on bio links.
domainsobjectThe artist's default domain record.
custom_domain_artistsarrayCustom domains assigned to this artist.
pixelsarrayAd tracking pixels. See Tracking Pixels.
optinsarrayEmail opt-ins. See Get Subscribers.
usersarrayAccounts with access to this artist.

Useful variations

One artist with counts

graphql
query ArtistOverview($id: uuid!) {
  artists_by_pk(id: $id) {
    id
    name
    links_aggregate {
      aggregate {
        count
        sum { views_total clickthroughs_total }
      }
    }
    socials { type url }
  }
}
graphql
query ArtistWithLinks($id: uuid!) {
  artists_by_pk(id: $id) {
    id
    name
    links(order_by: { created_at: desc }, limit: 10) {
      id
      domain
      path
      title
      type
      views_total
      clickthroughs_total
    }
  }
}

Look up by Spotify ID

graphql
query BySpotify($spotify_id: String!) {
  artists(where: { spotify_id: { _eq: $spotify_id } }) {
    id
    name
  }
}

Updating an artist

A manager may update a limited set of columns:

billing_user_id, block_bots, dsp_order, emails_enabled, instagram_token, sms_available, sms_enabled

graphql
mutation UpdateArtist($id: uuid!) {
  update_artists_by_pk(
    pk_columns: { id: $id }
    _set: { block_bots: true, emails_enabled: true }
  ) {
    id
    block_bots
    emails_enabled
  }
}

name, spotify_id, and plan fields are managed by ArtistHub and cannot be set through the API.

Adding and removing artists

MutationPurpose
add_artist(artist_spotify_id: String!): AuthAttaches a Spotify artist to your account. Returns a refreshed Auth payload including a new token and the updated artist list.
delete_artist(artist_id: String!): SuccessBooleanDetaches and deletes an artist.
invite_user(email: String!, artist_id: String!, coupon: String): SuccessBooleanInvites another user to manage an artist.

WARNING

delete_artist is destructive and removes the artist's links along with it. There is no undo.

See also

ArtistHub developer documentation