type Query {
  libraryItems(first: Int = 20, after: String, keyword: String, visibility: LibraryVisibility): LibraryConnection!
  libraryItem(id: ID!): LibraryItem
  storedChannelAnalytics(channelId: ID!, startDate: String!, endDate: String!, sections: [String!]): StoredChannelAnalytics!
  aggregatedPostMetrics(startDate: String!, endDate: String!, channelIds: [ID!], reports: [ReportSnapshotInput!]): AggregatedPostMetrics!
  channelReport(channelId: ID!, startDate: String!, endDate: String!, reportId: ID): ChannelReport!
  publishingActivity(startDate: String!, endDate: String!, timezone: String, channelIds: [ID!]): PublishingActivity!
  publishedActivity(startDate: String!, endDate: String!, timezone: String, channelIds: [ID!]): PublishedActivity!
  rankedPosts(startDate: String!, endDate: String!, metric: String!, metricBasis: String!, first: Int, channelIds: [ID!], reports: [RankedReportSnapshotInput!]): RankedPosts!
  instagramAudio(channelId: ID!, audioId: String!): InstagramAudioResult!
  instagramAudioCatalog(channelId: ID!): InstagramAudioResult!
  searchInstagramAudio(channelId: ID!, query: String!, type: InstagramAudioType): InstagramAudioResult!
  searchInstagramAudioCatalog(channelId: ID!, query: String!): InstagramAudioResult!
  trendingInstagramAudio(channelId: ID!, type: InstagramAudioType): InstagramAudioResult!
  tiktokPostingChoices(channelId: ID!): TikTokPostingChoices!
  dailyPostingLimits(channelIds: [ID!]!, date: String): [DailyPostingLimit!]!
  contentItem(id: ID!, discovery: ContentItemDiscovery = integration): ContentItem
  contentItems(first: Int = 20, after: String, status: ContentItemStatus, sort: [ContentItemSortInput!], discovery: ContentItemDiscovery = integration): ContentItemConnection!
  configuration: DeveloperConfiguration!
  postPerformance(id: ID!, reportId: ID, startDate: String, endDate: String): PostPerformance!
  account: Account!
  channel(id: ID!): Channel
  organizations: [Organization!]!
  channels(first: Int, afterId: ID): [Channel!]!
  post(id: ID!, includeMetrics: Boolean = false, metricSnapshots: [PostMetricSnapshotInput!]): Post
  posts(first: Int = 20, after: String, channelId: ID, channelIds: [ID!], status: String, statuses: [String!], isDraft: Boolean, dueAfter: String, dueBefore: String, createdAfter: String, createdBefore: String, publishedAfter: String, publishedBefore: String, sort: [PostSortInput!], dueAtPresence: DueAtPresence, postTypes: [PostFormat!], includeMetrics: Boolean = false, metricSnapshots: [PostMetricSnapshotInput!]): PostConnection!
}

enum LibraryVisibility {
  private
  internal
}

type LibraryConnection {
  nodes: [LibraryItem!]!
  pageInfo: PageInfo!
}

type LibraryItem {
  id: ID!
  title: String!
  text: String!
  version: String!
  description: String
  emoji: String
  visibility: LibraryVisibility!
  createdAt: String
  updatedAt: String
  assets: [LibraryAsset!]!
}

type LibraryAsset {
  type: String!
  url: String!
  altText: String
  title: String
  thumbnailUrl: String
  animatedThumbnail: String
  isAnimated: Boolean
  mimeType: String
  width: Int
  height: Int
  userTags: [ImageUserTag!]!
}

type ImageUserTag {
  handle: String!
  x: Float!
  y: Float!
}

type PageInfo {
  endCursor: String
  hasNextPage: Boolean!
}

type StoredChannelAnalytics {
  channelId: ID!
  service: String!
  state: String!
  startDate: String!
  endDate: String!
  complete: Boolean!
  basis: String!
  metricsUpdatedAt: String
  recordUpdatedAt: String
  freshness: String!
  snapshotFingerprint: String
  sections: [StoredAnalyticsSection!]!
  availableRanges: [StoredAnalyticsRange!]!
  errorCode: String
  note: String
}

type StoredAnalyticsSection {
  name: String!
  available: Boolean!
  source: String!
  data: StoredAnalyticsJson
  recordUpdatedAt: String
  metricsUpdatedAt: String
  freshness: String!
  cachePolicyMaxAgeSeconds: Int
  startDate: String
  endDate: String
  rangeBasis: String!
  redacted: Boolean!
  errorCode: String
  note: String
}

"Existing native website JSON. Nullable values and native metric labels are preserved; this is not a provider refresh."
scalar StoredAnalyticsJson

type StoredAnalyticsRange {
  startDate: String!
  endDate: String!
  recordUpdatedAt: String
}

input ReportSnapshotInput {
  channelId: ID!
  reportId: ID!
}

type AggregatedPostMetrics {
  state: String!
  complete: Boolean!
  startDate: String!
  endDate: String!

  "Latest known metric refresh among contributing ready snapshots."
  metricsUpdatedAt: String

  "Oldest contributing ready snapshot refresh; null if any contributing snapshot has unknown freshness."
  oldestMetricsUpdatedAt: String

  basis: String!
  note: String
  metrics: [Metric!]!
  reports: [ReportReference!]!
}

type Metric {
  key: String!
  type: String!
  name: String!
  unit: String!
  value: Float
  comparisonBasis: String
  status: String!
  basis: String!
}

type ReportReference {
  id: ID
  channelId: ID!
  service: String!
  state: String!
  complete: Boolean!
  errorCode: String
  metricsUpdatedAt: String
  expiresAt: String
  basis: String
  note: String
  enumerationComplete: Boolean
}

type ChannelReport {
  id: ID
  channelId: ID!
  service: String!
  state: String!
  startDate: String!
  endDate: String!
  complete: Boolean!
  errorCode: String
  expiresAt: String
  metricsUpdatedAt: String
  storedAnalytics: StoredChannelAnalytics
  readMode: String
  stale: Boolean
  basis: String
  note: String
  enumerationComplete: Boolean
  metrics: [Metric!]!
  posts(first: Int = 20, after: String): PerformancePostConnection!
}

type PerformancePostConnection {
  nodes: [PerformancePost!]!
  pageInfo: PageInfo!
}

type PerformancePost {
  externalId: ID!
  text: String
  textTruncated: Boolean
  publishedAt: String

  "Stored native calendar day when no exact publication instant can be recovered."
  publicationDate: String

  publicationTimeBasis: String
  url: String
  metrics: [Metric!]!
}

type PublishingActivity {
  count: Int!
  currentlyDelivered: Int!
  recordedCommitEvents: Int!
  commitEventHistoryComplete: Boolean!
  complete: Boolean!
  includesSoftDeleted: Boolean!
  channels: [PublishingActivityChannel!]!
  startDate: String!
  endDate: String!
  timezone: String!
  basis: String!
  countUnit: String!
  note: String!
  commitEventBasis: String!
  commitEventCountUnit: String!
  commitEventNote: String!
}

type PublishingActivityChannel {
  channelId: ID!
  service: String!
  name: String!
  coverage: String!
  count: Int
  currentlyDelivered: Int
  recordedCommitEvents: Int
  commitEventCoverage: String!
  statuses: [PublishingActivityStatus!]!
}

type PublishingActivityStatus {
  status: String!
  count: Int!
}

type PublishedActivity {
  count: Int!
  unknownTimeExcluded: Int!
  complete: Boolean!
  includesSoftDeleted: Boolean!
  channels: [PublishedActivityChannel!]!
  startDate: String!
  endDate: String!
  timezone: String!
  rangeStartUtc: String!
  rangeEndUtcExclusive: String!
  basis: String!
  countUnit: String!
  unknownTimeExcludedBasis: String!
  note: String!
}

type PublishedActivityChannel {
  channelId: ID!
  service: String!
  name: String!
  count: Int
  unknownTimeExcluded: Int
  coverage: String!
}

input RankedReportSnapshotInput {
  channelId: ID!
  reportId: ID!
}

type RankedPosts {
  state: String!
  complete: Boolean!
  metric: String!
  metricBasis: String!
  unit: String!
  comparisonBasis: String
  note: String!
  posts: [RankedPerformancePost!]!
  channels: [RankedPostCoverage!]!
}

type RankedPerformancePost {
  channelId: ID!
  reportId: ID
  externalId: ID!
  text: String
  textTruncated: Boolean!
  publishedAt: String
  publicationDate: String
  publicationTimeBasis: String
  url: String
  value: Float!
}

type RankedPostCoverage {
  channelId: ID!
  service: String!
  reportId: ID
  state: String!
  coverage: String!
  returnedPosts: Int!
  rankablePosts: Int!
  missingMetricPosts: Int!
  differentBasisPosts: Int!
  errorCode: String
  metricsUpdatedAt: String
  basis: String
  note: String
  enumerationComplete: Boolean
}

type InstagramAudioResult {
  audio: [InstagramAudio!]!
  complete: Boolean!
  failedAudioTypes: [String!]!
  errorCode: String
  previewExpires: Boolean!
  requiresFacebookLogin: Boolean!
}

type InstagramAudio {
  id: String!
  title: String!
  type: String!
  duration: Int!
  displayArtist: String
  creatorUsername: String
  coverArtworkUrl: String
  previewUrl: String
}

enum InstagramAudioType {
  music
  originalSound
}

type TikTokPostingChoices {
  channelId: ID!
  username: String
  nickname: String
  privacyLevels: [String!]!
  commentsDisabled: Boolean
  duetDisabled: Boolean
  stitchDisabled: Boolean
  maxVideoDurationSeconds: Int
  cacheMaxAgeSeconds: Int!
}

type DailyPostingLimit {
  channelId: ID!
  date: String!
  timezone: String!
  limit: Int!
  used: Int!
  sent: Int!
  reserved: Int!
  remaining: Int!
  isAtLimit: Boolean!
  providerLimitKnown: Boolean!
  basis: String!
}

"Integration-owned items by default; workspace requires posts:read plus explicit content:read consent, native draft visibility and the current selected-channel grant. Discovery never grants cross-integration writes."
enum ContentItemDiscovery {
  integration
  workspace
}

type ContentItem {
  id: ID!
  title: String
  text: String

  "Recorded creator and connection match this caller. False means read-only discovery; mutation permissions are independently rechecked."
  managedByCurrentIntegration: Boolean!

  version: String
  submitted: Boolean!
  status: ContentItemStatus!
  hasChannelVariants: Boolean!
  accessLimited: Boolean!
  createdAt: String
  updatedAt: String
  assets: [PostAsset!]!
  posts: [Post!]!
}

enum ContentItemStatus {
  draftContent
  postContent
}

type PostAsset {
  type: String!
  url: String!
  altText: String
  title: String
  thumbnailUrl: String
  animatedThumbnail: String
  isAnimated: Boolean
  mimeType: String
  width: Int
  height: Int
  userTags: [ImageUserTag!]!
}

type Post {
  id: ID!
  title: String
  text: String
  metrics: [Metric!]
  metricsUpdatedAt: String
  metricsState: String
  metricsErrorCode: String
  channelId: ID
  status: String
  isDraft: Boolean!
  dueAt: String

  "UTC native recorded delivery time when known; not planned, creation or edit time. Legacy acceptance-only timestamps are null."
  publishedAt: String

  publishedAtBasis: String
  createdAt: String
  updatedAt: String
  publishedUrl: String
  version: String
  allowedActions: [String!]!
  externalId: ID
  authorId: ID
  firstComment: String
  firstCommentState: String
  destinationUrl: String
  assets: [PostAsset!]!
  provenance: PostProvenance!
  author: PostAuthor
  failure: PostFailure
  reviewUrl: String
  thread: ThreadMetadata
  publishingState: String
  channelOptions: [PostChannelOptions!]!
  publishingMethod: PublishingMethod!
  manualReminder: ManualReminder
  annotations: [Annotation!]!
  performance(reportId: ID, startDate: String, endDate: String): PostPerformance!
}

"Recorded creation transport and caller-declared assistance; unknown values remain null."
type PostProvenance {
  source: String
  sourceBasis: String!
  aiAssisted: Boolean
  aiAssistanceBasis: String!
  composerSource: String
  composerSourceBasis: String!
}

type PostAuthor {
  id: ID!
  name: String!
}

type PostFailure {
  code: String!
  message: String!
  automaticRetrySafe: Boolean!
}

type ThreadMetadata {
  rootPostId: ID!
  parentPostId: ID
  position: Int!
  total: Int!
}

type PostChannelOptions {
  mentions: [PostMention!]
  channelId: ID!
  postType: String
  privacy: String
  firstComment: String
  destinationUrl: String
  linkUrl: String
  linkTitle: String
  linkDescription: String
  linkThumbnailUrl: String
  spoilerText: String
  locationId: String
  locationName: String
  topic: String
  businessPost: GoogleBusinessPostOptions
  stickerFields: InstagramStickerFields
  audioId: String
  audioVolume: Int
  videoVolume: Int
  thumbnailOffset: Int
  shareToFeed: Boolean
  categoryId: String
  embeddable: Boolean
  license: String
  notifySubscribers: Boolean
  isAiGenerated: Boolean
  madeForKids: Boolean
  allowComments: Boolean
  allowDuet: Boolean
  allowStitch: Boolean
  autoAddMusic: Boolean
  promoteOwnBrand: Boolean
  brandedContent: Boolean
  consent: Boolean
}

type PostMention {
  start: Int!
  length: Int!
  text: String!
  entity: String!
  url: String
}

type GoogleBusinessPostOptions {
  type: String
  action: String
  actionUrl: String
  title: String
  startDate: String
  startTime: String
  endDate: String
  endTime: String
  couponCode: String
  redeemUrl: String
  terms: String
}

type InstagramStickerFields {
  music: String
  other: String
  products: String
  text: String
  topics: String
}

enum PublishingMethod {
  automatic
  reminder
}

type ManualReminder {
  id: ID!
  state: String!
  channelId: ID!
  dueAt: String!
  errorCode: String
  notifiedAt: String
  reportedAt: String
  reportedUrl: String
  providerDeliveryConfirmed: Boolean!
}

type Annotation {
  type: String!
  content: String!
  text: String!
  indices: [Int!]!
  url: String
  offsetUnit: String!
}

type PostPerformance {
  postId: ID!
  externalId: ID
  reportId: ID
  state: String!
  complete: Boolean!
  metricsUpdatedAt: String
  errorCode: String
  startDate: String
  endDate: String
  metrics: [Metric!]!
}

input ContentItemSortInput {
  field: ContentItemSortableKey!
  direction: SortDirection!
}

enum ContentItemSortableKey {
  createdAt
  updatedAt
}

enum SortDirection {
  asc
  desc
}

type ContentItemConnection {
  nodes: [ContentItem!]!
  pageInfo: PageInfo!
}

type DeveloperConfiguration {
  services: [PublishingCapabilities!]!
  scopes: [String!]!
  limitsBasis: String!
  wireCompatibility: String!
  youtubeCategories: [YouTubeCategory!]!
  maxImages: Int!
  maxVideoBytes: Int!
  maxImageBytes: Int!
  maxDocumentBytes: Int!
  maxPreviewBytes: Int!
  maxLinkPreviewBytes: Int!
  maxLinkPreviewsPerRequest: Int!
  reportMaxDays: Int!
  reportRefreshesPerDay: Int!
  maxDailyApiPostsPerChannel: Int!
  workUnitsPerMinute: Int!
  workUnitsPerDay: Int!
  workUnitsPerMonth: Int!
  complexityPerWorkUnit: Int!
  mutationWorkUnits: Int!
  maxKeys: Int!
  maxLibraryEntries: Int!
  mediaBytesPerDay: Int!
  mediaBytesPerMonth: Int!
  concurrentMediaImports: Int!
  reportRefreshesPerMonth: Int!
}

type PublishingCapabilities {
  service: String!
  maxImages: Int!
  maxTextLength: Int!
  textLengthUnit: String!
  maxTitleLength: Int!
  maxFirstCommentLength: Int!
  firstCommentLengthUnit: String!
  postTypes: [String!]!
  textOnly: Boolean!
  images: Boolean!
  video: Boolean!
  firstComment: Boolean!
  documents: Boolean!
  threads: Boolean!
  titleRequired: Boolean!
  requiresAudienceChoice: Boolean!
  requiresPostingConsent: Boolean!
  coverFrameOffset: Boolean!
  reelShareToFeed: Boolean!
  manualReminder: Boolean!
  positionedImageMentions: Boolean!
  locationTagging: Boolean!
  topics: Boolean!
  customLinkPreviews: Boolean!
  linkCards: Boolean!
  structuredMentions: Boolean!
  contentWarning: Boolean!
  aiDisclosure: Boolean!
  businessPostOptions: Boolean!
  documentFormats: [String!]!
  textLimitsBasis: String
  textLimitsMetadataAvailable: Boolean
  charactersReservedPerUrl: Int
  contentRules: [PublishingContentRule!]!
}

type PublishingContentRule {
  postType: String!
  attachmentType: String!
  minAttachments: Int!
  maxAttachments: Int!
  maxTextLength: Int!
  textLengthUnit: String!
  maxTitleLength: Int!
  titleLengthUnit: String!
  titleRequired: Boolean!
  maxFileBytes: Int
  mimeTypes: [String!]!
  requiredChannelOptions: [String!]!
  firstComment: Boolean!
  basis: String!
  note: String!
}

type YouTubeCategory {
  id: ID!
  name: String!
}

type Account {
  id: ID!
  name: String!
  email: String
  avatar: String
  preferences: AccountPreferences!
  createdAt: String
  timezone: String!
  localTime: String!
  organizations: [Organization!]!
}

type AccountPreferences {
  firstDayOfWeekCode: String
  dateFormatCode: String
  timeFormat: String
}

type Organization {
  id: ID!
  name: String!
  ownerEmail: String
  channelCount: Int!
  members: MemberSummary!
  limits: OrganizationLimits!
}

type MemberSummary {
  totalCount: Int!
}

type OrganizationLimits {
  channels: Int
  additionalMembers: Int
  pendingPostsPerChannel: Int
  apiPostsPerChannelPerDay: Int!
  libraryEntries: Int!
}

type Channel {
  id: ID!
  name: String!
  service: String
  queuePaused: Boolean!
  workspacePublishingPaused: Boolean!
  credentialsExpired: Boolean!
  type: String
  destinationId: String
  connected: Boolean!
  requiresApproval: Boolean!
  url: String
  iconUrl: String
  organizationId: ID!
  isLocked: Boolean!
  createdAt: String
  updatedAt: String
  timezone: String!
  postingTimes: [PostingTime!]!
  capabilities: PublishingCapabilities!
}

type PostingTime {
  dayOfWeek: Int!
  time: String!
}

input PostMetricSnapshotInput {
  channelId: ID!
  reportId: ID!
  startDate: String!
  endDate: String!
}

input PostSortInput {
  field: PostSortableKey!
  direction: SortDirection!
}

enum PostSortableKey {
  createdAt
  dueAt
  publishedAt
}

enum DueAtPresence {
  present
  absent
}

enum PostFormat {
  post
  reel
  story
  carousel
  short
  thread
  event
  offer
  whats_new
}

type PostConnection {
  nodes: [Post!]!
  pageInfo: PageInfo!
}

type Mutation {
  createLibraryItem(requestKey: String!, title: String!, text: String!, visibility: LibraryVisibility, description: String, emoji: String, images: [LibraryImageInput!], video: LibraryVideoInput, document: LibraryDocumentInput, clearMedia: Boolean): LibraryItem!
  updateLibraryItem(requestKey: String!, title: String!, text: String!, visibility: LibraryVisibility, description: String, emoji: String, images: [LibraryImageInput!], video: LibraryVideoInput, document: LibraryDocumentInput, clearMedia: Boolean, id: ID!, version: String!): LibraryItem!
  deleteLibraryItem(requestKey: String!, id: ID!, version: String!): DeletedItem!
  requestPostApproval(id: ID!, version: String!, requestKey: String!): PostApprovalRequest!
  createThread(requestKey: String!, source: String, channelIds: [ID!]!, entries: [ThreadEntryInput!]!, mode: SchedulingMode, dueAt: String): PostSubmission!
  createDraftFromLibraryItem(id: ID!, version: String!, requestKey: String!, channelIds: [ID!]): DraftResult!
  updatePost(id: ID!, version: String!, requestKey: String!, publishingMethod: PublishingMethod, approvalChange: PostApprovalChange, source: String, aiAssisted: Boolean, text: String, title: String, firstComment: String, dueAt: String, mode: SchedulingMode, saveToDraft: Boolean, images: [ImageInput!], video: VideoInput, document: DocumentInput, clearMedia: Boolean, channelOptions: [ChannelOptionsInput!]): PostEditResult
  movePostInQueue(id: ID!, version: String!, requestKey: String!, position: String!): PostQueueMoveResult
  deletePost(id: ID!, version: String!, requestKey: String!): PostDeleteResult
  createPost(source: String, aiAssisted: Boolean, requestKey: String!, text: String!, title: String, firstComment: String, channelIds: [ID!]!, images: [ImageInput!], video: VideoInput, document: DocumentInput, dueAt: String, mode: SchedulingMode, channelOptions: [ChannelOptionsInput!], requestApproval: Boolean, publishingMethod: PublishingMethod): PostSubmission!
  submitDraft(id: ID!, version: String!, requestKey: String!, channelIds: [ID!]!, dueAt: String, mode: SchedulingMode, channelOptions: [ChannelOptionsInput!], requestApproval: Boolean): PostSubmission!
  createDraft(source: String, aiAssisted: Boolean, requestKey: String!, text: String!, title: String, firstComment: String, channelIds: [ID!], images: [ImageInput!], video: VideoInput, document: DocumentInput, channelOptions: [ChannelOptionsInput!]): DraftResult!
  updateDraft(id: ID!, requestKey: String!, approvalChange: PostApprovalChange, source: String, version: String!, text: String!, title: String, firstComment: String, images: [ImageInput!], video: VideoInput, document: DocumentInput, clearMedia: Boolean, aiAssisted: Boolean, channelOptions: [ChannelOptionsInput!]): DraftResult!
  createContentItemVariants(requestKey: String!, title: String, posts: [ContentVariantInput!]!): PostSubmission!
  createContentItem(source: String, aiAssisted: Boolean, requestKey: String!, text: String!, title: String, firstComment: String, channelIds: [ID!]!, images: [ImageInput!], video: VideoInput, document: DocumentInput, dueAt: String, mode: SchedulingMode, channelOptions: [ChannelOptionsInput!], requestApproval: Boolean, publishingMethod: PublishingMethod): PostSubmission!
  withdrawPostApproval(id: ID!, version: String!, requestKey: String!): PostApprovalRequest!
  createContentItemDraft(source: String, aiAssisted: Boolean, requestKey: String!, text: String!, title: String, firstComment: String, channelIds: [ID!], images: [ImageInput!], video: VideoInput, document: DocumentInput, channelOptions: [ChannelOptionsInput!]): DraftResult!
  promoteContentItemDraft(id: ID!, version: String!, requestKey: String!, channelIds: [ID!], dueAt: String, mode: SchedulingMode, channelOptions: [ChannelOptionsInput!], requestApproval: Boolean, posts: [ContentVariantInput!]): PostSubmission!
  armDestinationDraft(id: ID!, version: String!, requestKey: String!, publishingMethod: PublishingMethod, mode: SchedulingMode, dueAt: String, requestApproval: Boolean): ContentItemChange!
  updateContentItem(id: ID!, version: String!, requestKey: String!, text: String, title: String, firstComment: String, dueAt: String, mode: SchedulingMode, threadEntries: [updateContentThreadEntryInput!], images: [ImageInput!], video: VideoInput, document: DocumentInput, clearMedia: Boolean): ContentItemChange!
  updateContentItemDraft(id: ID!, version: String!, requestKey: String!, text: String, title: String, firstComment: String, dueAt: String, mode: SchedulingMode, threadEntries: [updateContentThreadEntryInput!], images: [ImageInput!], video: VideoInput, document: DocumentInput, clearMedia: Boolean): ContentItemChange!
  deleteContentItem(id: ID!, version: String!, requestKey: String!): ContentItemChange!
  deleteContentItemDraft(id: ID!, version: String!, requestKey: String!): ContentItemChange!
  addPostToContentItem(id: ID!, postId: ID!, version: String!, requestKey: String!): ContentItemChange!
  removePostFromContentItem(id: ID!, postId: ID!, version: String!, requestKey: String!): ContentItemChange!
  changeReminder(id: ID!, version: String!, requestKey: String!, action: ReminderAction!, dueAt: String, reportedUrl: String): ReminderChangeResult!

  "Explicitly collect a new provider report. Ordinary channelReport and storedChannelAnalytics reads never refresh."
  refreshChannelReport(channelId: ID!, startDate: String!, endDate: String!): ChannelReport!

  tryCreateLibraryItem(requestKey: String!, title: String!, text: String!, visibility: LibraryVisibility, description: String, emoji: String, images: [LibraryImageInput!], video: LibraryVideoInput, document: LibraryDocumentInput, clearMedia: Boolean): CreateLibraryItemActionResult!
  tryUpdateLibraryItem(requestKey: String!, title: String!, text: String!, visibility: LibraryVisibility, description: String, emoji: String, images: [LibraryImageInput!], video: LibraryVideoInput, document: LibraryDocumentInput, clearMedia: Boolean, id: ID!, version: String!): UpdateLibraryItemActionResult!
  tryDeleteLibraryItem(requestKey: String!, id: ID!, version: String!): DeleteLibraryItemActionResult!
  tryRequestPostApproval(id: ID!, version: String!, requestKey: String!): RequestPostApprovalActionResult!
  tryCreateThread(requestKey: String!, source: String, channelIds: [ID!]!, entries: [ThreadEntryInput!]!, mode: SchedulingMode, dueAt: String): CreateThreadActionResult!
  tryCreateDraftFromLibraryItem(id: ID!, version: String!, requestKey: String!, channelIds: [ID!]): CreateDraftFromLibraryItemActionResult!
  tryUpdatePost(id: ID!, version: String!, requestKey: String!, publishingMethod: PublishingMethod, approvalChange: PostApprovalChange, source: String, aiAssisted: Boolean, text: String, title: String, firstComment: String, dueAt: String, mode: SchedulingMode, saveToDraft: Boolean, images: [ImageInput!], video: VideoInput, document: DocumentInput, clearMedia: Boolean, channelOptions: [ChannelOptionsInput!]): UpdatePostActionResult!
  tryMovePostInQueue(id: ID!, version: String!, requestKey: String!, position: String!): MovePostInQueueActionResult!
  tryDeletePost(id: ID!, version: String!, requestKey: String!): DeletePostActionResult!
  tryCreatePost(source: String, aiAssisted: Boolean, requestKey: String!, text: String!, title: String, firstComment: String, channelIds: [ID!]!, images: [ImageInput!], video: VideoInput, document: DocumentInput, dueAt: String, mode: SchedulingMode, channelOptions: [ChannelOptionsInput!], requestApproval: Boolean, publishingMethod: PublishingMethod): CreatePostActionResult!
  trySubmitDraft(id: ID!, version: String!, requestKey: String!, channelIds: [ID!]!, dueAt: String, mode: SchedulingMode, channelOptions: [ChannelOptionsInput!], requestApproval: Boolean): SubmitDraftActionResult!
  tryCreateDraft(source: String, aiAssisted: Boolean, requestKey: String!, text: String!, title: String, firstComment: String, channelIds: [ID!], images: [ImageInput!], video: VideoInput, document: DocumentInput, channelOptions: [ChannelOptionsInput!]): CreateDraftActionResult!
  tryUpdateDraft(id: ID!, requestKey: String!, approvalChange: PostApprovalChange, source: String, version: String!, text: String!, title: String, firstComment: String, images: [ImageInput!], video: VideoInput, document: DocumentInput, clearMedia: Boolean, aiAssisted: Boolean, channelOptions: [ChannelOptionsInput!]): UpdateDraftActionResult!
  tryCreateContentItemVariants(requestKey: String!, title: String, posts: [ContentVariantInput!]!): CreateContentItemVariantsActionResult!
  tryCreateContentItem(source: String, aiAssisted: Boolean, requestKey: String!, text: String!, title: String, firstComment: String, channelIds: [ID!]!, images: [ImageInput!], video: VideoInput, document: DocumentInput, dueAt: String, mode: SchedulingMode, channelOptions: [ChannelOptionsInput!], requestApproval: Boolean, publishingMethod: PublishingMethod): CreateContentItemActionResult!
  tryWithdrawPostApproval(id: ID!, version: String!, requestKey: String!): WithdrawPostApprovalActionResult!
  tryCreateContentItemDraft(source: String, aiAssisted: Boolean, requestKey: String!, text: String!, title: String, firstComment: String, channelIds: [ID!], images: [ImageInput!], video: VideoInput, document: DocumentInput, channelOptions: [ChannelOptionsInput!]): CreateContentItemDraftActionResult!
  tryPromoteContentItemDraft(id: ID!, version: String!, requestKey: String!, channelIds: [ID!], dueAt: String, mode: SchedulingMode, channelOptions: [ChannelOptionsInput!], requestApproval: Boolean, posts: [ContentVariantInput!]): PromoteContentItemDraftActionResult!
  tryArmDestinationDraft(id: ID!, version: String!, requestKey: String!, publishingMethod: PublishingMethod, mode: SchedulingMode, dueAt: String, requestApproval: Boolean): ArmDestinationDraftActionResult!
  tryUpdateContentItem(id: ID!, version: String!, requestKey: String!, text: String, title: String, firstComment: String, dueAt: String, mode: SchedulingMode, threadEntries: [updateContentThreadEntryInput!], images: [ImageInput!], video: VideoInput, document: DocumentInput, clearMedia: Boolean): UpdateContentItemActionResult!
  tryUpdateContentItemDraft(id: ID!, version: String!, requestKey: String!, text: String, title: String, firstComment: String, dueAt: String, mode: SchedulingMode, threadEntries: [updateContentThreadEntryInput!], images: [ImageInput!], video: VideoInput, document: DocumentInput, clearMedia: Boolean): UpdateContentItemDraftActionResult!
  tryDeleteContentItem(id: ID!, version: String!, requestKey: String!): DeleteContentItemActionResult!
  tryDeleteContentItemDraft(id: ID!, version: String!, requestKey: String!): DeleteContentItemDraftActionResult!
  tryAddPostToContentItem(id: ID!, postId: ID!, version: String!, requestKey: String!): AddPostToContentItemActionResult!
  tryRemovePostFromContentItem(id: ID!, postId: ID!, version: String!, requestKey: String!): RemovePostFromContentItemActionResult!
  tryChangeReminder(id: ID!, version: String!, requestKey: String!, action: ReminderAction!, dueAt: String, reportedUrl: String): ChangeReminderActionResult!

  "Explicitly collect a new provider report. Ordinary channelReport and storedChannelAnalytics reads never refresh."
  tryRefreshChannelReport(channelId: ID!, startDate: String!, endDate: String!): RefreshChannelReportActionResult!
}

input LibraryImageInput {
  url: String!
  altText: String
  thumbnailUrl: String
  animatedThumbnail: String
  userTags: [ImageUserTagInput!]
}

input ImageUserTagInput {
  handle: String!
  x: Float!
  y: Float!
}

input LibraryVideoInput {
  url: String!
  altText: String
}

input LibraryDocumentInput {
  url: String!
  title: String!
  thumbnailUrl: String
}

type DeletedItem {
  id: ID!
  deleted: Boolean!
}

type PostApprovalRequest {
  id: ID!
  version: String!
  approvalRequested: Boolean!
}

input ThreadEntryInput {
  text: String!
  images: [ImageInput!]
  video: VideoInput
  linkUrl: String
  linkTitle: String
  linkDescription: String
  linkThumbnailUrl: String
}

input ImageInput {
  url: String!
  altText: String
  thumbnailUrl: String
  animatedThumbnail: String
  userTags: [ImageUserTagInput!]
}

input VideoInput {
  url: String!
  altText: String
}

enum SchedulingMode {
  publishNow
  schedule
  addToQueue
  prioritize
}

type PostSubmission {
  contentItemId: ID
  accepted: Boolean!
  published: Boolean!
  posts: [Post!]!
}

type DraftResult {
  postId: ID!
  version: String!
  reviewUrl: String
  published: Boolean!
}

enum PostApprovalChange {
  request
  revert
}

input DocumentInput {
  url: String!
  title: String!
  thumbnailUrl: String
}

input ChannelOptionsInput {
  mentions: [MentionInput!]
  channelId: ID!
  postType: String
  privacy: String
  categoryId: String
  embeddable: Boolean
  license: String
  notifySubscribers: Boolean
  isAiGenerated: Boolean
  madeForKids: Boolean
  allowComments: Boolean
  allowDuet: Boolean
  allowStitch: Boolean
  autoAddMusic: Boolean
  promoteOwnBrand: Boolean
  brandedContent: Boolean
  consent: Boolean
  firstComment: String
  destinationUrl: String
  linkUrl: String
  linkTitle: String
  linkDescription: String
  linkThumbnailUrl: String
  spoilerText: String
  locationId: String
  locationName: String
  topic: String
  businessPost: GoogleBusinessPostInput
  stickerFields: InstagramStickerFieldsInput
  audioId: String
  audioVolume: Int
  videoVolume: Int
  thumbnailOffset: Int
  shareToFeed: Boolean
}

input MentionInput {
  start: Int!
  length: Int!
  text: String!
  entity: String!
  url: String
}

input GoogleBusinessPostInput {
  type: String
  action: String
  actionUrl: String
  title: String
  startDate: String
  startTime: String
  endDate: String
  endTime: String
  couponCode: String
  redeemUrl: String
  terms: String
}

input InstagramStickerFieldsInput {
  music: String
  other: String
  products: String
  text: String
  topics: String
}

type PostEditResult {
  id: ID!
  version: String!
  deleted: Boolean!
}

type PostQueueMoveResult {
  id: ID!
  version: String!
  deleted: Boolean!
}

type PostDeleteResult {
  id: ID!
  deleted: Boolean!
}

input ContentVariantInput {
  channelId: ID!
  text: String!
  title: String
  source: String
  aiAssisted: Boolean
  saveToDraft: Boolean
  publishingMethod: PublishingMethod
  firstComment: String
  mode: SchedulingMode
  dueAt: String
  requestApproval: Boolean
  images: [ImageInput!]
  video: VideoInput
  document: DocumentInput
  channelOptions: ChannelOptionsInput
}

type ContentItemChange {
  id: ID!
  version: String
  deleted: Boolean!
}

input updateContentThreadEntryInput {
  text: String!
  images: [ImageInput!]
  video: VideoInput
  clearMedia: Boolean
  linkUrl: String
  linkTitle: String
  linkDescription: String
  linkThumbnailUrl: String
}

enum ReminderAction {
  cancel
  reschedule
  markPosted
}

type ReminderChangeResult {
  id: ID!
  version: String!
  state: String!
  providerDeliveryConfirmed: Boolean!
}

union CreateLibraryItemActionResult = CreateLibraryItemActionSuccess | MutationError

type CreateLibraryItemActionSuccess {
  result: LibraryItem!
}

type MutationError {
  message: String!
  code: String!
  httpStatus: Int!
  retryAfterSeconds: Int
  fields: [MutationFieldError!]!
}

type MutationFieldError {
  field: String!
  message: String!
}

union UpdateLibraryItemActionResult = UpdateLibraryItemActionSuccess | MutationError

type UpdateLibraryItemActionSuccess {
  result: LibraryItem!
}

union DeleteLibraryItemActionResult = DeleteLibraryItemActionSuccess | MutationError

type DeleteLibraryItemActionSuccess {
  result: DeletedItem!
}

union RequestPostApprovalActionResult = RequestPostApprovalActionSuccess | MutationError

type RequestPostApprovalActionSuccess {
  result: PostApprovalRequest!
}

union CreateThreadActionResult = CreateThreadActionSuccess | MutationError

type CreateThreadActionSuccess {
  result: PostSubmission!
}

union CreateDraftFromLibraryItemActionResult = CreateDraftFromLibraryItemActionSuccess | MutationError

type CreateDraftFromLibraryItemActionSuccess {
  result: DraftResult!
}

union UpdatePostActionResult = UpdatePostActionSuccess | MutationError

type UpdatePostActionSuccess {
  result: PostEditResult
}

union MovePostInQueueActionResult = MovePostInQueueActionSuccess | MutationError

type MovePostInQueueActionSuccess {
  result: PostQueueMoveResult
}

union DeletePostActionResult = DeletePostActionSuccess | MutationError

type DeletePostActionSuccess {
  result: PostDeleteResult
}

union CreatePostActionResult = CreatePostActionSuccess | MutationError

type CreatePostActionSuccess {
  result: PostSubmission!
}

union SubmitDraftActionResult = SubmitDraftActionSuccess | MutationError

type SubmitDraftActionSuccess {
  result: PostSubmission!
}

union CreateDraftActionResult = CreateDraftActionSuccess | MutationError

type CreateDraftActionSuccess {
  result: DraftResult!
}

union UpdateDraftActionResult = UpdateDraftActionSuccess | MutationError

type UpdateDraftActionSuccess {
  result: DraftResult!
}

union CreateContentItemVariantsActionResult = CreateContentItemVariantsActionSuccess | MutationError

type CreateContentItemVariantsActionSuccess {
  result: PostSubmission!
}

union CreateContentItemActionResult = CreateContentItemActionSuccess | MutationError

type CreateContentItemActionSuccess {
  result: PostSubmission!
}

union WithdrawPostApprovalActionResult = WithdrawPostApprovalActionSuccess | MutationError

type WithdrawPostApprovalActionSuccess {
  result: PostApprovalRequest!
}

union CreateContentItemDraftActionResult = CreateContentItemDraftActionSuccess | MutationError

type CreateContentItemDraftActionSuccess {
  result: DraftResult!
}

union PromoteContentItemDraftActionResult = PromoteContentItemDraftActionSuccess | MutationError

type PromoteContentItemDraftActionSuccess {
  result: PostSubmission!
}

union ArmDestinationDraftActionResult = ArmDestinationDraftActionSuccess | MutationError

type ArmDestinationDraftActionSuccess {
  result: ContentItemChange!
}

union UpdateContentItemActionResult = UpdateContentItemActionSuccess | MutationError

type UpdateContentItemActionSuccess {
  result: ContentItemChange!
}

union UpdateContentItemDraftActionResult = UpdateContentItemDraftActionSuccess | MutationError

type UpdateContentItemDraftActionSuccess {
  result: ContentItemChange!
}

union DeleteContentItemActionResult = DeleteContentItemActionSuccess | MutationError

type DeleteContentItemActionSuccess {
  result: ContentItemChange!
}

union DeleteContentItemDraftActionResult = DeleteContentItemDraftActionSuccess | MutationError

type DeleteContentItemDraftActionSuccess {
  result: ContentItemChange!
}

union AddPostToContentItemActionResult = AddPostToContentItemActionSuccess | MutationError

type AddPostToContentItemActionSuccess {
  result: ContentItemChange!
}

union RemovePostFromContentItemActionResult = RemovePostFromContentItemActionSuccess | MutationError

type RemovePostFromContentItemActionSuccess {
  result: ContentItemChange!
}

union ChangeReminderActionResult = ChangeReminderActionSuccess | MutationError

type ChangeReminderActionSuccess {
  result: ReminderChangeResult!
}

union RefreshChannelReportActionResult = RefreshChannelReportActionSuccess | MutationError

type RefreshChannelReportActionSuccess {
  result: ChannelReport!
}

