type ApiStatus { ok: Boolean! message: String! } scalar DecimalCount enum ConnectSessionStatus { CREATED AUTHORIZING EXCHANGING COMPLETED DENIED FAILED EXPIRED CANCELED } input SubjectScope { tenantKey: String! externalSubjectId: String! } input ConnectInput { scope: SubjectScope! provider: SocialProvider! capabilities: [Capability!]! returnUrl: String! reconnectConnectionId: ID } input GoogleIdentityInput { tenantKey: String! returnUrl: String! } type GoogleIdentitySession { id: ID! launchUrl: String! launchToken: String! resultProof: String! expiresAt: DateTime! resultExpiresAt: DateTime! } enum GoogleIdentityStatus { PENDING COMPLETED DENIED FAILED EXPIRED } type GoogleIdentityResult { status: GoogleIdentityStatus! issuer: String googleSub: String email: String emailVerified: Boolean name: String pictureUrl: String } input SyncWindow { publishedAfter: DateTime! publishedBefore: DateTime! maxItems: Int = 100 } input ContentWindow { publishedAfter: DateTime! publishedBefore: DateTime! first: Int! after: String } enum Availability { AVAILABLE UNSUPPORTED NOT_GRANTED UNAVAILABLE } enum MetricName { VIEWS LIKES COMMENTS SHARES } enum ContentKind { VIDEO IMAGE CAROUSEL UNKNOWN } type ConnectSession { id: ID! launchUrl: String! launchToken: String! expiresAt: DateTime! resultExpiresAt: DateTime! } enum ConnectCreatorAction { REMOVE_APP_AT_PROVIDER } type ConnectSessionResult { id: ID! provider: SocialProvider! status: ConnectSessionStatus! resultCode: String connectionId: ID creatorAction: ConnectCreatorAction expiresAt: DateTime! resultExpiresAt: DateTime! } enum ConnectionStatus { CONNECTED SUSPENDED RECONNECT_REQUIRED DISCONNECTED DELETING } enum SyncStatus { PENDING RUNNING READY PARTIAL STALE FAILED } type Connection { id: ID! provider: SocialProvider! providerAccountId: String! status: ConnectionStatus! syncStatus: SyncStatus! capabilities: [CapabilityState!]! profile: Profile lastSuccessfulSyncAt: DateTime nextRetryAt: DateTime } type CapabilityState { capability: Capability! availability: Availability! reason: String } type Profile { providerAccountId: String! displayName: String handle: String avatarUrl: String profileUrl: String description: String observedAt: DateTime! } type MetricObservation { name: MetricName! value: DecimalCount availability: Availability! reason: String sourceField: String observedAt: DateTime! } type ContentItem { id: ID! providerContentId: String! provider: SocialProvider! kind: ContentKind! canonicalUrl: String thumbnailUrl: String title: String description: String publishedAt: DateTime availability: Availability! reason: String observedAt: DateTime! metrics: [MetricObservation!]! } type PageInfo { endCursor: String hasNextPage: Boolean! completeForWindow: Boolean! incompleteReason: String } type ContentPage { items: [ContentItem!]! pageInfo: PageInfo! lastSuccessfulSyncAt: DateTime } type ConnectionPageInfo { endCursor: String hasNextPage: Boolean! } type ConnectionPage { items: [Connection!]! pageInfo: ConnectionPageInfo! } enum JobStatus { QUEUED RUNNING SUCCEEDED FAILED CANCELED } type SyncJob { id: ID! status: JobStatus! nextRetryAt: DateTime errorCode: String creatorAction: ConnectCreatorAction resultProviderContentId: String completeForWindow: Boolean incompleteReason: String continuationCursor: String } type DisconnectResult { accepted: Boolean! connectionId: ID! upstreamRevocationPending: Boolean! revokeJobId: ID! eraseJobId: ID! } type Query { status: ApiStatus! integrationReadiness: IntegrationReadiness! connectSessionResult(scope: SubjectScope!, id: ID!): ConnectSessionResult! connection(scope: SubjectScope!, id: ID!): Connection! syncJob(scope: SubjectScope!, connectionId: ID!, id: ID!): SyncJob! content(scope: SubjectScope!, connectionId: ID!, window: ContentWindow!): ContentPage! contentItem(scope: SubjectScope!, connectionId: ID!, providerContentId: String!): ContentItem connections(scope: SubjectScope!, first: Int = 20, after: String): ConnectionPage! } type IntegrationReadiness { providers: [ProviderReadiness!]! googleIdentityAvailable: Boolean! } type ProviderReadiness { provider: String! available: Boolean! } type Mutation { createConnectSession(input: ConnectInput!): ConnectSession! createGoogleIdentitySession(input: GoogleIdentityInput!): GoogleIdentitySession! redeemGoogleIdentityResult(id: ID!, tenantKey: String!, resultProof: String!): GoogleIdentityResult! disconnectConnection(scope: SubjectScope!, connectionId: ID!): DisconnectResult! requestRefresh(scope: SubjectScope!, connectionId: ID!, providerContentId: String, window: SyncWindow, continuationCursor: String): SyncJob! requestContentLookup(scope: SubjectScope!, connectionId: ID!, url: String!): SyncJob! } # Shared by the consumer /graphql and the admin /api/admin/graphql schemas. scalar DateTime enum SocialProvider { YOUTUBE TIKTOK INSTAGRAM } enum Capability { PROFILE CONTENT_LIST CONTENT_LOOKUP CONTENT_METRICS }