API Reference

SMS

Read and send SMS/MMS messages. Requires SMS permission. Not available on Google Play build.

Type Definitions

bash
type Message {
  id: ID!
  body: String!
  address: String!       # phone number
  date: String!          # ISO 8601
  serviceCenter: String!
  read: Boolean!
  threadId: String!
  type: Int!             # 1=inbox 2=sent 3=draft 5=failed
  subscriptionId: Int!
  isMms: Boolean!
  attachments: [MessageAttachment!]!
}

type MessageAttachment {
  path: String!
  contentType: String!
  name: String!
}

type SmsConversation {
  id: String!
  address: String!
  snippet: String!
  date: String!
  messageCount: Int!
  read: Boolean!
}

type SmsCounts {
  inbox: Int!
  sent: Int!
  draft: Int!
  failed: Int!
}

Operations

query

sms

Search SMS messages. Use empty string for query to list all.

bash
query GetSms($offset: Int!, $limit: Int!, $query: String!) {
  sms(offset: $offset, limit: $limit, query: $query) {
    id body address date read threadId type subscriptionId isMms
    attachments { path contentType name }
  }
}
query

smsCount

Count SMS messages matching a query.

bash
query GetSmsCount($query: String!) {
  smsCount(query: $query)
}
query

smsConversations

List SMS conversations (threads), paginated.

bash
query GetSmsConversations($offset: Int!, $limit: Int!, $query: String!) {
  smsConversations(offset: $offset, limit: $limit, query: $query) {
    id address snippet date messageCount read
  }
}
query

smsConversationCount

Count SMS conversations matching a query.

bash
query GetSmsConversationCount($query: String!) {
  smsConversationCount(query: $query)
}
query

smsAllCounts

Return counts for all SMS categories.

bash
query GetSmsAllCounts {
  smsAllCounts { inbox sent draft failed }
}
query

archivedConversations

List archived (hidden) conversations.

bash
query GetArchivedConversations {
  archivedConversations { id address snippet date messageCount read }
}
mutation

sendSms

Send an SMS. Pass subscriptionId=-1 to use the default SIM.

bash
mutation SendSms($number: String!, $body: String!, $subscriptionId: Int!) {
  sendSms(number: $number, body: $body, subscriptionId: $subscriptionId)
}
mutation

sendMms

Launch the default SMS app pre-filled with an MMS (one or more attachments). Returns a pending MMS id; PlainApp polls the sent state and reports success via WebSocket events. attachmentPaths must point to files in PlainApp's AppFile store (fid: URIs).

bash
mutation SendMms($number: String!, $body: String!, $attachmentPaths: [String!]!, $threadId: String!) {
  sendMms(number: $number, body: $body, attachmentPaths: $attachmentPaths, threadId: $threadId)
}
mutation

archiveConversation

Archive a conversation by thread id and date.

bash
mutation ArchiveConversation($id: String!, $date: Long!) {
  archiveConversation(id: $id, date: $date)
}
mutation

unarchiveConversation

Remove a conversation from the archive.

bash
mutation UnarchiveConversation($id: String!) {
  unarchiveConversation(id: $id)
}