agentpushkit / client
The complete Agent Push Kit REST API. Application event ingestion uses an organization key beginning with `apk_`. Authenticated user operations accept either an Agent Push Kit login JWT or an agent access token beginning with `apt_`.
Requires
- php: ^8.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- phpunit/phpunit: ^8.0 || ^9.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
The complete Agent Push Kit REST API. Application event ingestion uses an organization key beginning with apk_. Authenticated user operations accept either an Agent Push Kit login JWT or an agent access token beginning with apt_.
For more information, please visit https://agentpushkit.com.
Installation & Usage
Requirements
PHP 8.1 and later.
Composer
To install the bindings via Composer, add the following to composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/JustinBStrong/agent-push-kit-php.git"
}
],
"require": {
"JustinBStrong/agent-push-kit-php": "*@dev"
}
}
Then run composer install
Manual Installation
Download the files and include autoload.php:
<?php require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure Bearer (Agent Push Kit JWT or apt_ token) authorization: UserOrAgent $config = AgentPushKit\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new AgentPushKit\Api\AccountApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); try { $result = $apiInstance->deleteCurrentAccount(); print_r($result); } catch (Exception $e) { echo 'Exception when calling AccountApi->deleteCurrentAccount: ', $e->getMessage(), PHP_EOL; }
API Endpoints
All URIs are relative to https://api.chatdna.co/agent-push-kit/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AccountApi | deleteCurrentAccount | DELETE /me | Delete the current user and customer accounts they own |
| AccountApi | getCurrentAccount | GET /me | Get the current user and customer accounts |
| AgentTokensApi | callMcp | POST /mcp | Connect through stateless MCP Streamable HTTP |
| AgentTokensApi | createAgentToken | POST /agent-tokens | Create a named non-expiring agent token |
| AgentTokensApi | listAgentTokens | GET /agent-tokens | List agent access tokens without their secrets |
| AgentTokensApi | revokeAgentToken | DELETE /agent-tokens/{tokenId} | Revoke one of the current user's agent tokens |
| AuthenticationApi | completePasswordReset | POST /auth/password-reset/complete | Choose a new password and log in |
| AuthenticationApi | loginWithApple | POST /auth/apple | Log in or attach an account using a Sign in with Apple identity token |
| AuthenticationApi | loginWithGoogle | POST /auth/google | Log in or attach an account using a verified Google ID token |
| AuthenticationApi | loginWithPassword | POST /auth/login | Log in with email and password |
| AuthenticationApi | register | POST /auth/register | Create a user and first customer account |
| AuthenticationApi | requestPasswordReset | POST /auth/password-reset/request | Email a single-use password reset token |
| CustomerAccountsApi | addOrganizationMember | POST /organizations/{organizationId}/members | Add an already-registered user to a customer account |
| CustomerAccountsApi | createOrganization | POST /organizations | Create another Agent Push Kit customer account |
| CustomerAccountsApi | listOrganizationMembers | GET /organizations/{organizationId}/members | List members of a customer account |
| CustomerAccountsApi | listOrganizations | GET /organizations | List customer accounts available to the current user |
| CustomerAccountsApi | regenerateOrganizationApiKey | POST /organizations/{organizationId}/api-key/regenerate | Rotate the application event-ingestion key |
| DevicesApi | getWebPushConfiguration | GET /web-push/configuration | Get browser push availability and its public VAPID key |
| DevicesApi | registerDevice | POST /devices | Register or refresh an APNs device |
| DevicesApi | registerWebPushSubscription | POST /web-push/subscriptions | Register or refresh a browser push subscription |
| DevicesApi | removeDevice | DELETE /devices/{installationId} | Disable push delivery to one installation |
| DevicesApi | removeWebPushSubscription | DELETE /web-push/subscriptions/{subscriptionId} | Disable a browser push subscription |
| EventsApi | getEvent | GET /organizations/{organizationId}/events/{eventId} | Get one event including metadata |
| EventsApi | listEvents | GET /organizations/{organizationId}/events | List a paginated inbox |
| EventsApi | listNotificationTypes | GET /organizations/{organizationId}/types | List distinct notification types |
| EventsApi | listServices | GET /organizations/{organizationId}/services | List services discovered from ingested events |
| EventsApi | searchEvents | POST /organizations/{organizationId}/events/search | Search events with a validated Boolean filter tree |
| EventsApi | sendEvent | POST /events | Send an event using an application ingestion key |
| EventsApi | sendEventAsUser | POST /organizations/{organizationId}/events | Send an event as an authenticated user or agent |
| HealthApi | getHealth | GET /health | Check Agent Push Kit API health |
| PreferencesApi | listPreferences | GET /organizations/{organizationId}/preferences | List service defaults and exact-type overrides |
| PreferencesApi | removeTypePreference | DELETE /services/{serviceId}/types/{type}/preference | Remove an exact-type override so it inherits the service default |
| PreferencesApi | setServicePreference | PUT /services/{serviceId}/preference | Enable or disable pushes for a service by default |
| PreferencesApi | setTypePreference | PUT /services/{serviceId}/types/{type}/preference | Override push delivery for one exact notification type |
Models
- AcceptedResponse
- AddMemberInput
- AgentToken
- AgentTokenCreated
- ApiKeySummary
- AuthResponse
- CreateAgentTokenInput
- CreateOrganizationInput
- CurrentAccount
- DeletedResponse
- DeliverySummary
- Device
- DisabledResponse
- ErrorResponse
- EventDetail
- EventFilter
- EventPage
- EventSummary
- FilterGroup
- FilterNot
- HealthResponse
- IngestionResult
- InheritedResponse
- Membership
- MembershipUser
- Organization
- OrganizationApiKeyCreated
- OrganizationCount
- OrganizationCreated
- OrganizationRecord
- PasswordLoginInput
- PasswordResetCompleteInput
- PasswordResetRequestInput
- PreferenceRecord
- ProviderLoginInput
- RegisterDeviceInput
- RegisterInput
- RegisterWebPushSubscriptionInput
- RegisterWebPushSubscriptionInputKeys
- RevokedResponse
- SearchEventsInput
- SendEventInput
- Service
- ServiceAllOfCount
- ServicePreference
- ServiceSummary
- SetEnabledInput
- TextFilterCondition
- TimeFilterCondition
- TypeOverride
- User
- WebPushConfiguration
- WebPushSubscription
Authorization
Authentication schemes defined for the API:
UserOrAgent
- Type: Bearer authentication (Agent Push Kit JWT or apt_ token)
AgentToken
- Type: Bearer authentication (apt_)
OrganizationApiKey
- Type: Bearer authentication (apk_)
Tests
To run the tests, use:
composer install vendor/bin/phpunit
Author
About this package
This PHP package is automatically generated by the OpenAPI Generator project:
- API version:
0.1.0- Package version:
0.1.0 - Generator version:
7.24.0
- Package version:
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen