Create Opt-Out Request
GraphQL endpoint: /company
Create an opt-out request to record a user's request to stop receiving communications. This is typically used when processing opt-out keywords (e.g., "STOP") received via SMS.
Required fields:
source: The source/sender of the opt-out request (e.g., phone number)destination: The destination (e.g., company's phone number that received the request)type: The communication type (SMS, VOICE, EMAIL)timestamp: When the opt-out request was received
Optional fields:
externalId: External identifier for referencemessageBody: The content of the opt-out messagemetadata: Additional metadata as key-value pairs (flat structure only)
The request is created with status RECEIVED, and moves through NOTIFIED, REMINDER_SENT, ACCEPTED, REJECTED, REVOKED or EXPIRED as it is processed. Processing the opt-out may trigger removal of the user from relevant subscriptions.
Query
mutation (
$source: String!
$destination: String!
$externalId: String
$messageBody: String
$type: OptOutRequestType!
$timestamp: NaiveDateTime!
$metadata: JSON
) {
createOptOutRequest (
source: $source
destination: $destination
externalId: $externalId
messageBody: $messageBody
type: $type
timestamp: $timestamp
metadata: $metadata
) {
id
source
destination
externalId
messageBody
type
status
createdAt
updatedAt
timestamp
metadata
company {
id
}
}
}
Variables
Response
Last updated