PHP SDK
composer require glytos/glytosAny PSR-18 HTTP client works and is discovered automatically; most frameworks already ship one. If yours does not:
composer require guzzlehttp/guzzleSetup
use Glytos\Client;
$glytos = new Client(getenv('GLYTOS_API_KEY'));To act in a specific environment, name it - dev, staging, prod, or an environment
uuid. It defaults to Development.
$prod = new Client(getenv('GLYTOS_API_KEY'), environment: 'prod');Resources
$glytos->workflows->list();
$glytos->workflows->retrieve($workflowUuid);
$glytos->workflows->create(name: 'Receptionist', mode: 'prompt');
$glytos->calls->create([
'transport' => 'phone',
'workflow_uuid' => $workflowUuid,
'to_number' => '+1...',
]);
$glytos->calls->list();
$glytos->workflows->session($workflowUuid, $sessionUuid);Laravel
Set GLYTOS_API_KEY in .env; the service provider and Glytos facade are
auto-discovered. Inject the client anywhere:
use Glytos\Client;
public function __construct(private Client $glytos) {}
$agents = $this->glytos->workflows->list();Anything not wrapped
$glytos->request('GET', '/providers');Verifying webhooks
use Glytos\Webhook;
// `$rawBody` must be the untouched request body - parsing and re-serialising it
// changes the bytes and the signature will not match.
$ok = Webhook::verify($rawBody, $_SERVER['HTTP_X_GLYTOS_SIGNATURE'] ?? '', $secret);See Webhooks.