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.
3. Send SMS
Replace input.deviceId with an id from the device list and recipients with your own E.164 phone number. Review the text before executing. This is not a sandbox: the mutation sends a real SMS and consumes credits. Integration scope required: smspipe/messages.write.
mutation SendSms($input: MessageCreateInput!) {
message_create(input: $input) {
messages { id status }
errors { __typename ... on Error { message } }
}
}JSON variables in the Variables editor:
{
"input": {
"deviceId": "<device-graphql-id>",
"recipients": [
"+48123123123"
],
"text": "Hello from SMSPort"
}
}
Check errors and messages.id and status. Acceptance does not mean delivery. Check the message status in the same workspace; required scope: smspipe/messages.read.
curl
curl -X POST "https://api.smsport.app/graphql" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" --data '{"query":"mutation SendSms($input: MessageCreateInput!) {\n message_create(input: $input) {\n messages { id status }\n errors { __typename ... on Error { message } }\n }\n}","variables":{"input":{"deviceId":"<device-graphql-id>","recipients":["+48123123123"],"text":"Hello from SMSPort"}}}'
Replace deviceId and the recipient number in the curl request before sending, too.