stackone / client-sdk
Requires
- php: >=8.2
- brick/date-time: >=0.7.0
- brick/math: >=0.12.1
- galbar/jsonpath: >=3.0
- guzzlehttp/guzzle: ^7.0
- phpdocumentor/type-resolver: >=1.8
- speakeasy/serializer: ^4.0.3
Requires (Dev)
- laravel/pint: >=1.21.2
- phpstan/phpstan: >=2.1.0
- phpunit/phpunit: >=10
- roave/security-advisories: dev-latest
- dev-main
- v0.25.1
- v0.25.0
- v0.24.2
- v0.24.1
- v0.24.0
- v0.23.3
- v0.23.2
- v0.23.0
- v0.22.2
- v0.22.1
- v0.22.0
- v0.21.0
- v0.19.0
- v0.17.0
- v0.15.0
- v0.13.0
- v0.11.0
- v0.9.0
- v0.7.0
- v0.5.0
- v0.3.0
- v0.1.1
- dev-speakeasy-sdk-regen-1753453953
- dev-speakeasy-sdk-regen-1740269030
- dev-speakeasy-sdk-regen-1739059429
- dev-speakeasy-sdk-regen-1738749266
- dev-speakeasy-sdk-regen-1731801831
- dev-speakeasy-sdk-regen-1730420735
- dev-speakeasy-sdk-regen-1730309622
- dev-speakeasy-sdk-regen-1730247786
- dev-update-workflow
- dev-speakeasy-sdk-regen-1730198670
- dev-speakeasy-sdk-regen-1730197321
- dev-speakeasy-sdk-regen-1730161408
- dev-speakeasy-sdk-regen-1730055318
- dev-speakeasy-sdk-regen-1729902135
- dev-speakeasy-sdk-regen-1729753501
- dev-speakeasy-sdk-regen-1729642971
- dev-speakeasy-sdk-regen-1729038171
- dev-speakeasy-sdk-regen-1728980686
- dev-speakeasy-sdk-regen-1728939372
- dev-speakeasy-sdk-regen-1728388554
- dev-speakeasy-sdk-regen-1728382823
This package is auto-updated.
Last update: 2025-07-25 15:32:04 UTC
README
Summary
Marketing: The documentation for the StackOne Unified API - MARKETING
Table of Contents
SDK Installation
The SDK relies on Composer to manage its dependencies.
To install the SDK and add it as a dependency to an existing composer.json
file:
composer require "stackone/client-sdk"
SDK Example Usage
List Employees
declare(strict_types=1); require 'vendor/autoload.php'; use StackOne\client; use StackOne\client\Models\Components; use StackOne\client\Models\Operations; $sdk = client\StackOne::builder() ->setSecurity( new Components\Security( username: '', password: '', ) ) ->build(); $request = new Operations\HrisListEmployeesRequest( xAccountId: '<id>', fields: 'id,remote_id,first_name,last_name,name,display_name,gender,ethnicity,date_of_birth,birthday,marital_status,avatar_url,avatar,personal_email,personal_phone_number,work_email,work_phone_number,job_id,remote_job_id,job_title,job_description,department_id,remote_department_id,department,cost_centers,company,manager_id,remote_manager_id,hire_date,start_date,tenure,work_anniversary,employment_type,employment_contract_type,employment_status,termination_date,company_name,company_id,remote_company_id,preferred_language,citizenships,home_location,work_location,employments,custom_fields,documents,created_at,updated_at,benefits,employee_number,national_identity_number,national_identity_numbers,skills', filter: new Operations\HrisListEmployeesQueryParamFilter( updatedAfter: '2020-01-01T00:00:00.000Z', ), expand: 'company,employments,work_location,home_location,groups,skills', include: 'avatar_url,avatar,custom_fields,job_description,benefits', ); $responses = $sdk->hris->listEmployees( request: $request ); foreach ($responses as $response) { if ($response->statusCode === 200) { // handle response } }
Authentication
Per-Client Security Schemes
This SDK supports the following security scheme globally:
Name | Type | Scheme |
---|---|---|
username password |
http | HTTP Basic |
You can set the security parameters through the setSecurity
function on the SDKBuilder
when initializing the SDK. For example:
declare(strict_types=1); require 'vendor/autoload.php'; use StackOne\client; use StackOne\client\Models\Components; $sdk = client\StackOne::builder() ->setSecurity( new Components\Security( username: '', password: '', ) ) ->build(); $request = new Components\ConnectSessionCreate( categories: [ Components\Categories::Ats, Components\Categories::Hris, Components\Categories::Ticketing, Components\Categories::Crm, Components\Categories::Iam, Components\Categories::Marketing, Components\Categories::Lms, Components\Categories::Iam, Components\Categories::Documents, Components\Categories::Ticketing, Components\Categories::Screening, Components\Categories::Messaging, Components\Categories::Accounting, ], originOwnerId: '<id>', originOwnerName: '<value>', ); $response = $sdk->connectSessions->createConnectSession( request: $request ); if ($response->connectSessionTokenAuthLink !== null) { // handle response }
Available Resources and Operations
Available methods
accounts
- listLinkedAccounts - List Accounts
- getAccount - Get Account
- deleteAccount - Delete Account
- updateAccount - Update Account
- getAccountMetaInfo - Get meta information of the account
ats
- listApplications - List Applications
- createApplication - Create Application
- getApplication - Get Application
- updateApplication - Update an Application
- listApplicationsOffers - List Application Offers
- moveApplication - Move Application
- rejectApplication - Reject Application
- getApplicationOffer - Get Application Offer
- listApplicationScorecards - List Application Scorecards
- getApplicationScorecard - Get Application Scorecard
- listApplicationChanges - List Application Changes
- listApplicationNotes - List Application Notes
- createApplicationNote - Create Application Note
- getApplicationNote - Get Application Note
- updateApplicationNote - Update an Application Note
- listApplicationsScheduledInterviews - List Applications scheduled interviews
- getApplicationScheduledInterview - Get Applications scheduled interview
- uploadApplicationDocument - Upload Application Document
- downloadApplicationDocument - Download Application Document
- listApplicationDocuments - List Application Documents
- getApplicationDocument - Get Application Document
- listCandidates - List Candidates
- createCandidate - Create Candidate
- getCandidate - Get Candidate
- updateCandidate - Update Candidate
- listCandidateNotes - List Candidate Notes
- createCandidateNote - Create Candidate Note
- getCandidateNote - Get Candidate Note
- listApplicationCustomFieldDefinitions - List Application Custom Field Definitions
- getApplicationCustomFieldDefinition - Get Application Custom Field Definition
- listCandidateCustomFieldDefinitions - List Candidate Custom Field Definitions
- getCandidateCustomFieldDefinition - Get Candidate Custom Field Definition
- listJobCustomFieldDefinitions - List Job Custom Field Definitions
- getJobCustomFieldDefinition - Get Job Custom Field Definition
- listDepartments - List Departments
- getDepartment - Get Department
- listInterviewStages - List Interview Stages
- getInterviewStage - Get Interview Stage
- listInterviews - List Interviews
- getInterview - Get Interview
- listJobs - List Jobs
- createJob - Create Job
- getJob - Get Job
- updateJob - Update Job
- listLists - Get all Lists
- getList - Get List
- listLocations - List locations
- getLocation - Get Location
- listRejectedReasons - List Rejected Reasons
- getRejectedReason - Get Rejected Reason
- listUsers - List Users
- getUser - Get User
- listJobPostings - List Job Postings
- getJobPosting - Get Job Posting
- listOffers - List Offers
- createOffer - Creates an offer
- getOffer - Get Offer
- listAssessmentsPackages - List Assessments Packages
- getAssessmentsPackage - Get Assessments Package
- orderAssessmentsRequest - Order Assessments Request
- updateAssessmentsResult - Update Assessments Result
- getAssessmentsResult - Get Assessments Results
- listBackgroundCheckPackages - List Background Check Packages
- createBackgroundCheckPackage - Create Background Check Package
- getBackgroundCheckPackage - Get Background Check Package
- deleteBackgroundCheckPackage - Delete Background Check Package
- updateBackgroundCheckPackage - Update Background Check Package
- orderBackgroundCheckRequest - Order Background Check Request
- updateBackgroundCheckResult - Update Background Check Result
- getBackgroundCheckResult - Get Background Check Results
- listApplicationDocumentCategories - List Application Document Categories
- getApplicationDocumentCategory - Get Application Document Category
connectors
- listConnectorsMeta - List Connectors Meta Information for all providers
- getConnectorMeta - Get Connector Meta information for the given provider key
connectSessions
- createConnectSession - Create Connect Session
- authenticateConnectSession - Authenticate Connect Session
crm
- listContacts - List Contacts
- createContact - Creates a new Contact
- getContact - Get Contact
- updateContact - Update Contact (early access)
- listAccounts - List Accounts
- getAccount - Get Account
- listLists - Get all Lists
- getList - Get List
- listContactCustomFieldDefinitions - List Contact Custom Field Definitions
- getContactCustomFieldDefinition - Get Contact Custom Field Definition
hris
- listCompanies - List Companies
- getCompany - Get Company
- listEmployeeCustomFieldDefinitions - List employee Custom Field Definitions
- getEmployeeCustomFieldDefinition - Get employee Custom Field Definition
- listEmployees - List Employees
- createEmployee - Creates an employee
- getEmployee - Get Employee
- updateEmployee - Updates an employee
- inviteEmployee - Invite Employee
- listEmployeeTimeOffRequests - List Employee Time Off Requests
- createEmployeeTimeOffRequest - Create Employee Time Off Request
- getEmployeesTimeOffRequest - Get Employees Time Off Request
- cancelEmployeeTimeOffRequest - Cancel Employee Time Off Request
- updateEmployeeTimeOffRequest - Update Employee Time Off Request
- batchUploadEmployeeDocument - Batch Upload Employee Document
- uploadEmployeeDocument - Upload Employee Document
- downloadEmployeeDocument - Download Employee Document
- listEmployeeDocuments - List Employee Documents
- getEmployeeDocument - Get Employee Document
- listEmployeeCategories - List Employee Document Categories
- getEmployeeDocumentCategory - Get Employee Document Category
- listEmployeeWorkEligibility - List Employee Work Eligibility
- createEmployeeWorkEligibilityRequest - Create Employee Work Eligibility Request
- getEmployeesWorkEligibility - Get Employees Work Eligibility
- updateEmployeeWorkEligibilityRequest - Update Employee Work Eligibility Request
- listEmployeeTimeOffBalances - List Employee Time Off Balances
- getEmployeeTimeOffBalance - Get Employee Time Off Balance
- listEmployments - List Employments
- getEmployment - Get Employment
- listEmployeeEmployments - List Employee Employments
- createEmployeeEmployment - Create Employee Employment
- getEmployeeEmployment - Get Employee Employment
- updateEmployeeEmployment - Update Employee Employment
- listGroups - List Groups
- listDepartmentGroups - List Department Groups
- listCostCenterGroups - List Cost Center Groups
- listTeamGroups - List Team Groups
- listDivisionGroups - List Division Groups
- listCompaniesGroups - List Companies Groups
- getGroup - Get Group
- getDepartmentGroup - Get Department Group
- getCostCenterGroup - Get Cost Center Group
- getTeamGroup - Get Team Group
- getDivisionGroup - Get Division Group
- getCompanyGroup - Get Company Group
- listJobs - List Jobs
- getJob - Get Job
- listLocations - List Work Locations
- getLocation - Get Work Location
- listPositions - List Positions
- getPosition - Get Position
- listTimeEntries - List Time Entries
- getTimeEntries - Get Time Entry
- listTimeOffRequests - List time off requests
- getTimeOffRequest - Get time off request
- listShifts - List Shifts
- getShift - Get Shift
listTimeOffTypes- List time off types ⚠️ DeprecatedgetTimeOffType- Get time off type ⚠️ Deprecated- listTimeOffPolicies - List Time Off Policies
- getTimeOffPolicy - Get Time Off Policy
- listEmployeeTimeOffPolicies - List Assigned Time Off Policies
- listBenefits - List benefits
- getBenefit - Get Benefit
- listEmployeeSkills - List Employee Skills
- createEmployeeSkill - Create Employee Skill
- getEmployeeSkill - Get Employee Skill
- listEmployeeTasks - List Employee Tasks
- getEmployeeTask - Get Employee Task
- listTasks - List Tasks
- getTask - Get Task
iam
- listUsers - List Users
- getUser - Get User
- deleteUser - Delete User
- updateUser - Update User
- listRoles - List Roles
- getRole - Get Role
- listGroups - List Groups
- getGroup - Get Group
- listPolicies - List Policies
- getPolicy - Get Policy
lms
- listCourses - List Courses
- getCourse - Get Course
- listUserAssignments - List User Assignments
- createUserAssignment - Create User Assignment
- getUserAssignment - Get User Assignment
- batchUpsertContent - Batch Upsert Content
- listContent - List Content
- upsertContent - Upsert Content
- getContent - Get Content
- updateContent - Update Content
- listUserCompletions - List User Completions
- createUserCompletion - Create User Completion
- getUserCompletion - Get User Completion
- deleteUserCompletion - Delete User Completion
- listCompletions - List Completions
- getCompletion - Get Completion
- getCategory - Get Category
- listCategories - List Categories
- listUsers - List Users
- getUser - Get User
- getSkill - Get Skill
- listSkills - List Skills
- listAssignments - List Assignments
- getAssignment - Get Assignment
marketing
- listEmailTemplates - List Email Templates
- createEmailTemplate - Create Email Templates
- getEmailTemplate - Get Email Templates
- updateEmailTemplate - Update Email Templates
- listInAppTemplates - List In-App Templates
- createInAppTemplate - Create In-App Template
- getInAppTemplate - Get In-App Template
- updateInAppTemplate - Update In-App Template
- listSmsTemplates - List SMS Templates
- createSmsTemplate - Create SMS Template
- getSmsTemplate - Get SMS Template
- updateSmsTemplate - Update SMS Template
listOmniChannelTemplates- List Omni-Channel Templates ⚠️ DeprecatedcreateOmniChannelTemplate- Create Omni-Channel Template ⚠️ DeprecatedgetOmniChannelTemplate- Get Omni-Channel Template ⚠️ DeprecatedupdateOmniChannelTemplate- Update Omni-Channel Template ⚠️ Deprecated- listPushTemplates - List Push Templates
- createPushTemplate - Create Push Template
- getPushTemplate - Get Push Template
- updatePushTemplate - Update Push Template
- listCampaigns - List campaigns
- getCampaign - Get campaign
- listContentBlocks - List Content Blocks
- createContentBlock - Create Content Block
- getContentBlock - Get Content Blocks
- updateContentBlock - Update Content Block
proxy
- proxyRequest - Proxy Request
requestLogs
- listStepLogs - List Step Logs
- getLog - Get a Log
- listLogs - List Logs
Pagination
Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the
returned object will be a Generator
instead of an individual response.
Working with generators is as simple as iterating over the responses in a foreach
loop, and you can see an example below:
declare(strict_types=1); require 'vendor/autoload.php'; use StackOne\client; use StackOne\client\Models\Components; use StackOne\client\Models\Operations; $sdk = client\StackOne::builder() ->setSecurity( new Components\Security( username: '', password: '', ) ) ->build(); $request = new Operations\HrisListCompaniesRequest( xAccountId: '<id>', fields: 'id,remote_id,name,full_name,display_name,created_at,updated_at', filter: new Operations\HrisListCompaniesQueryParamFilter( updatedAfter: '2020-01-01T00:00:00.000Z', ), ); $responses = $sdk->hris->listCompanies( request: $request ); foreach ($responses as $response) { if ($response->statusCode === 200) { // handle response } }
Retries
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
To change the default retry strategy for a single API call, simply provide an Options
object built with a RetryConfig
object to the call:
declare(strict_types=1); require 'vendor/autoload.php'; use StackOne\client; use StackOne\client\Models\Components; use StackOne\client\Utils\Retry; $sdk = client\StackOne::builder() ->setSecurity( new Components\Security( username: '', password: '', ) ) ->build(); $request = new Components\ConnectSessionCreate( categories: [ Components\Categories::Ats, Components\Categories::Hris, Components\Categories::Ticketing, Components\Categories::Crm, Components\Categories::Iam, Components\Categories::Marketing, Components\Categories::Lms, Components\Categories::Iam, Components\Categories::Documents, Components\Categories::Ticketing, Components\Categories::Screening, Components\Categories::Messaging, Components\Categories::Accounting, ], originOwnerId: '<id>', originOwnerName: '<value>', ); $response = $sdk->connectSessions->createConnectSession( request: $request, options: Utils\Options->builder()->setRetryConfig( new Retry\RetryConfigBackoff( initialInterval: 1, maxInterval: 50, exponent: 1.1, maxElapsedTime: 100, retryConnectionErrors: false, ))->build() ); if ($response->connectSessionTokenAuthLink !== null) { // handle response }
If you'd like to override the default retry strategy for all operations that support retries, you can pass a RetryConfig
object to the SDKBuilder->setRetryConfig
function when initializing the SDK:
declare(strict_types=1); require 'vendor/autoload.php'; use StackOne\client; use StackOne\client\Models\Components; use StackOne\client\Utils\Retry; $sdk = client\StackOne::builder() ->setRetryConfig( new Retry\RetryConfigBackoff( initialInterval: 1, maxInterval: 50, exponent: 1.1, maxElapsedTime: 100, retryConnectionErrors: false, ) ) ->setSecurity( new Components\Security( username: '', password: '', ) ) ->build(); $request = new Components\ConnectSessionCreate( categories: [ Components\Categories::Ats, Components\Categories::Hris, Components\Categories::Ticketing, Components\Categories::Crm, Components\Categories::Iam, Components\Categories::Marketing, Components\Categories::Lms, Components\Categories::Iam, Components\Categories::Documents, Components\Categories::Ticketing, Components\Categories::Screening, Components\Categories::Messaging, Components\Categories::Accounting, ], originOwnerId: '<id>', originOwnerName: '<value>', ); $response = $sdk->connectSessions->createConnectSession( request: $request ); if ($response->connectSessionTokenAuthLink !== null) { // handle response }
Error Handling
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.
By default an API error will raise a Errors\SDKException
exception, which has the following properties:
Property | Type | Description |
---|---|---|
$message |
string | The error message |
$statusCode |
int | The HTTP status code |
$rawResponse |
?\Psr\Http\Message\ResponseInterface | The raw HTTP response |
$body |
string | The response content |
When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective Errors tables in SDK docs for more details on possible exception types for each operation. For example, the createConnectSession
method throws the following exceptions:
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\ForbiddenResponse | 403 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\RequestTimedOutResponse | 408 | application/json |
Errors\ConflictResponse | 409 | application/json |
Errors\UnprocessableEntityResponse | 422 | application/json |
Errors\TooManyRequestsResponse | 429 | application/json |
Errors\InternalServerErrorResponse | 500 | application/json |
Errors\NotImplementedResponse | 501 | application/json |
Errors\BadGatewayResponse | 502 | application/json |
Errors\SDKException | 4XX, 5XX | */* |
Example
declare(strict_types=1); require 'vendor/autoload.php'; use StackOne\client; use StackOne\client\Models\Components; use StackOne\client\Models\Errors; $sdk = client\StackOne::builder() ->setSecurity( new Components\Security( username: '', password: '', ) ) ->build(); try { $request = new Components\ConnectSessionCreate( categories: [ Components\Categories::Ats, Components\Categories::Hris, Components\Categories::Ticketing, Components\Categories::Crm, Components\Categories::Iam, Components\Categories::Marketing, Components\Categories::Lms, Components\Categories::Iam, Components\Categories::Documents, Components\Categories::Ticketing, Components\Categories::Screening, Components\Categories::Messaging, Components\Categories::Accounting, ], originOwnerId: '<id>', originOwnerName: '<value>', ); $response = $sdk->connectSessions->createConnectSession( request: $request ); if ($response->connectSessionTokenAuthLink !== null) { // handle response } } catch (Errors\BadRequestResponseThrowable $e) { // handle $e->$container data throw $e; } catch (Errors\UnauthorizedResponseThrowable $e) { // handle $e->$container data throw $e; } catch (Errors\ForbiddenResponseThrowable $e) { // handle $e->$container data throw $e; } catch (Errors\NotFoundResponseThrowable $e) { // handle $e->$container data throw $e; } catch (Errors\RequestTimedOutResponseThrowable $e) { // handle $e->$container data throw $e; } catch (Errors\ConflictResponseThrowable $e) { // handle $e->$container data throw $e; } catch (Errors\UnprocessableEntityResponseThrowable $e) { // handle $e->$container data throw $e; } catch (Errors\TooManyRequestsResponseThrowable $e) { // handle $e->$container data throw $e; } catch (Errors\InternalServerErrorResponseThrowable $e) { // handle $e->$container data throw $e; } catch (Errors\NotImplementedResponseThrowable $e) { // handle $e->$container data throw $e; } catch (Errors\BadGatewayResponseThrowable $e) { // handle $e->$container data throw $e; } catch (Errors\SDKException $e) { // handle default exception throw $e; }
Server Selection
Override Server URL Per-Client
The default server can be overridden globally using the setServerUrl(string $serverUrl)
builder method when initializing the SDK client instance. For example:
declare(strict_types=1); require 'vendor/autoload.php'; use StackOne\client; use StackOne\client\Models\Components; $sdk = client\StackOne::builder() ->setServerURL('https://api.stackone.com') ->setSecurity( new Components\Security( username: '', password: '', ) ) ->build(); $request = new Components\ConnectSessionCreate( categories: [ Components\Categories::Ats, Components\Categories::Hris, Components\Categories::Ticketing, Components\Categories::Crm, Components\Categories::Iam, Components\Categories::Marketing, Components\Categories::Lms, Components\Categories::Iam, Components\Categories::Documents, Components\Categories::Ticketing, Components\Categories::Screening, Components\Categories::Messaging, Components\Categories::Accounting, ], originOwnerId: '<id>', originOwnerName: '<value>', ); $response = $sdk->connectSessions->createConnectSession( request: $request ); if ($response->connectSessionTokenAuthLink !== null) { // handle response }
Development
Maturity
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
Contributions
While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.