Skip to content
gist.link ↗

messages

Query Phone API — POST https://phone.api.gist.link/graphql

Messages, optionally scoped to one thread (paginated).

phone:query:messages

The calling IAM key must hold this permission (or a wildcard that covers it: phone:query:* or phone:*) and the access token must have been minted with audience=phone. See Permissions.

type Query {
messages(filter: MessageFilter, first: Int, after: String): SmsMessageConnection!
}
Argument Type Required Description
filter MessageFilter No —
first Int No —
after String No —

SmsMessageConnection! — see the Phone types reference.

Terminal window
curl https://phone.api.gist.link/graphql \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d @- <<'JSON'
{
"query": "query Messages($filter: MessageFilter, $first: Int, $after: String) { messages(filter: $filter, first: $first, after: $after) { totalCount edges { cursor node { uuid direction contactE164 body mediaUrls status isRead createdAt } } } }",
"variables": {
"filter": {
"numberUuid": "01a01234-abcd-7000-9000-0123456789ab",
"contactE164": "example",
"unreadOnly": true
},
"first": 10,
"after": "cursor"
}
}
JSON