PHPackages                             buddy-works/buddy-works-php-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. buddy-works/buddy-works-php-api

ActiveLibrary[API Development](/categories/api)

buddy-works/buddy-works-php-api
===============================

Buddy Works SDK for PHP

1.4.0(4y ago)1425.1k↑2281.3%7[3 PRs](https://github.com/buddy-works/buddy-works-php-api/pulls)1Apache-2.0PHPPHP ^8.0

Since Dec 4Pushed 3y ago3 watchersCompare

[ Source](https://github.com/buddy-works/buddy-works-php-api)[ Packagist](https://packagist.org/packages/buddy-works/buddy-works-php-api)[ Docs](https://github.com/buddy-works/buddy-works-php-api)[ RSS](/packages/buddy-works-buddy-works-php-api/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (5)Versions (9)Used By (1)

Buddy Works APIs PHP SDK
========================

[](#buddy-works-apis-php-sdk)

[![Minimum PHP Version](https://camo.githubusercontent.com/905c670b6e3bc20026bddbc8923df4d38111e526b88f1252ac4ceb6643299d96/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e302d3838393242462e737667)](https://php.net/)[![buddy branch](https://camo.githubusercontent.com/dc69f1b1662415127be8fafd9091b6a07bc800f16f2a0180e5039a67197fe258/68747470733a2f2f6170702e62756464792e776f726b732f62756464792d776f726b732f62756464792d776f726b732d7068702d6170692f7265706f7369746f72792f6272616e63682f6d61737465722f62616467652e7376673f746f6b656e3d62653034653737636232316430653765363131383533653930336535323162613233336530316434363639396131653664633030663835613835336362646436 "buddy branch")](https://app.buddy.works/buddy-works/buddy-works-php-api/repository/branch/master)[![Latest Stable Version](https://camo.githubusercontent.com/2197e3b7ee83ea055c9d6fc12b2e61d68b0c3e3eeab846b823da8f2f7dcf7130/68747470733a2f2f706f7365722e707567782e6f72672f62756464792d776f726b732f62756464792d776f726b732d7068702d6170692f762f737461626c653f666f726d61743d666c6174)](https://packagist.org/packages/buddy-works/buddy-works-php-api)[![GitHub](https://camo.githubusercontent.com/389a0d3a5cb92ae18f201ee7e4c18e36aa08bae560dd555e8c110664b6ff9608/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f62756464792d776f726b732f62756464792d776f726b732d7068702d617069)](https://camo.githubusercontent.com/389a0d3a5cb92ae18f201ee7e4c18e36aa08bae560dd555e8c110664b6ff9608/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f62756464792d776f726b732f62756464792d776f726b732d7068702d617069)

Official PHP client library for [Buddy Build Server with CI](https://buddy.works).

Installation
------------

[](#installation)

This library is distributed on `packagist` and is working with `composer`. In order to add it as a dependency, run the following command:

```
composer require buddy-works/buddy-works-php-api
```

### Compatibility

[](#compatibility)

PHP versionSDK version^8.01.4^7.31.3^7.21.25.51.1Usage of OAUTH
--------------

[](#usage-of-oauth)

First you need to add application in your [Buddy ID](https://app.buddy.works/my-apps).

You will then obtain clientId &amp; clientSecret to execute this code:

```
$buddy = new Buddy\Buddy([
  'clientId' => 'your-client-id',
  'clientSecret' => 'your-client-secret'
]);
try {
  $url = $buddy->getOAuth()->getAuthorizeUrl([
    Buddy\BuddyOAuth::SCOPE_MANAGE_EMAILS
  ], 'state', 'redirectUrl');
} catch(Buddy\Exceptions\BuddySDKException $e) {
  echo 'Buddy SDK return an error: ' . $e->getMessage();
  exit;
}
```

`scopes` are arrays of strings - [help](https://buddy.works/api/reference/getting-started/oauth#supported-scopes)

`state` should be an unguessable random string. It is used to protect against cross-site request forgery attacks.

`redirectUrl` is optional [more](https://buddy.works/api/reference/getting-started/oauth#web-application-flow)

You should redirect the user to the created URL. Upon authorization, the user should get back to your page (configured in application or passed to the method)

`query params` will get you the code &amp; state. State should be the same as you passed before. Code is used in next step to exchange for access token:

```
$buddy = new Buddy\Buddy([
  'clientId' => 'your-client-id',
  'clientSecret' => 'your-client-secret'
]);
try {
  $auth = $buddy->getOAuth()->getAccessToken('state');
} catch(Buddy\Exceptions\BuddyResponseException $e) {
  echo 'Buddy API return an error: ' . $e->getMessage();
  exit;
} catch(Buddy\Exceptions\BuddySDKException $e) {
  echo 'Buddy SDK return an error: ' . $e->getMessage();
  exit;
}
var_dump($auth);
```

State should be the same as in getAuthorizeUrl method.

Usage of direct tokens
----------------------

[](#usage-of-direct-tokens)

You can also use [API Tokens](https://app.buddy.works/api-tokens).

That functionality is provided for testing purposes and will only work for individual tokens generated per user.

All requests will be called on behalf of the user who provided token.

API's
-----

[](#apis)

For detailed info what send for which method, error codes, rates &amp; limits - check [Buddy documentation](https://buddy.works/api/reference/getting-started/overview)

To start using api you should pass to Buddy constructor acquired access token.

```
$buddy = new Buddy\Buddy([
  'accessToken' => 'your access token'
]);
```

### Workspaces

[](#workspaces)

Get workspaces

```
try {
    $resp = $buddy->getApiWorkspaces()->getWorkspaces([$accessToken]);
    var_dump($resp);
    exit;
} catch (Buddy\Exceptions\BuddyResponseException $e) {
    echo $e->getMessage();
    exit;
} catch (Buddy\Exceptions\BuddySDKException $e) {
    echo $e->getMessage();
    exit;
}
```

Get workspace

```
    $buddy->getApiWorkspaces()->getWorkspace($domain, [$accessToken]);
```

### Webhooks

[](#webhooks)

Get webhooks

```
    $buddy->getApiWebhooks()->getWebhooks($domain, [$accessToken]);
```

Add webhook

```
    $buddy->getApiWebhooks()->addWebhook($data, $domain, [$accessToken]);
```

Get webhook

```
    $buddy->getApiWebhooks()->getWebhook($domain, $webhookId, [$accessToken]);
```

Edit webhook

```
    $buddy->getApiWebhooks()->editWebhook($data, $domain, $webhookId, [$accessToken]);
```

Delete webhook

```
    $buddy->getApiWebhooks()->deleteWebhook($domain, $webhookId, [$accessToken]);
```

### Tags

[](#tags)

Get tags

```
    $buddy->getApiTags()->getTags($domain, $projectName, [$accessToken]);
```

Get tag

```
    $buddy->getApiTags()->getTag($domain, $projectName, $name, [$accessToken]);
```

### Ssh Keys

[](#ssh-keys)

Get keys

```
    $buddy->getApiSshKeys()->getKeys([$accessToken]);
```

Add key

```
    $buddy->getApiSshKeys()->addKey($data, [$accessToken]);
```

Delete key

```
    $buddy->getApiSshKeys()->deleteKey($keyId, [$accessToken]);
```

Get key

```
    $buddy->getApiSshKeys()->getKey($keyId, [$accessToken]);
```

### Source

[](#source)

Get contents

```
    $buddy->getApiSource()->getContents($domain, $projectName, [$path], [$filters], [$accessToken]);
```

Add file

```
    $buddy->getApiSource()->addFile($data, $domain, $projectName, [$accessToken]);
```

Edit file

```
    $buddy->getApiSource()->editFile($data, $domain, $projectName, $path, [$accessToken]);
```

Delete file

```
    $buddy->getApiSource()->deleteFile($data, $domain, $projectName, $path, [$accessToken]);
```

### Projects

[](#projects)

Get projects

```
    $buddy->getApiProjects()->getProjects($domain, [$filters], [$accessToken]);
```

Add project

```
    $buddy->getApiProjects()->addProject($data, $domain, [$accessToken]);
```

Get projects

```
    $buddy->getApiProjects()->getProject($domain, $projectName, [$accessToken]);
```

Edit project

```
    $buddy->getApiProjects()->editProject($data, $domain, $projectName, [$accessToken]);
```

Delete project

```
    $buddy->getApiProjects()->deleteProject($domain, $projectName, [$accessToken]);
```

Get project members

```
    $buddy->getApiProjects()->getProjectMembers($domain, $projectName, [$filters], [$accessToken]);
```

Add project member

```
    $buddy->getApiProjects()->addProjectMember($domain, $projectName, $userId, $permissionId, [$accessToken]);
```

Get project member

```
    $buddy->getApiProjects()->getProjectMember($domain, $projectName, $userId, [$accessToken]);
```

Edit project member

```
    $buddy->getApiProjects()->editProjectMember($domain, $projectName, $userId, $permissionId, [$accessToken]);
```

Delete project member

```
    $buddy->getApiProjects()->deleteProjectMember($domain, $projectName, $userId, [$accessToken]);
```

### Profile

[](#profile)

Get user

```
    $buddy->getApiProfile()->getAuthenticatedUser([$accessToken]);
```

Edit user

```
    $buddy->getApiProfile()->editAuthenticatedUser($data, [$accessToken]);
```

### Pipelines

[](#pipelines)

Get pipelines

```
    $buddy->getApiPipelines()->getPipelines($domain, $projectName, [$filters], [$accessToken]);
```

Add pipeline

```
    $buddy->getApiPipelines()->addPipeline($data, $domain, $projectName, [$accessToken]);
```

Get pipeline

```
    $buddy->getApiPipelines()->getPipeline($domain, $projectName, $pipelineId, [$accessToken]);
```

Edit pipeline

```
    $buddy->getApiPipelines()->editPipeline($data, $domain, $projectName, $pipelineId, [$accessToken]);
```

Delete pipeline

```
    $buddy->getApiPipelines()->deletePipeline($domain, $projectName, $pipelineId, [$accessToken]);
```

Get pipeline actions

```
    $buddy->getApiPipelines()->getPipelineActions($domain, $projectName, $pipelineId, [$accessToken]);
```

Add pipeline action

```
    $buddy->getApiPipelines()->addPipelineAction($data, $domain, $projectName, $pipelineId, [$accessToken]);
```

Get pipeline action

```
    $buddy->getApiPipelines()->getPipelineAction($domain, $projectName, $pipelineId, $actionId, [$accessToken]);
```

Edit pipeline action

```
    $buddy->getApiPipelines()->editPipelineAction($data, $domain, $projectName, $pipelineId, $actionId, [$accessToken]);
```

Delete pipeline action

```
    $buddy->getApiPipelines()->deletePipelineAction($domain, $projectName, $pipelineId, $actionId, [$accessToken]);
```

### Permissions

[](#permissions)

Get permissions

```
    $buddy->getApiPermissions()->getWorkspacePermissions($domain, [$accessToken]);
```

Add permission

```
    $buddy->getApiPermissions()->addWorkspacePermission($data, $domain, [$accessToken]);
```

Get permission

```
    $buddy->getApiPermissions()->getWorkspacePermission($domain, $permissionId, [$accessToken]);
```

Edit permission

```
    $buddy->getApiPermissions()->editWorkspacePermission($data, $domain, $permissionId, [$accessToken]);
```

Delete permission

```
    $buddy->getApiPermissions()->deleteWorkspacePermission($domain, $permissionId, [$accessToken]);
```

### Members

[](#members)

Get members

```
    $buddy->getApiMembers()->getWorkspaceMembers($domain, [$filters], [$accessToken]);
```

Add member

```
    $buddy->getApiMembers()->addWorkspaceMember($domain, $email, [$accessToken]);
```

Get member

```
    $buddy->getApiMembers()->getWorkspaceMember($domain, $userId, [$accessToken]);
```

Edit member

```
    $buddy->getApiMembers()->editWorkspaceMember($domain, $userId, $isAdmin, [$accessToken]);
```

Delete member

```
    $buddy->getApiMembers()->deleteWorkspaceMember($domain, $userId, [$accessToken]);
```

Get member projects

```
    $buddy->getApiMembers()->getWorkspaceMemberProjects($domain, $userId, [$filters], [$accessToken]);
```

### Integrations

[](#integrations)

Get integrations

```
    $buddy->getApiIntegrations()->getIntegrations([$accessToken]);
```

Get integration

```
    $buddy->getApiIntegrations()->getIntegration($integrationId, [$accessToken]);
```

### Groups

[](#groups)

Get groups

```
    $buddy->getApiGroups()->getGroups($domain, [$accessToken]);
```

Add group

```
    $buddy->getApiGroups()->addGroup($data, $domain, [$accessToken]);
```

Get group

```
    $buddy->getApiGroups()->getGroup($domain, $groupId, [$accessToken]);
```

Edit group

```
    $buddy->getApiGroups()->editGroup($data, $domain, $groupId, [$accessToken]);
```

Delete group

```
    $buddy->getApiGroups()->deleteGroup($domain, $groupId, [$accessToken]);
```

Get group members

```
    $buddy->getApiGroups()->getGroupMembers($domain, $groupId, [$accessToken]);
```

Add group member

```
    $buddy->getApiGroups()->addGroupMember($domain, $groupId, $userId, [$accessToken]);
```

Get group member

```
    $buddy->getApiGroups()->getGroupMember($domain, $groupId, $userId, [$accessToken]);
```

Delete group member

```
    $buddy->getApiGroups()->deleteGroupMember($domain, $groupId, $userId, [$accessToken]);
```

### Executions

[](#executions)

Get executions

```
    $buddy->getApiExecutions()->getExecutions($domain, $projectName, $pipelineId, [$filters], [$accessToken]);
```

Run execution

```
    $buddy->getApiExecutions()->runExecution($data, $domain, $projectName, $pipelineId, [$accessToken]);
```

Get execution

```
    $buddy->getApiExecutions()->getExecution($domain, $projectName, $pipelineId, $executionId, [$accessToken]);
```

Cancel execution

```
    $buddy->getApiExecutions()->cancelExecution($domain, $projectName, $pipelineId, $executionId, [$accessToken]);
```

Retry execution

```
    $buddy->getApiExecutions()->retryRelease($domain, $projectName, $pipelineId, $executionId, [$accessToken]);
```

### Emails

[](#emails)

Get emails

```
    $buddy->getApiEmails()->getAuthenticatedUserEmails([$accessToken]);
```

Add email

```
    $buddy->getApiEmails()->addAuthenticatedUserEmail($email, [$accessToken]);
```

Delete email

```
    $buddy->getApiEmails()->deleteAuthenticatedUserEmail($email, [$accessToken]);
```

### Commits

[](#commits)

Get commits

```
    $buddy->getApiCommits()->getCommits($domain, $projectName, [$filters], [$accessToken]);
```

Get commit

```
    $buddy->getApiCommits()->getCommit($domain, $projectName, $revision, [$accessToken]);
```

Compare commits

```
    $buddy->getApiCommits()->getCompare($domain, $projectName, $base, $head, [$filters], [$accessToken]);
```

### Branches

[](#branches)

Get branches

```
    $buddy->getApiBranches()->getBranches($domain, $projectName, [$accessToken]);
```

Get branch

```
    $buddy->getApiBranches()->getBranch($domain, $projectName, $name, [$accessToken]);
```

Add branch

```
    $buddy->getApiBranches()->addBranch($data, $domain, $projectName, [$accessToken]);
```

Delete branch

```
    $buddy->getApiBranches()->deleteBranch($domain, $projectName, $name, [$force], [$accessToken]);
```

License
-------

[](#license)

Please see the [license file](https://github.com/buddy-works/buddy-works-php-api/blob/master/LICENSE) for more information.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 73.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~418 days

Recently: every ~353 days

Total

6

Last Release

1773d ago

PHP version history (4 changes)1.0.0PHP &gt;=5.5.0

1.2.0PHP ^7.2

1.3.0PHP ^7.3

1.4.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5d00e1e73a4ff379162b943421469055929a95e7a6ce4c3808976dcc1fa28f4f?d=identicon)[akondas](/maintainers/akondas)

![](https://www.gravatar.com/avatar/d5635af068c670551cf316b13cf3c4946eeb4b8b501234a9ffe9857f021e1ad2?d=identicon)[bylek](/maintainers/bylek)

![](https://www.gravatar.com/avatar/d73724c5891236396f653913ca7586ca6030bbfa2da70d0070cd07714a66093a?d=identicon)[mical](/maintainers/mical)

---

Top Contributors

[![mical](https://avatars.githubusercontent.com/u/2639478?v=4)](https://github.com/mical "mical (31 commits)")[![akondas](https://avatars.githubusercontent.com/u/8239917?v=4)](https://github.com/akondas "akondas (10 commits)")[![Kivlov84](https://avatars.githubusercontent.com/u/8556342?v=4)](https://github.com/Kivlov84 "Kivlov84 (1 commits)")

---

Tags

buddybuddy-pipelinecontinuous-deliverycontinuous-deploymentcontinuous-integrationphp-apiphp-sdkapisdkcontinuous integrationbuddycontinuous deliverybuddy works

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/buddy-works-buddy-works-php-api/health.svg)

```
[![Health](https://phpackages.com/badges/buddy-works-buddy-works-php-api/health.svg)](https://phpackages.com/packages/buddy-works-buddy-works-php-api)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k9.5M89](/packages/openai-php-laravel)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[resend/resend-php

Resend PHP library.

617.2M43](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.6M13](/packages/checkout-checkout-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
