Releases: Kit/ConvertKitSDK-PHP
2.3
- Added: update_tag_namemethod for https://developers.kit.com/api-reference/tags/update-tag-name: #115
- Added: tag_subscribersmethod for https://developers.kit.com/api-reference/tags/bulk-tag-subscribers: #114
- Added: get_broadcast_link_clicksmethod for https://developers.kit.com/api-reference/broadcasts/get-link-clicks-for-a-broadcast: #113
- Added: get_broadcasts_statsmethod for https://developers.kit.com/api-reference/broadcasts/get-stats-for-a-list-of-broadcasts: #112
- Added: get_subscriber_statsmethod for https://developers.kit.com/api-reference/subscribers/list-stats-for-a-subscriber: #110
- Updated: Kit Domain from convertkit.comtokit.com: #106
2.2
2.1
- Added: Support for the optional referrerparameter inadd_subscriber_to_formandadd_subscriber_to_form_by_emailmethods (#97)
- Added: add_subscribers_to_formsmethod, to support bulk subscribing subscribers to forms:
 https://developers.kit.com/v4.html#bulk-add-subscribers-to-forms (#98)
2.0
Version 2.0 of the SDK uses ConvertKit's v4 API, which replaces API Keys with OAuth, and introduces a number of new methods.
As such, this introduces a number of breaking changes, and it's strongly recommended to refer to the migration guide to migrate from the v1 SDK.
Documentation
Documentation can be found here.
PHP Version
The minimum supported PHP version is 8.0.  Users on older PHP versions should continue to use the v1 SDK.
Authentication
Authentication is now via OAuth.  It's recommended to refer to the README file's Getting Started section for implementation.
Initializing the ConvertKit_API class now accepts a clientID, clientSecret and accessToken in place of the existing api_key and api_secret:
$api = new \ConvertKit_API\ConvertKit_API(
    clientID: '<your_oauth_client_id>',
    clientSecret: '<your_oauth_client_secret>',
    accessToken: '<your_oauth_access_token>'
);Pagination
For list based endpoints which fetch data from the API (such as broadcasts, custom fields, subscribers, tags, email templates, forms, purchases etc.), cursor based pagination is used. The following parameters can be specified in the API methods:
- per_page: Defines the number of results to return, with a maximum value of 100
- after_cursor: When specified, returns the next page of results based on the current result's- pagination->end_cursorvalue
- before_cursor: When specified, returns the previous page of results based on the current result's- pagination->start_cursorvalue
Accounts
- Added: get_account_colors()
- Added: update_account_colors()
- Added: get_creator_profile()
- Added: get_email_stats()
- Added: get_growth_stats()
Broadcasts
- Updated: get_broadcasts()supports pagination
- Updated: create_broadcast():- email_layout_templateis now- email_template_id. To fetch the ID of the account's email templates, refer to- get_email_templates()
- preview_textoption added
- subscriber_filteroption added
 
- Updated: update_broadcast()- email_layout_templateis now- email_template_id. To fetch the ID of the account's email templates, refer to- get_email_templates()
- preview_textoption added
- subscriber_filteroption added
 
- Changed: destroy_broadcast()is renamed todelete_broadcast()
Custom Fields
- Added: create_custom_fields()to create multiple custom fields in a single request
- Updated: get_custom_fields()supports pagination
Subscribers
- Added: create_subscriber(). The concept of creating a subscriber via a form, tag or sequence is replaced with this new method. The subscriber can then be subscribed to resources (forms, tag, sequences) as necessary.
- Added: create_subscribers()to create multiple subscribers in a single request
- Added: get_subscribers()
- Changed: unsubscribe()is nowunsubscribe_by_email(). Useunsubscribe()for unsubscribing by a subscriber ID
- Updated: get_subscriber_tags()supports pagination
Tags
- Added: create_tags()to create multiple tags in a single request
- Updated: get_tags()supports pagination
- Updated: get_tag_subscriptions():- supports pagination
- supports filtering by subscribers by dates, covering created_after,created_before,tagged_afterandtagged_before
- sort_orderis no longer supported
 
- Changed: tag_subscriber()is nowtag_subscriber_by_email(). Usetag_subscriber()for tagging by subscriber ID
Email Templates
- Added: get_email_templates()
Forms
- Updated: get_forms():- supports pagination
- only returns active forms by default. Use the statusparameter to filter byactive,archived,trashedorall
 
- Updated: get_landing_pages():- supports pagination
- only returns active landing pages by default. Use the statusparameter to filter byactive,archived,trashedorall
 
- Updated: get_form_subscriptions():- supports pagination
- supports filtering by subscribers by dates, covering created_after,created_before,added_afterandadded_before
- sort_orderis no longer supported
 
- Changed: add_subscriber_to_form()is nowadd_subscriber_to_form_by_email(). Useadd_subscriber_to_form()for adding subscriber to form by subscriber ID
Purchases
- Updated: create_purchase()now supports named parameters for purchase data, instead of an$optionsarray
- Changed: list_purchases()is nowget_purchases(), with pagination support
Segments
- Added: get_segments()
Sequences
- Changed: add_subscriber_to_sequence()is nowadd_subscriber_to_sequence_by_email(). Useadd_subscriber_to_sequence()for adding a subscriber to a sequence by subscriber ID
- Updated: get_sequences()supports pagination
- Updated: get_sequence_subscriptions():- supports pagination
- supports filtering by subscribers by dates, covering created_after,created_before,added_afterandadded_before
- sort_orderis no longer supported
 
Webhooks
- Added: get_webhooks()
- Changed: destroy_webhook()is nowdelete_webhook()
Other
- Removed: form_subscribe()was previously deprecated. Useadd_subscriber_to_form()oradd_subscriber_to_form_by_email()
- Removed: add_tag()was previously deprecated. Usetag_subscriber()ortag_subscriber_by_email()
1.3
1.2
1.1
1.0
Documentation
Documentation for 1.0 can be found here.
Deprecations / Notices
- PHP: Minimum supported version is now 7.4
- add_tag()will trigger an- E_USER_NOTICE, as the method name is misleading, and we prefer methods with named arguments; use- tag_subscribe()(#44)
- form_subscribe()will trigger an- E_USER_NOTICE, as we prefer methods with named arguments; use- add_subscriber_to_form()(#54)
- form_unsubscribe()will trigger an- E_USER_NOTICE, as the method name is misleading, and we prefer methods with named arguments; use- unsubscribe()(#45)
Features / Additions
- Added User-Agent on API requests (#34)
- Added get(),post(),put()anddelete()methods (#36)
- Added get_forms()andget_landing_pages()methods (#41)
- Added get_form_subscriptions()method (#42)
- Added Tag methods get_tags(),create_tag(),tag_subscriber(),remove_tag_from_subscriber(),remove_tag_from_subscriber_by_email()(#44)
- Added Subscriber methods update_subscriber(),unsubscribe()(#45)
- Added add_subscriber_to_sequence()to support name, custom fields and tags (#43)
- Added Custom Field methods get_custom_fields(),add_custom_field(),add_custom_fields(),update_custom_field(),delete_custom_field()(#46)
- Added Purchase method get_purchase()(#47)
- Added Webhook methods create_webhook(), `destroy_webhook() (#48)
- Added Broadcast methods create_broadcast(),get_broadcast(),get_broadcast_stats(),update_broadcast(),destroy_broadcast()
Fixes / Improvements
- Fixed: Guzzle version set to 6.5 or higher (#20, #26, #27)
- Fixed: get_subscriber_id()performance (#21, #22, #29, #39)
- Refactored: fetching legacy forms and landing pages (#32)
- Refactored: using api_versionproperty, API calls and logging (#37, #38)
- Removed: Caching of resources and markup in class life cycle (#52)
- Removed: InvalidArgumentExceptionwhere type hints for methods now exist (#43)