Blueticks

Utilities

Small helper endpoints under /v1/utils - validate a phone number, fetch a link preview, and get the server's current date and time.

Helper endpoints under /v1/utils. All three require the contacts:read scope and are rate-limited to 120 requests per minute.

Validate a phone number

POST /v1/utils/validate_phone asks your connected WhatsApp engine whether a phone number (or chat ID) resolves to a valid WhatsApp chat, and returns the canonical chat ID. Use it before sending to a number you don't already have a chat for. It needs a connected engine, like any call that reads from WhatsApp.

The body takes one field, phoneOrChatId. Unknown fields are rejected.

curl -X POST "https://api.blueticks.co/v1/utils/validate_phone" \
  -H "Authorization: Bearer $BLUETICKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"phoneOrChatId": "15551234567"}'
{ "valid": true, "chatId": "15551234567@c.us" }

A number that doesn't resolve returns { "valid": false, "chatId": null }.

GET /v1/utils/link_preview?url=<url> fetches the preview for a link through your connected engine. url must be a valid URL, up to 2048 characters.

curl "https://api.blueticks.co/v1/utils/link_preview?url=https%3A%2F%2Fexample.com" \
  -H "Authorization: Bearer $BLUETICKS_API_KEY"
{
  "title": "Example Domain",
  "description": null,
  "thumbnail": null,
  "canonicalUrl": "https://example.com/"
}

Any field can be null. thumbnail, when present, is a data:image/jpeg;base64,... URL.

Current date and time

GET /v1/utils/current_date_time returns the current time in UTC and in the timezone reported by your connected engine. Use it before building a sendAt, since or until value, so "today" and weekdays are worked out in the right timezone.

curl "https://api.blueticks.co/v1/utils/current_date_time" \
  -H "Authorization: Bearer $BLUETICKS_API_KEY"
FieldMeaning
nowUtc, isoUtcCurrent time in UTC.
nowLocal, isoLocalCurrent time in timezone.
epochMsEpoch milliseconds.
timezone, offsetMinutesThe timezone name and its current UTC offset in minutes.
isDstNowWhether daylight saving time is in effect.
sourceextension, gateway or server-fallback: which engine supplied the timezone.
warningPresent when the timezone may not be yours (see below).

Check source before trusting timezone:

  • extension: the browser extension's timezone, which is the user's own.
  • gateway: the timezone of the gateway server, usually UTC and not the user's. A warning is returned. Pass an explicit timezone wherever you build times.
  • server-fallback: no engine answered, so the server's clock was used. A warning is returned.

These routes are not part of the generated API reference, so this page is the reference for them.