For the complete documentation index, see llms.txt. This page is also available as Markdown.

Upsert B2C subscription

GraphQL endpoint: /user

Creates or updates a B2C subscription directly, without going through the request/response flow. The subscription type (EMAIL, SMS, VOICE) determines the required contact reference: emailId for EMAIL, telephoneNumberId for SMS/VOICE. Optionally accepts an expiration date and a notification time window. If a subscription already exists for this company/type combination it is updated; otherwise a new one is created.

Query

mutation (
  $companyId: ID!
  $type: B2cSubscriptionType!
  $emailId: ID
  $telephoneNumberId: ID
  $subscriptionTopicIds: [ID!]!
  $expirationDate: Date
  $notificationStartTime: Time
  $notificationEndTime: Time
) {
  upsertB2cSubscription (
    companyId: $companyId
    type: $type
    emailId: $emailId
    telephoneNumberId: $telephoneNumberId
    subscriptionTopicIds: $subscriptionTopicIds
    expirationDate: $expirationDate
    notificationStartTime: $notificationStartTime
    notificationEndTime: $notificationEndTime
    ) {
      ... on B2cEmailSubscription {
        id
        insertedAt
        updatedAt
        type
        subscriptionTopics
        expirationDate
        notificationStartTime
        notificationEndTime
        email
        company {
          id
        }
        user {
          id
        }
      }

      ... on B2cSmsSubscription {
        id
        insertedAt
        updatedAt
        type
        subscriptionTopics
        expirationDate
        notificationStartTime
        notificationEndTime
        telephoneNumber
        company {
          id
        }
        user {
          id
        }
      }

      ... on B2cVoiceSubscription {
        id
        insertedAt
        updatedAt
        type
        subscriptionTopics
        expirationDate
        notificationStartTime
        notificationEndTime
        telephoneNumber
        company {
          id
        }
        user {
          id
        }
      }
    }
  }

Variables

Response

Last updated