Skip to content
AniLink

AniList mutation operations

The authenticated AniList GraphQL mutation operations, grouped by response domain.

Users

anilist.mutation.updateUser

UpdateUserMutation updates a user on the AniList API.

Signature

TypeScript
updateUser(variables: UpdateUserVariables, options?: RequestOptions): Promise<UpdateUserResponse>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
aboutstringnoa string representing the updated about section of the user.
titleLanguageUserTitleLanguagenoa UserTitleLanguage representing the updated title language preference of the user.
displayAdultContentbooleannoa boolean representing the updated preference of the user for displaying adult content.
airingNotificationsbooleannoa boolean representing the updated preference of the user for receiving airing notifications.
scoreFormatScoreFormatnoa ScoreFormat representing the updated score format preference of the user.
rowOrderstringnoa string representing the updated row order preference of the user.
profileColorstringnoa string representing the updated profile color preference of the user.
donatorBadgestringnoa string representing the updated donator badge of the user.
notificationOptionsNotificationOptions[]noan array of NotificationOptions representing the updated notification options of the user.
timezonestringnoa string representing the updated timezone of the user.
activityMergeTimenumbernoa number representing the updated activity merge time of the user.
animeListOptionsMediaListOptionsnoa MediaListOptions representing the updated anime list options of the user.
mangaListOptionsMediaListOptionsnoa MediaListOptions representing the updated manga list options of the user.
staffNameLanguageUserStaffNameLanguagenoa UserStaffNameLanguage representing the updated staff name language preference of the user.
restrictMessagesToFollowingbooleannoa boolean representing the updated preference of the user for restricting messages to following.
disabledListActivityDisabledListActivity[]noan array of DisabledListActivity representing the updated disabled list activity preferences of the user.

See the TypeDoc page for the full UpdateUserResponse shape.

  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.updateUser({
  about: 'New about text',
  titleLanguage: 'ENGLISH',
  displayAdultContent: true,
  airingNotifications: true,
  scoreFormat: 'POINT_10',
  rowOrder: 'title',
  profileColor: 'blue',
  donatorBadge: 'Supporter',
  notificationOptions: [{type: 'AIRING', enabled: true}],
  timezone: '-06:00',
  activityMergeTime: 30,
  animeListOptions: {sectionOrder: ['title'], customLists: ['test'], advancedScoring: [], advancedScoringEnabled: false},
  mangaListOptions: {sectionOrder: ['title'], customLists: ['test'], advancedScoring: [], advancedScoringEnabled: false},
  staffNameLanguage: 'ROMAJI',
  restrictMessagesToFollowing: false,
  disabledListActivity: [{type: 'CURRENT', disabled: false}]
});

anilist.mutation.toggleFavourite

ToggleFavouriteMutation toggles a favourite on the AniList API.

Signature

TypeScript
toggleFavourite(variables: ToggleFavouriteVariables, options?: RequestOptions): Promise<Favourites>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
animeIdnumberyesa number representing the id of the anime to toggle as a favourite.
mangaIdnumberyesa number representing the id of the manga to toggle as a favourite.
characterIdnumberyesa number representing the id of the character to toggle as a favourite.
staffIdnumberyesa number representing the id of the staff to toggle as a favourite.
studioIdnumberyesa number representing the id of the studio to toggle as a favourite.
FieldTypeDescription
idnumberThe id of the connection
idnumberThe id of the media
romajistringThe romanization of the native language title
englishstringThe official english title
nativestringOfficial title in it's native language
userPreferredstringThe currently authenticated users preferred title language. Default romaji for non-authenticated
idnumberThe id of the media
romajistringThe romanization of the native language title
englishstringThe official english title
nativestringOfficial title in it's native language
userPreferredstringThe currently authenticated users preferred title language. Default romaji for non-authenticated
idnumberThe id of the connection
idnumberThe id of the media
romajistringThe romanization of the native language title
englishstringThe official english title
nativestringOfficial title in it's native language
userPreferredstringThe currently authenticated users preferred title language. Default romaji for non-authenticated
idnumberThe id of the media
romajistringThe romanization of the native language title
englishstringThe official english title
nativestringOfficial title in it's native language
userPreferredstringThe currently authenticated users preferred title language. Default romaji for non-authenticated
idnumberThe id of the connection
idnumberThe id of the character
fullstringThe character's first and last name
idnumberThe id of the character
fullstringThe character's first and last name
idnumberThe id of the connection
idnumberThe id of the staff member
fullstringThe person's first and last name
idnumberThe id of the staff member
fullstringThe person's first and last name
idnumberThe id of the connection
idnumberThe id of the studio
namestringThe name of the studio
idnumberThe id of the studio
namestringThe name of the studio
  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.toggleFavourite({studioId: 561});

anilist.mutation.updateFavouriteOrder

UpdateFavouriteOrderMutation updates the order of favourites on the AniList API.

Signature

TypeScript
updateFavouriteOrder(variables: UpdateFavouriteOrderVariables, options?: RequestOptions): Promise<Favourites>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
animeIdsnumber[]yesan array of numbers representing the ids of the anime to update the order of.
mangaIdsnumber[]yesan array of numbers representing the ids of the manga to update the order of.
characterIdsnumber[]yesan array of numbers representing the ids of the characters to update the order of.
staffIdsnumber[]yesan array of numbers representing the ids of the staff to update the order of.
studioIdsnumber[]yesan array of numbers representing the ids of the studios to update the order of.
animeOrdernumber[]yesan array of numbers representing the order of the anime.
mangaOrdernumber[]yesan array of numbers representing the order of the manga.
characterOrdernumber[]yesan array of numbers representing the order of the characters.
staffOrdernumber[]yesan array of numbers representing the order of the staff.
studioOrdernumber[]yesan array of numbers representing the order of the studios.
FieldTypeDescription
idnumberThe id of the connection
idnumberThe id of the media
romajistringThe romanization of the native language title
englishstringThe official english title
nativestringOfficial title in it's native language
userPreferredstringThe currently authenticated users preferred title language. Default romaji for non-authenticated
idnumberThe id of the media
romajistringThe romanization of the native language title
englishstringThe official english title
nativestringOfficial title in it's native language
userPreferredstringThe currently authenticated users preferred title language. Default romaji for non-authenticated
idnumberThe id of the connection
idnumberThe id of the media
romajistringThe romanization of the native language title
englishstringThe official english title
nativestringOfficial title in it's native language
userPreferredstringThe currently authenticated users preferred title language. Default romaji for non-authenticated
idnumberThe id of the media
romajistringThe romanization of the native language title
englishstringThe official english title
nativestringOfficial title in it's native language
userPreferredstringThe currently authenticated users preferred title language. Default romaji for non-authenticated
idnumberThe id of the connection
idnumberThe id of the character
fullstringThe character's first and last name
idnumberThe id of the character
fullstringThe character's first and last name
idnumberThe id of the connection
idnumberThe id of the staff member
fullstringThe person's first and last name
idnumberThe id of the staff member
fullstringThe person's first and last name
idnumberThe id of the connection
idnumberThe id of the studio
namestringThe name of the studio
idnumberThe id of the studio
namestringThe name of the studio
  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.updateFavouriteOrder({
  animeIds: [1],
  mangaIds: [],
  characterIds: [],
  staffIds: [],
  studioIds: [],
  animeOrder: [1],
  mangaOrder: [],
  characterOrder: [],
  staffOrder: [],
  studioOrder: [],
});

Lists

anilist.mutation.saveMediaListEntry

SaveMediaListEntryMutation saves a media list entry on the AniList API.

Signature

TypeScript
saveMediaListEntry(variables: SaveMediaListEntryVariables, options?: RequestOptions): Promise<MediaListResponse>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
idnumbernoa number representing the id of the media list entry.
mediaIdnumberyesa number representing the id of the media associated with the media list entry.
statusMediaListStatusnoa MediaListStatus representing the status of the media list entry.
scorenumbernoa number representing the score of the media list entry.
scoreRawnumbernoa number representing the raw score of the media list entry.
progressnumbernoa number representing the progress of the media list entry.
progressVolumesnumbernoa number representing the progress volumes of the media list entry.
repeatnumbernoa number representing the repeat status of the media list entry.
prioritynumbernoa number representing the priority of the media list entry.
privatebooleannoa boolean representing the privacy status of the media list entry.
notesstringnoa string representing the notes of the media list entry.
hiddenFromStatusListsbooleannoa boolean representing whether the media list entry is hidden from status lists.
customListsstring[]noan array of strings representing the custom lists of the media list entry.
advancedScoresnumber[]noan array of numbers representing the advanced scores of the media list entry.
startedAtFuzzyDateInputnoa FuzzyDateInput representing when the media list entry started.
completedAtFuzzyDateInputnoa FuzzyDateInput representing when the media list entry was completed.
FieldTypeDescription
idnumberThe id of the list entry
userIdnumberThe id of the user owner of the list entry
mediaIdnumberThe id of the media
statusstringThe watching/reading status
scorenumberThe score of the entry
progressnumberThe amount of episodes/chapters consumed by the user
progressVolumesnumberThe amount of volumes read by the user
repeatnumberThe amount of times the user has rewatched/read the media
prioritynumberPriority of planning
privatebooleanIf the entry should only be visible to authenticated user
notesstringText notes
hiddenFromStatusListsbooleanIf the entry shown be hidden from non-custom lists
customListsstring[] | boolean[]Map of booleans for which custom lists the entry are in
advancedScoresunknownMap of advanced scores with name keys
startedAtFuzzyDateWhen the entry was started by the user
completedAtFuzzyDateWhen the entry was completed by the user
updatedAtnumberWhen the entry data was last updated
createdAtnumberWhen the entry data was created
mediaMediaan instance of `Media` representing the media.
  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.saveMediaListEntry({mediaId: 1, status: 'COMPLETED'});

anilist.mutation.deleteMediaListEntry

DeleteMediaListEntryMutation deletes a media list entry on the AniList API.

Signature

TypeScript
deleteMediaListEntry(variables: DeleteMediaListEntryVariables, options?: RequestOptions): Promise<DeleteMediaListEntryResponse>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
idnumberyesa number representing the media list entry ID.
FieldTypeDescription
deletedbooleanIf an item has been successfully deleted
  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
const result = await new DeleteMediaListEntryMutation("your-token").deleteMediaListEntry({ id: 1 });

Misc

anilist.mutation.deleteCustomList

DeleteCustomListMutation deletes a custom list on the AniList API. There is no mutation specifically for creating a custom list; create one through UpdateUserMutation under the animeListOptions or mangaListOptions variables.

Signature

TypeScript
deleteCustomList(variables: DeleteCustomListVariables, options?: RequestOptions): Promise<DeleteResult>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
customListstringyesa string representing the custom list to delete.
typeMediaTypeyesa string representing the type of the media.

See the TypeDoc page for the full DeleteResult shape.

  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.deleteCustomList({customList: 'test', type: 'ANIME'});

anilist.mutation.toggleFollow

ToggleFollowMutation toggles a follow on the AniList API.

Signature

TypeScript
toggleFollow(variables: ToggleFollowVariables, options?: RequestOptions): Promise<UserResponse>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
userIdnumberyesa number representing the id of the user to follow.
FieldTypeDescription
idnumberThe id of the user
namestringThe name of the user
aboutstringThe bio written by user (Markdown)
largestringThe avatar of user at its largest size
mediumstringThe avatar of user at medium size
bannerImagestringThe user's banner images
isFollowingbooleanIf the authenticated user if following this user
isFollowerbooleanIf this user if following the authenticated user
isBlockedbooleanIf the user is blocked by the authenticated user
bansstring[]List of active bans. Mod-only
titleLanguageUserTitleLanguageThe language the user wants to see media titles in
displayAdultContentbooleanWhether the user has enabled viewing of 18+ content
airingNotificationsbooleanWhether the user receives notifications when a show they are watching aires
profileColorstringProfile highlight color (blue, purple, pink, orange, red, green, gray)
typeNotificationTypeThe type of notification
enabledbooleanWhether this type of notification is enabled
timezonestringThe user's timezone offset (Auth user only)
activityMergeTimenumberMinutes between activity for them to be merged together. 0 is Never, Above 2 weeks (20160 mins) is Always.
staffNameLanguageUserStaffNameLanguageThe language the user wants to see staff and character names in
restrictMessagesToFollowingbooleanWhether the user only allow messages from users they follow
disabledbooleana boolean value representing the disabled.
typeNotificationTypea NotificationType value representing the type.
scoreFormatScoreFormatThe score format the user is using for media lists
rowOrderstringThe default order list rows should be displayed in
sectionOrderstring[]The order each list should be displayed in
splitCompletedSectionByFormatbooleanIf the completed sections of the list should be separated by format
customListsstring[]The names of the user's custom lists
advancedScoringstring[]The names of the user's advanced scoring sections
advancedScoringEnabledbooleanIf advanced scoring is enabled
sectionOrderstring[]The order each list should be displayed in
splitCompletedSectionByFormatbooleanIf the completed sections of the list should be separated by format
customListsstring[]The names of the user's custom lists
advancedScoringstring[]The names of the user's advanced scoring sections
advancedScoringEnabledbooleanIf advanced scoring is enabled
idnumberThe id of the media
romajistringThe romanization of the native language title
englishstringThe official english title
nativestringOfficial title in it's native language
userPreferredstringThe currently authenticated users preferred title language. Default romaji for non-authenticated
idnumberThe id of the media
romajistringThe romanization of the native language title
englishstringThe official english title
nativestringOfficial title in it's native language
userPreferredstringThe currently authenticated users preferred title language. Default romaji for non-authenticated
idnumberThe id of the media
romajistringThe romanization of the native language title
englishstringThe official english title
nativestringOfficial title in it's native language
userPreferredstringThe currently authenticated users preferred title language. Default romaji for non-authenticated
idnumberThe id of the media
romajistringThe romanization of the native language title
englishstringThe official english title
nativestringOfficial title in it's native language
userPreferredstringThe currently authenticated users preferred title language. Default romaji for non-authenticated
charactersunknown[]Favourite characters
staffunknown[]Favourite staff
studiosunknown[]Favourite studios
statisticsStatisticsThe users anime & manga list statistics
statsUserStatsThe user's statistics
unreadNotificationCountnumberThe number of unread notifications the user has
siteUrlstringThe url for the user page on the AniList website
donatorTiernumberThe donation tier of the user
donatorBadgestringCustom donation badge text
moderatorRolesstring[]The user's moderator roles if they are a site moderator
createdAtnumberWhen the user's account was created. (Does not exist for accounts created before 2020)
updatedAtnumberWhen the user's data was last updated
namestringA previous name of the user.
createdAtnumberWhen the user first changed from this name.
updatedAtnumberWhen the user most recently changed from this name.
  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.toggleFollow({userId: 542244});

anilist.mutation.rateReview

RateReviewMutation rates a review on the AniList API.

Signature

TypeScript
rateReview(variables: RateReviewVariables, options?: RequestOptions): Promise<ReviewResponse>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
reviewIdnumberyesa number representing the id of the review to rate.
ratingReviewRatingyesa ReviewRating representing the vote to apply to the review.
FieldTypeDescription
idnumberThe id of the review
mediaIdnumberThe id of the review's media
userIdnumberThe id of the review's creator
mediaTypestringFor which type of media the review is for
summarystringA short summary of the review
bodystringThe main review body text
ratingnumberThe total user rating of the review
ratingAmountnumberThe amount of user ratings of the review
scorenumberThe review score of the media
privatebooleanIf the review is not yet publicly published and is only viewable by creator
siteUrlstringThe url for the review page on the AniList website
createdAtnumberThe time of the thread creation
updatedAtnumberThe time of the thread last update
userBasicUserThe creator of the review
mediaMediaThe media the review is of
  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.rateReview({reviewId: 8008, rating: 'UP_VOTE'});

anilist.mutation.updateAniChartSettings

UpdateAniChartSettingsMutation updates the AniChart settings for a user on the AniList API.

Signature

TypeScript
updateAniChartSettings(variables: UpdateAniChartSettingsVariables, options?: RequestOptions): Promise<string>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
titleLanguagestringyesa string representing the language of the title.
outgoingLinkProviderstringyesa string representing the outgoing link provider.
themestringyesa string representing the theme of the AniChart.
sortstringyesa string representing the sort order of the AniChart.

See the TypeDoc page for the full string shape.

  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.updateAniChartSettings({
  titleLanguage: 'romaji',
  outgoingLinkProvider: 'ANILIST',
  theme: 'dark',
  sort: 'POPULARITY',
});

anilist.mutation.updateAniChartHighlights

UpdateAniChartHighlightsMutation updates the AniChart highlights for a user on the AniList API.

Signature

TypeScript
updateAniChartHighlights(variables: UpdateAniChartHighlightsVariables, options?: RequestOptions): Promise<string>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
mediaIdnumberyesa number representing the media ID.
highlightbooleanyesa boolean representing the highlight status.

See the TypeDoc page for the full string shape.

  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.updateAniChartHighlights({
  highlights: {mediaId: 1, highlight: true},
});

Activity

anilist.mutation.saveTextActivity

SaveTextActivityMutation saves a text activity on the AniList API.

Signature

TypeScript
saveTextActivity(variables: SaveTextActivityVariables, options?: RequestOptions): Promise<Activity>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
idnumberyesa number representing the id of the activity.
textstringnoa string representing the text of the activity.
lockedbooleannoa boolean representing whether the activity is locked.
asHtmlbooleannoa boolean representing whether the activity text is returned as HTML.

See the TypeDoc page for the full Activity shape.

  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.saveTextActivity({id: 1, text: 'Hello, world!'});

anilist.mutation.saveMessageActivity

SaveMessageActivityMutation saves a message activity on the AniList API.

Signature

TypeScript
saveMessageActivity(variables: SaveMessageActivityVariables, options?: RequestOptions): Promise<Activity>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
idnumberyesa number representing the id of the activity.
messagestringnoa string representing the message.
recipientIdnumbernoa number representing the id of the recipient.
privatebooleannoa boolean representing whether the message is private.
lockedbooleannoa boolean representing whether the message is locked.
asModbooleannoa boolean representing whether the activity is saved as a moderator.
asHtmlbooleannoa boolean representing whether the description in the return response is in HTML format.

See the TypeDoc page for the full Activity shape.

  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.saveMessageActivity({id: 1, message: 'Hello, world!'});

anilist.mutation.saveListActivity

SaveListActivityMutation saves a list activity on the AniList API. Mod Only

Signature

TypeScript
saveListActivity(variables: SaveListActivityVariables, options?: RequestOptions): Promise<Activity>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
idnumberyesa number representing the id of the list activity.
lockedbooleannoa boolean representing whether the list activity is locked.
asHtmlbooleannoa boolean representing whether the list activity is in HTML format.

See the TypeDoc page for the full Activity shape.

  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.saveListActivity({id: 1});

anilist.mutation.deleteActivity

DeleteActivityMutation deletes an activity on the AniList API. Mod Only

Signature

TypeScript
deleteActivity(variables: DeleteActivityVariables, options?: RequestOptions): Promise<DeleteResult>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
idnumberyesa number representing the id of the activity.

See the TypeDoc page for the full DeleteResult shape.

  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.deleteActivity({id: 1});

anilist.mutation.toggleActivityPin

ToggleActivityPinMutation toggles the pin status of an activity on the AniList API.

Signature

TypeScript
toggleActivityPin(variables: ToggleActivityPinVariables, options?: RequestOptions): Promise<Activity>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
idnumberyesa number representing the id of the activity.
pinnedbooleannoa boolean representing whether the activity is pinned.
asHtmlbooleannoa boolean representing whether the activity descriptions is in HTML format.

See the TypeDoc page for the full Activity shape.

  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.toggleActivityPin({id: 1, pinned: true});

anilist.mutation.toggleActivitySubscription

ToggleActivitySubscriptionMutation toggles the subscription status of an activity on the AniList API.

Signature

TypeScript
toggleActivitySubscription(variables: ToggleActivitySubscriptionVariables, options?: RequestOptions): Promise<Activity>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
activityIdnumberyesa number representing the id of the activity.
subscribebooleanyesa boolean representing whether the activity is subscribed.
asHtmlbooleannoa boolean representing whether the activity descriptions is in HTML format.

See the TypeDoc page for the full Activity shape.

  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.toggleActivitySubscription({activityId: 1, subscribe: true});

anilist.mutation.saveActivityReply

SaveActivityReplyMutation saves an activity reply on the AniList API.

Signature

TypeScript
saveActivityReply(variables: SaveActivityReplyVariables, options?: RequestOptions): Promise<ActivityReply>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
idnumberyesa number representing the id of the activity reply.
activityIdnumbernoa number representing the id of the activity.
textstringyesa string representing the text of the activity reply.
asModbooleannoa boolean representing the locked status of the activity reply.
asHtmlbooleannoa boolean representing the status of the activity reply.
FieldTypeDescription
idnumberThe id of the reply
userIdnumberThe id of the replies creator
activityIdnumberThe id of the parent activity
textstringThe reply text
likeCountnumberThe amount of likes the reply has
isLikedbooleanIf the currently authenticated user liked the reply
createdAtnumberThe time the reply was created at
userBasicUserThe user who created reply
likesBasicUser[]The users who liked the reply
  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.saveActivityReply({id: 1, activityId: 2, text: 'Hello, world!'});

anilist.mutation.deleteActivityReply

DeleteActivityReplyMutation deletes an activity reply on the AniList API.

Signature

TypeScript
deleteActivityReply(variables: DeleteActivityReplyVariables, options?: RequestOptions): Promise<DeleteResult>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
idnumberyesa number representing the id of the activity reply.

See the TypeDoc page for the full DeleteResult shape.

  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.deleteActivityReply({id: 1});

anilist.mutation.toggleLike

ToggleLikeMutation toggles a like on the AniList API.

Signature

TypeScript
toggleLike(variables: ToggleLikeVariables, options?: RequestOptions): Promise<BasicUser>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
idnumberyesa number representing the id of the likeable object.
typeLikeableTypeyesa string representing the type of the likeable object.
FieldTypeDescription
idnumberThe id of the user
namestringThe name of the user
largestringThe avatar of user at its largest size
  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.toggleLike({id: 1, type: 'ACTIVITY'});

Reviews

anilist.mutation.saveReview

SaveReviewMutation saves a review on the AniList API.

Signature

TypeScript
saveReview(variables: SaveReviewVariables, options?: RequestOptions): Promise<ReviewResponse>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
idnumberyesthe ID of the review.
mediaIdnumberyesthe ID of the media.
bodystringyesthe body of the review.
summarystringyesthe summary of the review.
scorenumberyesthe score of the review.
privatebooleanyesa boolean that determines if the review is private.
asHtmlbooleannoa boolean that determines if the review is in HTML format.
FieldTypeDescription
idnumberThe id of the review
mediaIdnumberThe id of the review's media
userIdnumberThe id of the review's creator
mediaTypestringFor which type of media the review is for
summarystringA short summary of the review
bodystringThe main review body text
ratingnumberThe total user rating of the review
ratingAmountnumberThe amount of user ratings of the review
scorenumberThe review score of the media
privatebooleanIf the review is not yet publicly published and is only viewable by creator
siteUrlstringThe url for the review page on the AniList website
createdAtnumberThe time of the thread creation
updatedAtnumberThe time of the thread last update
userBasicUserThe creator of the review
mediaMediaThe media the review is of
  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.saveReview({id: 1, mediaId: 1, body: 'testing', summary: 'testing', score: 8, private: true});

anilist.mutation.deleteReview

DeleteReviewMutation deletes a review on the AniList API.

Signature

TypeScript
deleteReview(variables: DeleteReviewVariables, options?: RequestOptions): Promise<DeleteResult>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
idnumberyesthe ID of the review.

See the TypeDoc page for the full DeleteResult shape.

  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.deleteReview({id: 1});

anilist.mutation.saveRecommendation

SaveRecommendationMutation saves a recommendation on the AniList API.

Signature

TypeScript
saveRecommendation(variables: SaveRecommendationVariables, options?: RequestOptions): Promise<RecommendationResponse>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
mediaIdnumberyesthe ID of the media.
mediaRecommendationIdnumberyesthe ID of the media recommendation.
ratingRecommendationRatingyesthe rating of the recommendation.
asHtmlbooleannoa boolean that determines if the review is in HTML format.
FieldTypeDescription
idnumberThe id of the recommendation
ratingnumberUsers rating of the recommendation
userRatingstringThe rating of the recommendation by currently authenticated user
mediaMediaThe media the recommendation is from
mediaRecommendationMediaThe recommended media
userBasicUserThe user that first created the recommendation
  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.saveRecommendation({mediaId: 1, mediaRecommendationId: 2, rating: 'RATE_UP'});

Community

anilist.mutation.saveThread

SaveThreadMutation saves a thread on the AniList API.

Signature

TypeScript
saveThread(variables: SaveThreadVariables, options?: RequestOptions): Promise<ThreadResponse>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
idnumberyesthe ID of the thread.
titlestringyesthe title of the thread.
bodystringyesthe body of the thread.
categoriesnumber[]yesan array of category IDs that the thread belongs to.
mediaCategoriesnumber[]yesan array of media category IDs that the thread belongs to.
stickybooleanyesa boolean that determines if the thread is sticky.
lockedbooleanyesa boolean that determines if the thread is locked.
asHtmlbooleanyesa boolean that determines if the response is in HTML format.
FieldTypeDescription
idnumberThe id of the thread
titlestringThe title of the thread
bodystringThe text body of the thread (Markdown)
userIdnumberThe id of the thread owner user
replyUserIdnumberThe id of the user who most recently commented on the thread
replyCommentIdnumberThe id of the most recent comment on the thread
replyCountnumberThe number of comments on the thread
viewCountnumberThe number of times users have viewed the thread
isLockedbooleanIf the thread is locked and can receive comments
isStickybooleanIf the thread is stickied and should be displayed at the top of the page
isSubscribedbooleanIf the currently authenticated user is subscribed to the thread
likeCountnumberThe amount of likes the thread has
isLikedbooleanIf the currently authenticated user liked the thread
repliedAtnumberThe time of the last reply
createdAtnumberThe time of the thread creation
updatedAtnumberThe time of the thread last update
userBasicUserThe owner of the thread
replyUserBasicUserThe user to last reply to the thread
likesBasicUser[]The users who liked the thread
siteUrlstringThe url for the thread page on the AniList website
idnumberThe id of the category
namestringThe name of the category
mediaCategoriesMedia[]The media categories of the thread
  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.saveThread({
  id: 1,
  title: 'Hello, world!',
  body: 'Hello, world!',
  categories: [],
  mediaCategories: [],
  sticky: false,
  locked: false,
  asHtml: true,
});

anilist.mutation.deleteThread

DeleteThreadMutation deletes a thread on the AniList API.

Signature

TypeScript
deleteThread(variables: DeleteThreadVariables, options?: RequestOptions): Promise<DeleteResult>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
idnumberyesa number representing the id of the activity.

See the TypeDoc page for the full DeleteResult shape.

  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.deleteThread({id: 1});

anilist.mutation.toggleThreadSubscription

ToggleThreadSubscriptionMutation toggles a thread subscription on the AniList API.

Signature

TypeScript
toggleThreadSubscription(variables: ToggleThreadSubscriptionVariables, options?: RequestOptions): Promise<ThreadResponse>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
threadIdnumberyesa number representing the id of the thread.
subscribebooleanyesa boolean representing whether the activity is subscribed.
asHtmlbooleannoa boolean representing whether the activity descriptions is in HTML format.
FieldTypeDescription
idnumberThe id of the thread
titlestringThe title of the thread
bodystringThe text body of the thread (Markdown)
userIdnumberThe id of the thread owner user
replyUserIdnumberThe id of the user who most recently commented on the thread
replyCommentIdnumberThe id of the most recent comment on the thread
replyCountnumberThe number of comments on the thread
viewCountnumberThe number of times users have viewed the thread
isLockedbooleanIf the thread is locked and can receive comments
isStickybooleanIf the thread is stickied and should be displayed at the top of the page
isSubscribedbooleanIf the currently authenticated user is subscribed to the thread
likeCountnumberThe amount of likes the thread has
isLikedbooleanIf the currently authenticated user liked the thread
repliedAtnumberThe time of the last reply
createdAtnumberThe time of the thread creation
updatedAtnumberThe time of the thread last update
userBasicUserThe owner of the thread
replyUserBasicUserThe user to last reply to the thread
likesBasicUser[]The users who liked the thread
siteUrlstringThe url for the thread page on the AniList website
idnumberThe id of the category
namestringThe name of the category
mediaCategoriesMedia[]The media categories of the thread
  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.toggleThreadSubscription({threadId: 1, subscribe: true});

anilist.mutation.saveThreadComment

SaveThreadCommentMutation saves a thread comment on the AniList API.

Signature

TypeScript
saveThreadComment(variables: SaveThreadCommentVariables, options?: RequestOptions): Promise<ThreadCommentResponse>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
idnumberyesthe ID of the thread.
threadIdnumberyesthe ID of the thread.
parentCommentIdnumberyesthe ID of the parent comment.
commentstringyesthe comment to be saved.
lockedbooleanyesa boolean that determines if the thread is locked.
asHtmlbooleanyesa boolean that determines if the response is in HTML format.
FieldTypeDescription
idnumberThe id of the comment
userIdnumberThe user id of the comment's owner
threadIdnumberThe id of thread the comment belongs to
commentstringThe text content of the comment (Markdown)
likeCountnumberThe amount of likes the comment has
isLikedbooleanIf the currently authenticated user liked the comment
siteUrlstringThe url for the comment page on the AniList website
createdAtnumberThe time of the comments creation
updatedAtnumberThe time of the comments last update
threadThreadResponseThe thread the comment belongs to
userBasicUserThe user who created the comment
likesBasicUser[]The users who liked the comment
childCommentsunknownThe comment's child reply comments
isLockedbooleanIf the comment tree is locked and may not receive replies or edits
  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.saveThreadComment({
  id: 1,
  threadId: 1,
  parentCommentId: 0,
  comment: 'Hello, world!',
  locked: false,
  asHtml: true,
});

anilist.mutation.deleteThreadComment

DeleteThreadCommentMutation deletes a thread comment on the AniList API.

Signature

TypeScript
deleteThreadComment(variables: DeleteThreadCommentVariables, options?: RequestOptions): Promise<DeleteResult>

Auth: Required — AniList access token (constructor `authToken` or `anilist.authToken` credential slot).

NameTypeRequiredDescription
idnumberyesa number representing the id of the activity.

See the TypeDoc page for the full DeleteResult shape.

  • AniLinkAuthError — no AniList token is configured
  • AniLinkApiError — non-success AniList HTTP response
  • AniLinkGraphQLError — HTTP 200 response carrying GraphQL errors
  • AniLinkNetworkError — timeout, cancellation, or transport failure

Example

TypeScript
await aniLink.anilist.mutation.deleteThreadComment({id: 1});

AniLink — typed AniList & MyAnimeList client for TypeScript.