SMSPort Docs

Public API docs

Devices and messages

List devices and review message history with GraphQL queries.

1. List workspaces

Run the query and copy the exact id from workspaces.nodes. Do not use the workspace name. If the list is empty, create a workspace in the portal and check the integration’s access.

query Workspaces($after: String) {
  workspaces(first: 20, after: $after) {
    nodes { id displayName status }
    pageInfo { hasNextPage endCursor }
  }
}

JSON variables in the Variables editor:

{}

2. List devices in a workspace

Replace workspaceId with an id from the previous query. Copy an id from workspace.devices.nodes into input.deviceId in the send mutation, not the phone name or serial number. If the list is empty, pair a phone in that workspace. Integration scope required: smspipe/devices.read.

query Devices($workspaceId: ID!, $after: String) {
  workspace(id: $workspaceId) {
    id
    displayName
    devices(first: 20, after: $after) {
      nodes { id name status }
      pageInfo { hasNextPage endCursor }
    }
  }
}

JSON variables in the Variables editor:

{
  "workspaceId": "<workspace-graphql-id>"
}

When pageInfo.hasNextPage is true, add after to Variables using pageInfo.endCursor from that same query. Clear after when changing workspace.

List messages

Use the same workspaceId and find the message by the id returned by message_create. Integration scope required: smspipe/messages.read. Send your first message.

query Messages($workspaceId: ID!, $after: String) {
  workspace(id: $workspaceId) {
    messages(first: 20, after: $after) {
      nodes { id recipient text status createdAt }
      pageInfo { hasNextPage endCursor }
    }
  }
}

JSON variables in the Variables editor:

{
  "workspaceId": "<workspace-graphql-id>"
}