{"id":13804502,"url":"https://github.com/packagist/private-packagist-api-client","last_synced_at":"2026-01-26T18:05:49.572Z","repository":{"id":44631701,"uuid":"123302282","full_name":"packagist/private-packagist-api-client","owner":"packagist","description":"Private Packagist API Client","archived":false,"fork":false,"pushed_at":"2025-11-26T13:21:50.000Z","size":346,"stargazers_count":35,"open_issues_count":2,"forks_count":9,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-11-27T16:24:49.723Z","etag":null,"topics":["api","api-client","composer","package-management","packagist","php"],"latest_commit_sha":null,"homepage":"https://packagist.com/docs/api","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/packagist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-02-28T15:15:29.000Z","updated_at":"2025-10-04T04:26:43.000Z","dependencies_parsed_at":"2025-11-17T07:05:05.607Z","dependency_job_id":null,"html_url":"https://github.com/packagist/private-packagist-api-client","commit_stats":{"total_commits":174,"total_committers":7,"mean_commits":"24.857142857142858","dds":"0.39655172413793105","last_synced_commit":"7b315a01cd75f67ac3bee798e6f4541c5c22b671"},"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/packagist/private-packagist-api-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packagist%2Fprivate-packagist-api-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packagist%2Fprivate-packagist-api-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packagist%2Fprivate-packagist-api-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packagist%2Fprivate-packagist-api-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/packagist","download_url":"https://codeload.github.com/packagist/private-packagist-api-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packagist%2Fprivate-packagist-api-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28784093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-client","composer","package-management","packagist","php"],"created_at":"2024-08-04T01:00:48.997Z","updated_at":"2026-01-26T18:05:49.557Z","avatar_url":"https://github.com/packagist.png","language":"PHP","funding_links":[],"categories":["Composer Repositories"],"sub_categories":["Private Packagist"],"readme":"# Private Packagist API Client\n\n## Table of Contents\n\u003c!--ts--\u003e\n* [Private Packagist API Client](#private-packagist-api-client)\n   * [Table of Contents](#table-of-contents)\n   * [Requirements](#requirements)\n   * [Install](#install)\n   * [Basic usage of private-packagist/api-client client](#basic-usage-of-private-packagistapi-client-client)\n   * [Documentation](#documentation)\n      * [Organization](#organization)\n         * [Trigger a full synchronization](#trigger-a-full-synchronization)\n      * [Team](#team)\n         * [List an organization's teams](#list-an-organizations-teams)\n         * [Create a New Team](#create-a-new-team)\n         * [Show a Team](#show-a-team)\n         * [Edit a Team](#edit-a-team)\n         * [Grant All Package Access](#grant-all-package-access)\n         * [Revoke All Package Access](#revoke-all-package-access)\n         * [Delete a Team](#delete-a-team)\n         * [Add Member to Team (by User ID)](#add-member-to-team-by-user-id)\n         * [Remove Member from Team](#remove-member-from-team)\n         * [List all private packages a team has access to](#list-all-private-packages-a-team-has-access-to)\n         * [Grant a team access to a list of private packages](#grant-a-team-access-to-a-list-of-private-packages)\n         * [Remove access for a package from a team](#remove-access-for-a-package-from-a-team)\n      * [Authentication Tokens](#authentication-tokens)\n         * [List an organization's team authentication tokens](#list-an-organizations-team-authentication-tokens)\n         * [Create a new team authentication token](#create-a-new-team-authentication-token)\n         * [Delete a team authentication token](#delete-a-team-authentication-token)\n         * [Regenerate a team authentication token](#regenerate-a-team-authentication-token)\n      * [Customer](#customer)\n         * [List an organization's customers](#list-an-organizations-customers)\n         * [Show a customer](#show-a-customer)\n         * [Create a customer](#create-a-customer)\n         * [Edit a customer](#edit-a-customer)\n         * [Delete a customer](#delete-a-customer)\n         * [Enable a customer](#enable-a-customer)\n         * [Disable a customer](#disable-a-customer)\n         * [List a customer's packages](#list-a-customers-packages)\n         * [Show a customer's package](#show-a-customers-package)\n         * [Grant a customer access to a package or edit the limitations](#grant-a-customer-access-to-a-package-or-edit-the-limitations)\n         * [Revoke access to a package from a customer](#revoke-access-to-a-package-from-a-customer)\n         * [Regenerate a customer's Composer repository token](#regenerate-a-customers-composer-repository-token)\n         * [List a customer's vendor bundles](#list-a-customers-vendor-bundles)\n         * [Grant a customer access to a vendor bundle or edit the limitations](#grant-a-customer-access-to-a-vendor-bundle-or-edit-the-limitations)\n         * [Revoke access to a vendor bundle from a customer](#revoke-access-to-a-vendor-bundle-from-a-customer)\n      * [Vendor Bundle](#vendor-bundle)\n         * [List an organization's vendor bundles](#list-an-organizations-vendor-bundles)\n         * [Show a vendor bundle](#show-a-vendor-bundle)\n         * [Create a vendor bundle](#create-a-vendor-bundle)\n         * [Edit a customer](#edit-a-customer-1)\n         * [Delete a vendor bundle](#delete-a-vendor-bundle)\n         * [List packages in a vendor bundle](#list-packages-in-a-vendor-bundle)\n         * [Add one or more packages to a vendor bundle or edit their limitations](#add-one-or-more-packages-to-a-vendor-bundle-or-edit-their-limitations)\n         * [Remove a package from a vendor bundle](#remove-a-package-from-a-vendor-bundle)\n      * [Suborganization](#suborganization)\n         * [List an organization's suborganizations](#list-an-organizations-suborganizations)\n         * [Show a suborganization](#show-a-suborganization)\n         * [Create a suborganization](#create-a-suborganization)\n         * [Delete a suborganization](#delete-a-suborganization)\n         * [List a suborganization's teams](#list-a-suborganizations-teams)\n         * [Add a team to a suborganization or edit the permission](#add-a-team-to-a-suborganization-or-edit-the-permission)\n         * [Remove a team from a suborganization](#remove-a-team-from-a-suborganization)\n         * [List a suborganization's packages](#list-a-suborganizations-packages)\n         * [Show a suborganization package](#show-a-suborganization-package)\n         * [Create a vcs package in a suborganization](#create-a-vcs-package-in-a-suborganization)\n         * [Create a vcs package with credentials in a suborganization](#create-a-vcs-package-with-credentials-in-a-suborganization)\n         * [Create a custom package in a suborganization](#create-a-custom-package-in-a-suborganization)\n         * [Create a custom package with credentials in a suborganization](#create-a-custom-package-with-credentials-in-a-suborganization)\n         * [Edit a vcs package in a suborganization in a suborganization](#edit-a-vcs-package-in-a-suborganization-in-a-suborganization)\n         * [Edit a custom package in a suborganization](#edit-a-custom-package-in-a-suborganization)\n         * [Delete a package from a suborganization](#delete-a-package-from-a-suborganization)\n         * [List all dependents of a suborganization package](#list-all-dependents-of-a-suborganization-package)\n         * [List a suborganization's authentication tokens](#list-a-suborganizations-authentication-tokens)\n         * [Create a suborganization authentication token](#create-a-suborganization-authentication-token)\n         * [Delete a suborganization authentication token](#delete-a-suborganization-authentication-token)\n         * [Regenerate a suborganization authentication token](#regenerate-a-suborganization-authentication-token)\n         * [List a suborganization's mirrored repositories](#list-a-suborganizations-mirrored-repositories)\n         * [Show a mirrored repository](#show-a-mirrored-repository)\n         * [Add mirrored repositories to a suborganization](#add-mirrored-repositories-to-a-suborganization)\n         * [Edit the mirroring behaviour of mirrored repository in a suborganization](#edit-the-mirroring-behaviour-of-mirrored-repository-in-a-suborganization)\n         * [Delete a mirrored repository from a suborganization](#delete-a-mirrored-repository-from-a-suborganization)\n         * [List all mirrored packages from a mirrored repository in a suborganization](#list-all-mirrored-packages-from-a-mirrored-repository-in-a-suborganization)\n         * [Add mirrored packages from one mirrored repository to a suborganization](#add-mirrored-packages-from-one-mirrored-repository-to-a-suborganization)\n         * [Remove all mirrored packages from one mirrored repository in a suborganization](#remove-all-mirrored-packages-from-one-mirrored-repository-in-a-suborganization)\n      * [Package](#package)\n         * [List an organization's packages](#list-an-organizations-packages)\n         * [Show a package](#show-a-package)\n         * [Create a vcs package](#create-a-vcs-package)\n         * [Create a vcs package with credentials](#create-a-vcs-package-with-credentials)\n         * [Create a vcs package with a specific type](#create-a-vcs-package-with-a-specific-type)\n         * [Create a custom package](#create-a-custom-package)\n         * [Create a custom package with credentials](#create-a-custom-package-with-credentials)\n         * [Edit a vcs package](#edit-a-vcs-package)\n         * [Edit a custom package](#edit-a-custom-package)\n         * [Delete a package](#delete-a-package)\n         * [List all dependents of a package](#list-all-dependents-of-a-package)\n         * [List all customers with access to a package](#list-all-customers-with-access-to-a-package)\n         * [List all security issues of a package](#list-all-security-issues-of-a-package)\n         * [Show the security monitoring config of a package](#show-the-security-monitoring-config-of-a-package)\n         * [Edit the security monitoring config of a package](#edit-the-security-monitoring-config-of-a-package)\n         * [Create an artifact package file](#create-an-artifact-package-file)\n         * [Create an artifact package](#create-an-artifact-package)\n         * [Add an artifact file to an existing package](#add-an-artifact-file-to-an-existing-package)\n         * [Update or replace artifact files of a package](#update-or-replace-artifact-files-of-a-package)\n      * [Credential](#credential)\n         * [List an organization's credentials](#list-an-organizations-credentials)\n         * [Show a credential](#show-a-credential)\n         * [Create a credential](#create-a-credential)\n         * [Edit a credential](#edit-a-credential)\n         * [Delete a credential](#delete-a-credential)\n      * [Mirrored Repository](#mirrored-repository)\n         * [List an organization's mirrored repositories](#list-an-organizations-mirrored-repositories)\n         * [Show a mirrored repository](#show-a-mirrored-repository-1)\n         * [Create a mirrored repository](#create-a-mirrored-repository)\n         * [Edit a mirrored repository](#edit-a-mirrored-repository)\n         * [Delete a mirrored repository](#delete-a-mirrored-repository)\n         * [List all mirrored packages from one repository](#list-all-mirrored-packages-from-one-repository)\n         * [Add mirrored packages from one repository](#add-mirrored-packages-from-one-repository)\n         * [Remove all mirrored packages from one repository](#remove-all-mirrored-packages-from-one-repository)\n      * [Job](#job)\n         * [Show a job](#show-a-job)\n         * [Wait for a job to finish](#wait-for-a-job-to-finish)\n      * [Security Issue](#security-issue)\n         * [List an organization's security issues](#list-an-organizations-security-issues)\n      * [Magento legacy keys](#magento-legacy-keys)\n         * [List all legacy keys for a customer](#list-all-legacy-keys-for-a-customer)\n         * [Create a new legacy keys for a customer](#create-a-new-legacy-keys-for-a-customer)\n         * [Delete a legacy keys from a customer](#delete-a-legacy-keys-from-a-customer)\n      * [Validate incoming webhook payloads](#validate-incoming-webhook-payloads)\n   * [License](#license)\n\n\u003c!-- Created by https://github.com/ekalinin/github-markdown-toc --\u003e\n\u003c!-- Added by: glaubinix, at: Fri 22 Nov 2024 16:10:24 GMT --\u003e\n\n\u003c!--te--\u003e\n\n## Requirements\n\n* PHP \u003e= 7.2\n* [Guzzle](https://github.com/guzzle/guzzle) library,\n\n## Install\n\nVia Composer:\n\n```bash\n$ composer require private-packagist/api-client guzzlehttp/guzzle\n```\n\nWhy do you need to require `guzzlehttp/guzzle`? We are decoupled from any HTTP messaging client with help by [HTTPlug](http://httplug.io/), so you can pick an HTTP client of your choice, guzzle is merely a recommendation.\n\n## Basic usage of `private-packagist/api-client` client\n\n```php\n\u003c?php\n\n// This file is generated by Composer\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$client = new \\PrivatePackagist\\ApiClient\\Client();\n$client-\u003eauthenticate('api-key', 'api-secret');\n$packages = $client-\u003epackages()-\u003eall();\n```\n\nFrom `$client` object, you can access the full Private Packagist API.\n\n## Documentation\n\nFull documentation can be found in the [Private Packagist documentation](https://packagist.com/docs/api).\n\n### Trusted publishing\n\nTo upload artifact files, trusted publishing can be used in certain environment like GitHub Actions without the need to\nconfigure authentication via API key and secret.\n\n```php\n$fileName = 'package1.zip';\n$file = file_get_contents($fileName);\n$client = new \\PrivatePackagist\\ApiClient\\Client();\n$client-\u003eauthenticateWithTrustedPublishing('acme-org', 'acme/package');\n$client-\u003epackages()-\u003eartifacts()-\u003eadd('acme/package', $file, 'application/zip', $fileName);\n```\n\nWe recommend using the [GitHub action](https://github.com/packagist/artifact-publish-github-action) directly.\n\n### Organization\n\n#### Trigger a full synchronization\n```php\n$jobs = $client-\u003eorganization()-\u003esync();\n```\nReturns an array of created jobs. One for every synchronization.\n\n### Team\n\nThe permissions available for a team are:\n- `canEditTeamPackages`: members of the team can edit and remove packages, assign package permissions (only applies to packages assigned to team).\n- `canAddPackages`: members of the team can add packages to organization; add, edit and remove credentials and mirrored third-party repositories.\n- `canCreateSuborganizations`: members of the team can create suborganizations.\n- `canViewVendorCustomers`: members of the team can view customers, their Composer information, their packages, and their install statistics.\n- `canManageVendorCustomers`: members of the team can create and delete customers, add and remove packages, update their settings, view Composer information and install statistics.\n\n```php\nuse PrivatePackagist\\ApiClient\\TeamPermissions;\n\n$permissions = new TeamPermissions;\n// Grant all permissions.\n$permissions-\u003ecanEditTeamPackages = true;\n$permissions-\u003ecanAddPackages = true;\n$permissions-\u003ecanCreateSuborganizations = true;\n$permissions-\u003ecanManageVendorCustomers = true;\n$permissions-\u003ecanManageVendorCustomers = true;\n```\n\nThe permissions model can also be constructed via flags:\n\n```php\nuse PrivatePackagist\\ApiClient\\TeamPermissions;\n\n$permissions = TeamPermissions::fromFlags(\n    TeamPermissions::PERMISSION_CAN_EDIT_TEAM_PACKAGES | TeamPermissions::PERMISSION_CAN_ADD_PACKAGES,\n);\n```\n\nOr from the permissions of an existing team:\n\n```php\nuse PrivatePackagist\\ApiClient\\TeamPermissions;\n\n$team = $client-\u003eteams()-\u003eall()[0];\n$permissions = TeamPermissions::fromTeamResponse($team);\n```\n\n#### List an organization's teams\n```php\n$teams = $client-\u003eteams()-\u003eall();\n```\nReturns an array of teams.\n\n#### Create a New Team\n```php\nuse PrivatePackagist\\ApiClient\\TeamPermissions;\n\n$permissions = new TeamPermissions;\n$team = $client-\u003eteams()-\u003ecreate('New Team Name', $permissions);\n```\nCreates a team and sets permissions applied to team members. Returns the newly-created team.\n\n#### Show a Team\n```php\n\n$team = $client-\u003eteams()-\u003eshow($teamId);\n```\nReturns the team including all its members.\n\n\n#### Edit a Team\n```php\nuse PrivatePackagist\\ApiClient\\TeamPermissions;\n\n$permissions = new TeamPermissions;\n$team = $client-\u003eteams()-\u003eedit($teamId, 'Altered Team Name', $permissions);\n```\nEdits a team's name and permissions to be applied to team members. Returns the updated team.\n\n#### Grant All Package Access\n```php\n$team = $client-\u003eteams()-\u003egrantAccessToAllPackages($teamId);\n```\n\nGranting a team access to all packages will give this team access to all current and future organization packages which do not have their permissions synchronized.\n\n#### Revoke All Package Access\n```php\n$team = $client-\u003eteams()-\u003erevokeAccessToAllPackages($teamId);\n```\n\nRevoking a team's access to all packages will not remove access to packages the team can currently access, but will prevent access to new packages and allow revoking individual package access.\n\n#### Delete a Team\n```php\n$client-\u003eteams()-\u003eremove($teamId);\n```\n\n#### Add Member to Team (by User ID)\n```php\n$team = $client-\u003eteams()-\u003eaddMember($teamId, $userId);\n```\nReturns the team the user was added to.\n\n#### Remove Member from Team\n```php\n$client-\u003eteams()-\u003eremoveMember($teamId, $userId);\n```\n\n#### List all private packages a team has access to\n```php\n$teamId = 1;\n$packages = $client-\u003eteams()-\u003epackages($teamId);\n```\nReturns an array of packages.\n\n#### Grant a team access to a list of private packages\n\nYou pass an array of packages to give access to. The values of the array can be either package ID or package name.\n\n```php\n$teamId = 1;\n$packages = $client-\u003eteams()-\u003eaddPackages($teamId, ['acme-website/package', 1]);\n```\nReturns an array of packages.\n\n#### Remove access for a package from a team\n\nYou can use the package ID or package name as a reference. \n\n```php\n$teamId = 1;\n$packages = $client-\u003eteams()-\u003eremovePackage($teamId, 'acme-website/package');\n```\n\n### Authentication Tokens\n\n#### List an organization's team authentication tokens\n```php\n$tokens = $client-\u003etokens()-\u003eall();\n```\nReturns an array of team tokens.\n\n#### Create a new team authentication token\n```php\n// Create a new token with access to all packages\n$token = $client-\u003etokens()-\u003ecreate([\n    'description' =\u003e 'New Team Token',\n    'access' =\u003e 'read',\n    'accessToAllPackages' =\u003e true,\n]);\n\n// Create a new token with access to packages a team has access to\n$token = $client-\u003etokens()-\u003ecreate([\n    'description' =\u003e 'New Team Token',\n    'access' =\u003e 'read',\n    'teamId' =\u003e 1, // Get teamId from the list of teams to determine to which packages the token has access to\n]);\n```\nReturns the created token.\n\n#### Delete a team authentication token\n```php\n$client-\u003etokens()-\u003eremove($tokenId));\n```\n\n#### Regenerate a team authentication token\n```php\n$customerId = 42;\n$confirmation = [\n    'IConfirmOldTokenWillStopWorkingImmediately' =\u003e true,\n];\n$token = $client-\u003etokens()-\u003eregenerateToken($tokenId, $confirmation);\n```\nReturns the regenerated token.\n\n### Customer\n\n#### List an organization's customers\n```php\n$customers = $client-\u003ecustomers()-\u003eall();\n```\nReturns an array of customers.\n\n#### Show a customer\n```php\n$customerId = 42;\n$customer = $client-\u003ecustomers()-\u003eshow($customerId);\n// or\n$customerUrlName = 'customer-url-name';\n$customer = $client-\u003ecustomers()-\u003eshow($customerUrlName);\n```\nReturns a single customer.\n\n#### Create a customer\n```php\n$customer = $client-\u003ecustomers()-\u003ecreate('New customer name');\n// or\n$customer = $client-\u003ecustomers()-\u003ecreate('New customer name', false, 'customer-url-name', 'beta', true);\n```\nReturns the customer.\n\n#### Edit a customer\n```php\n$customerId = 42;\n$customerData = [\n    'name' =\u003e $name,\n    'urlName' =\u003e 'customer',\n    'accessToVersionControlSource' =\u003e false,\n    'minimumAccessibleStability' =\u003e 'beta',\n    'assignAllPackages' =\u003e true,\n];\n$customer = $client-\u003ecustomers()-\u003eedit($customerId, $customerData);\n```\nReturns the customer.\n\n#### Delete a customer\n```php\n$customerId = 42;\n$client-\u003ecustomers()-\u003eremove($customerId);\n```\n\n#### Enable a customer\n```php\n$customerId = 42;\n$customer = $client-\u003ecustomers()-\u003eenable($customerId);\n```\n\n#### Disable a customer\n```php\n$customerId = 42;\n$customer = $client-\u003ecustomers()-\u003edisable($customerId);\n```\n\n#### List a customer's packages\n```php\n$customerId = 42;\n$packages = $client-\u003ecustomers()-\u003elistPackages($customerId);\n```\nReturns an array of customer packages.\n\n#### Show a customer's package\n```php\n$customerId = 42;\n$package = $client-\u003ecustomers()-\u003eshowPackage($customerId, $packageName);\n$accessibleVersions = $package['versions'];\n```\nReturns a customer's package, including the versions that the customer has been granted access to.\n\n#### Grant a customer access to a package or edit the limitations\n```php\n$customerId = 42;\n$packages = [\n    [\n        'name' =\u003e 'acme-website/package',\n        'versionConstraint' =\u003e '^1.0 | ^2.0', // optional version constraint to limit updates the customer receives\n        'expirationDate' =\u003e (new \\DateTime())-\u003eadd(new \\DateInterval('P1Y'))-\u003eformat('c'), // optional expiration date to limit updates the customer receives\n        'minimumAccessibleStability' =\u003e 'beta', // optional stability to restrict customers to specific package version stabilities like alpha, beta, or RC\n    ],\n];\n$packages = $client-\u003ecustomers()-\u003eaddOrEditPackages($customerId, $packages);\n```\nReturns an array of all added or edited customer packages.\n\n#### Revoke access to a package from a customer\n\nYou can reference the package by its ID or name.\n\n```php\n$customerId = 42;\n$packageName = 'acme-website/package';\n$client-\u003ecustomers()-\u003eremovePackage($customerId, $packageName);\n```\n\n#### Regenerate a customer's Composer repository token\n```php\n$customerId = 42;\n$confirmation = [\n    'IConfirmOldTokenWillStopWorkingImmediately' =\u003e true,\n];\n$composerRepository = $client-\u003ecustomers()-\u003eregenerateToken($customerId, $confirmation);\n```\nReturns the edited Composer repository.\n\n#### List a customer's vendor bundles\n```php\n$customerId = 42;\n$packages = $client-\u003ecustomers()-\u003evendorBundles()-\u003elistVendorBundles($customerId);\n```\nReturns an array of customer vendor bundles.\n\n#### Grant a customer access to a vendor bundle or edit the limitations\n```php\n$customerId = 42;\n$vendorBundleId = 12;\n$expirationDate = (new \\DateTime())-\u003eadd(new \\DateInterval('P1Y'))-\u003eformat('c'), // optional expiration date to limit updates the customer receives\n$packages = $client-\u003ecustomers()-\u003evendorBundles()-\u003eaddOrEditVendorBundle($customerId, $vendorBundleId, $expirationDate);\n```\nReturns the added or edited customer vendor bundle.\n\n#### Revoke access to a vendor bundle from a customer\n```php\n$customerId = 42;\n$vendorBundleId = 12;\n$client-\u003ecustomers()-\u003evendorBundles()-\u003eremoveVendorBundle($customerId, $vendorBundleId);\n```\n\n### Vendor Bundle\n\n#### List an organization's vendor bundles\n```php\n$vendorBundles = $client-\u003evendorBundles()-\u003eall();\n```\nReturns an array of vendor bundles.\n\n#### Show a vendor bundle\n```php\n$vendorBundleId = 42;\n$vendorBundle = $client-\u003evendorBundles()-\u003eshow($vendorBundleId);\n```\nReturns a single vendor bundle.\n\n#### Create a vendor bundle\n```php\n$vendorBundle = $client-\u003evendorBundles()-\u003ecreate('New bundle name');\n// or\n$vendorBundle = $client-\u003evendorBundles()-\u003ecreate('New bundle name', 'dev', '^1.0', true, [123]);\n```\nReturns the vendor bundle.\n\n#### Edit a customer\n```php\n$vendorBundleId = 42;\n$vendorBundleData = [\n    'name' =\u003e 'Bundle name',\n    'minimumAccessibleStability' =\u003e 'dev',\n    'versionConstraint' =\u003e '^1.0',\n    'assignAllPackages' =\u003e true,\n    'synchronizationIds' =\u003e [123], // A list of synchronization ids for which new packages should automatically be added to the bundle.\n];\n$vendorBundle = $client-\u003evendorBundles()-\u003eedit($vendorBundleId, $vendorBundleData);\n```\nReturns the vendor bundle.\n\n#### Delete a vendor bundle\n```php\n$vendorBundleId = 42;\n$client-\u003evendorBundles()-\u003eremove($vendorBundleId);\n```\n\n#### List packages in a vendor bundle\n```php\n$vendorBundleId = 42;\n$packages = $client-\u003evendorBundles()-\u003epackages()-\u003elistPackages($vendorBundleId);\n```\nReturns an array of vendor bundle packages.\n\n#### Add one or more packages to a vendor bundle or edit their limitations\n```php\n$vendorBundleId = 42;\n$packages = [\n    [\n        'name' =\u003e 'acme-website/package',\n        'versionConstraint' =\u003e '^1.0 | ^2.0', // optional version constraint to limit updates the customer receives\n        'minimumAccessibleStability' =\u003e 'beta', // optional stability to restrict customers to specific package version stabilities like alpha, beta, or RC\n    ],\n];\n$packages = $client-\u003evendorBundles()-\u003epackages()-\u003eaddOrEditPackages($vendorBundleId, $packages);\n```\nReturns an array of all added or edited customer packages.\n\n#### Remove a package from a vendor bundle\n\nYou can reference the package by its ID or name.\n\n```php\n$vendorBundleId = 42;\n$packageName = 'acme-website/package';\n$client-\u003evendorBundles()-\u003epackages()-\u003eremovePackage($vendorBundleId, $packageName);\n```\n\n### Suborganization\n\n#### List an organization's suborganizations\n```php\n$suborganizations = $client-\u003esuborganizations()-\u003eall();\n```\nReturns an array of suborganizations.\n\n#### Show a suborganization\n```php\n$suborganizationName = 'suborganization';\n$suborganization = $client-\u003esuborganizations()-\u003eshow($suborganizationName);\n```\nReturns a single suborganization.\n\n#### Create a suborganization\n```php\n$suborganization = $client-\u003esuborganizations()-\u003ecreate('New suborganization name');\n```\nReturns the suborganization.\n\n#### Delete a suborganization\n```php\n$suborganizationName = 'suborganization';\n$client-\u003esuborganizations()-\u003eremove($suborganizationName);\n```\n\n#### List a suborganization's teams\n```php\n$suborganizationName = 'suborganization';\n$teams = $client-\u003esuborganizations()-\u003elistTeams($suborganizationName);\n```\nReturns an array of suborganizations teams.\n\n#### Add a team to a suborganization or edit the permission\n```php\n$suborganizationName = 'suborganization';\n$teams = [\n    [\n        'id' =\u003e 12,\n        'permission' =\u003e 'owner',\n    ],\n];\n$teams = $client-\u003esuborganizations()-\u003eaddOrEditTeams($suborganizationName, $teams);\n```\nReturns an array of added suborganization teams.\n\n\n#### Remove a team from a suborganization\n```php\n$suborganizationName = 'suborganization';\n$teamId = 12;\n$client-\u003esuborganizations()-\u003eremoveTeam($suborganizationName, $teamId);\n```\n\n#### List a suborganization's packages\n```php\n$suborganizationName = 'suborganization';\n$packages = $client-\u003esuborganizations()-\u003epackages()-\u003eall($suborganizationName);\n```\nReturns an array of suborganizations packages.\n\n#### Show a suborganization package\n\nYou can reference a package by its name or ID.\n\n```php\n$suborganizationName = 'suborganization';\n// Either use package name:\n$package = $client-\u003esuborganizations()-\u003epackages()-\u003eshow($suborganizationName, 'acme-website/package');\n// Or the package ID: \n$package = $client-\u003esuborganizations()-\u003epackages()-\u003eshow($suborganizationName, 123);\n```\nReturns the package.\n\n#### Create a vcs package in a suborganization\n```php\n$suborganizationName = 'suborganization';\n$job = $client-\u003esuborganizations()-\u003epackages()-\u003ecreateVcsPackage($suborganizationName, 'https://github.com/acme-website/package');\n```\nReturns a new job.\n\n#### Create a vcs package with credentials in a suborganization\n```php\n$suborganizationName = 'suborganization';\n$credentialId = 42;\n$job = $client-\u003esuborganizations()-\u003epackages()-\u003ecreateVcsPackage($suborganizationName,'https://github.com/acme-website/package', $credentialId);\n```\nReturns a new job.\n\n#### Create a custom package in a suborganization\n\n```php\n$suborganizationName = 'suborganization';\n$packageDefinition = '{...}';\n$job = $client-\u003esuborganizations()-\u003epackages()-\u003ecreateCustomPackage($suborganizationName, $packageDefinition);\n```\nReturns a new job.\n\n#### Create a custom package with credentials in a suborganization\n```php\n$suborganizationName = 'suborganization';\n$packageDefinition = '{...}';\n$credentialId = 42;\n$job = $client-\u003esuborganizations()-\u003epackages()-\u003ecreateCustomPackage($suborganizationName, $packageDefinition, $credentialId);\n```\nReturns a new job.\n\n#### Edit a vcs package in a suborganization in a suborganization\n```php\n$suborganizationName = 'suborganization';\n$job = $client-\u003esuborganizations()-\u003epackages()-\u003eeditVcsPackage($suborganizationName, 'acme-website/package', 'https://github.com/acme-website/package');\n```\nReturns a new job.\n\n#### Edit a custom package in a suborganization\n```php\n$suborganizationName = 'suborganization';\n$packageDefinition = '{...}';\n$job = $client-\u003esuborganizations()-\u003epackages()-\u003eeditCustomPackage($suborganizationName, 'acme-website/package', $packageDefinition);\n```\nReturns a new job.\n\n#### Delete a package from a suborganization\n```php\n$suborganizationName = 'suborganization';\n$client-\u003esuborganizations()-\u003epackages()-\u003eremove($suborganizationName, 'acme-website/package');\n```\n\n#### List all dependents of a suborganization package\n```php\n$suborganizationName = 'suborganization';\n$client-\u003esuborganizations()-\u003epackages()-\u003elistDependents($suborganizationName, 'acme-website/package');\n```\nReturns a list of packages.\n\n#### List a suborganization's authentication tokens\n```php\n$suborganizationName = 'suborganization';\n$tokens = $client-\u003esuborganizations()-\u003elistTokens($suborganizationName);\n```\nReturns an array of authentication tokens.\n\n#### Create a suborganization authentication token\n```php\n$suborganizationName = 'suborganization';\n$data = [\n  'description' =\u003e 'Suborganization Token',\n  'access' =\u003e 'read',\n];\n$token = $client-\u003esuborganizations()-\u003ecreateToken($suborganizationName, $data);\n```\nReturns the authentication token.\n\n#### Delete a suborganization authentication token\n```php\n$suborganizationName = 'suborganization';\n$tokenId = 33;\n$client-\u003esuborganizations()-\u003eremoveToken($suborganizationName, $tokenId);\n```\n\n#### Regenerate a suborganization authentication token\n```php\n$suborganizationName = 'suborganization';\n$tokenId = 33;\n$confirmation = [\n    'IConfirmOldTokenWillStopWorkingImmediately' =\u003e true,\n];\n$token = $client-\u003esuborganizations()-\u003eregenerateToken($suborganizationName, $confirmation);\n```\nReturns the authentication token.\n\n#### List a suborganization's mirrored repositories\n```php\n$suborganizationName = 'suborganization';\n$mirroredRepositories = $client-\u003esuborganizations()-\u003emirroredRepositories()-\u003eall($suborganizationName);\n```\nReturns an array of mirrored repositories.\n\n#### Show a mirrored repository\n```php\n$suborganizationName = 'suborganization';\n$mirroredRepositoryId = 42;\n$mirroredRepository = $client-\u003esuborganizations()-\u003emirroredRepositories()-\u003eshow($suborganizationName, $mirroredRepositoryId);\n```\nReturns the mirrored repository.\n\n#### Add mirrored repositories to a suborganization\n```php\n$suborganizationName = 'suborganization';\n$mirroredRepositoriesToAdd = [\n    ['id' =\u003e 12, 'mirroringBehavior' =\u003e 'add_on_use'],\n];\n$mirroredRepository = $client-\u003esuborganizations()-\u003emirroredRepositories()-\u003eadd($suborganizationName, $mirroredRepositoriesToAdd);\n```\nReturns a list of added mirrored repositories.\n\n#### Edit the mirroring behaviour of mirrored repository in a suborganization\n```php\n$suborganizationName = 'suborganization';\n$mirroredRepositoryId = 42;\n$mirroredRepository = $client-\u003esuborganizations()-\u003emirroredRepositories()-\u003ecreate($suborganizationName, $mirroredRepositoryId, 'add_on_use');\n```\nReturns the edited mirrored repository.\n\n#### Delete a mirrored repository from a suborganization\n```php\n$suborganizationName = 'suborganization';\n$mirroredRepositoryId = 42;\n$client-\u003esuborganizations()-\u003emirroredRepositories()-\u003eremove($suborganizationName, $mirroredRepositoryId);\n```\n\n#### List all mirrored packages from a mirrored repository in a suborganization\n```php\n$suborganizationName = 'suborganization';\n$mirroredRepositoryId = 42;\n$packages = $client-\u003esuborganizations()-\u003emirroredRepositories()-\u003elistPackages($suborganizationName, $mirroredRepositoryId);\n```\nReturns an array of packages.\n\n#### Add mirrored packages from one mirrored repository to a suborganization\n```php\n$suborganizationName = 'suborganization';\n$mirroredRepositoryId = 42;\n$packages = [\n    'acme/cool-lib\n];\n$jobs = $client-\u003esuborganizations()-\u003emirroredRepositories()-\u003eaddPackages($suborganizationName, $mirroredRepositoryId, $packages);\n```\nReturns an array of jobs.\n\n#### Remove all mirrored packages from one mirrored repository in a suborganization\n```php\n$suborganizationName = 'suborganization';\n$mirroredRepositoryId = 42;\n$client-\u003esuborganizations()-\u003emirroredRepositories()-\u003eremovePackages($suborganizationName, $mirroredRepositoryId);\n```\n\n### Package\n\nYou can reference a package by its name or ID. \n\n#### List an organization's packages\n```php\n$filters = [\n    'origin' =\u003e \\PrivatePackagist\\ApiClient\\Api\\Packages::ORIGIN_PRIVATE, // optional filter to only receive packages that can be added to customers,\n    'security-issue-state' =\u003e \\PrivatePackagist\\ApiClient\\Api\\SecurityIssues::STATE_OPEN, // optional filter to filter packages with open security issues,\n];\n$packages = $client-\u003epackages()-\u003eall($filters);\n```\nReturns an array of packages.\n\n#### Show a package\n```php\n// Either use package name:\n$package = $client-\u003epackages()-\u003eshow('acme-website/package');\n// Or the package ID: \n$package = $client-\u003epackages()-\u003eshow(123);\n```\nReturns the package.\n\n#### Create a vcs package\n```php\n$job = $client-\u003epackages()-\u003ecreateVcsPackage('https://github.com/acme-website/package');\n```\nReturns a new job.\n\n#### Create a vcs package with credentials\n```php\n$credentialId = 42;\n$job = $client-\u003epackages()-\u003ecreateVcsPackage('https://github.com/acme-website/package', $credentialId);\n```\nReturns a new job.\n\n#### Create a vcs package with a specific type\n```php\n$job = $client-\u003epackages()-\u003ecreateVcsPackage('https://github.com/acme-website/package', null, 'git');\n```\nReturns a new job.\n\n#### Create a custom package\n```php\n$packageDefinition = '{...}';\n$job = $client-\u003epackages()-\u003ecreateCustomPackage($packageDefinition);\n```\nReturns a new job.\n\n#### Create a custom package with credentials\n```php\n$packageDefinition = '{...}';\n$credentialId = 42;\n$job = $client-\u003epackages()-\u003ecreateCustomPackage($packageDefinition, $credentialId);\n```\nReturns a new job.\n\n#### Edit a vcs package\n```php\n$job = $client-\u003epackages()-\u003eeditVcsPackage('acme-website/package', 'https://github.com/acme-website/package');\n```\nReturns a new job.\n\n#### Edit a custom package\n```php\n$packageDefinition = '{...}';\n$job = $client-\u003epackages()-\u003eeditCustomPackage('acme-website/package', $packageDefinition);\n```\nReturns a new job.\n\n#### Delete a package\n```php\n$client-\u003epackages()-\u003eremove('acme-website/package');\n```\n\n#### List all dependents of a package\n```php\n$client-\u003epackages()-\u003elistDependents('acme-website/package');\n```\nReturns a list of packages.\n\n#### List all customers with access to a package\n\nPass either package ID or package name as argument.\n\n```php\n$client-\u003epackages()-\u003elistCustomers('acme-website/package');\n```\nReturns a list of customers with access to the package.\n\n#### List all security issues of a package\n```php\n$filters = [\n    'security-issue-state' =\u003e \\PrivatePackagist\\ApiClient\\Api\\SecurityIssues::STATE_OPEN,\n];\n$client-\u003epackages()-\u003elistSecurityIssues('acme-website/package', $filters);\n```\nReturns a list of security issues.\n\n#### Show the security monitoring config of a package\n```php\n$client-\u003epackages()-\u003eshowSecurityMonitoringConfig('acme-website/package');\n```\nReturns the security monitoring config of the package.\n\n#### Edit the security monitoring config of a package\n```php\n$config = [\n    \"monitorAllBranches\" =\u003e false, // If set to true then monitoredBranches will be ignored and can be omitted \n    \"monitoredBranches\" =\u003e [\n        \"dev-main\"\n    ],\n];\n$client-\u003epackages()-\u003eeditSecurityMonitoringConfig('acme-website/package', $config);\n```\nReturns the edited security monitoring config of the package.\n\n#### Create an artifact package file\n\n```php\n$fileName = 'package1.zip'; // your package archive artifact containing a valid composer.json in root directory\n$file = file_get_contents($fileName);\n$client-\u003epackages()-\u003eartifacts()-\u003ecreate($file, 'application/zip', $fileName);\n```\n\n#### Create an artifact package\n\n```php\n$fileName = 'package1.zip';\n$file = file_get_contents($fileName);\n$response = $client-\u003epackages()-\u003eartifacts()-\u003ecreate($file, 'application/zip', $fileName);\n$artifactId = $response['id'];\n$client-\u003epackages()-\u003ecreateArtifactPackage([$artifactId]);\n```\n#### Add an artifact file to an existing package\n\n```php\n$packageName = 'acme/artifact';\n$fileName = 'package1.zip';\n$file = file_get_contents($fileName);\n$client-\u003epackages()-\u003eartifacts()-\u003eadd($packageName, $file, 'application/zip', $fileName);\n```\n#### Update or replace artifact files of a package\n\n```php\n// in case you want to replace the artifact file with a newly uploaded one\n// 1. get current artifact ids\n$result = $client-\u003epackages()-\u003eartifacts()-\u003eshowPackageArtifacts('acme-website/package');\n$artifactIds = array_column($result, 'id'); // [41, 42]\n\n// 2. upload the new artifact file\n$fileName = 'package1.zip';\n$file = file_get_contents($fileName);\n$response = $client-\u003epackages()-\u003eartifacts()-\u003ecreate($file, 'application/zip', $fileName);\n$newArtifactId = $response['id'];\n\n// 3. let's say we don't want to have the artifact file id = 41 and use the newly uploaded file instead\n$artifactIds = array_shift($artifactIds);\n$artifactIds[] = $newArtifactId;\n$client-\u003epackages()-\u003eeditArtifactPackage('acme-website/package', $artifactIds);\n```\n\n### Credential\n\n#### List an organization's credentials\n```php\n$credentials = $client-\u003ecredentials()-\u003eall();\n```\nReturns an array of credentials.\n\n#### Show a credential\n```php\n$credentialId = 42;\n$credential = $client-\u003ecredentials()-\u003eshow($credentialId);\n```\nReturns the credential.\n\n#### Create a credential\n```php\n$type = \\PrivatePackagist\\ApiClient\\Api\\Credentials::TYPE_HTTP_BASIC;\n$credential = $client-\u003ecredentials()-\u003ecreate('ACME http auth', $type, 'acme-website.com', 'username', 'password');\n```\nReturns the new credential.\n\n#### Edit a credential\n```php\n$credentialId = 42;\n$type = \\PrivatePackagist\\ApiClient\\Api\\Credentials::TYPE_HTTP_BASIC;\n$credential = $client-\u003ecredentials()-\u003eedit($credentialId, $type, 'username', 'password');\n```\nReturns the edited credential.\n\n#### Delete a credential\n```php\n$credentialId = 42;\n$client-\u003ecredentials()-\u003eremove($credentialId);\n```\n\n### Mirrored Repository\n\n#### List an organization's mirrored repositories\n```php\n$mirroredRepositories = $client-\u003emirroredRepositories()-\u003eall();\n```\nReturns an array of mirrored repositories.\n\n#### Show a mirrored repository\n```php\n$mirroredRepositoryId = 42;\n$mirroredRepository = $client-\u003emirroredRepositories()-\u003eshow($mirroredRepositoryId);\n```\nReturns the mirrored repository.\n\n#### Create a mirrored repository\n```php\n$mirroredRepository = $client-\u003emirroredRepositories()-\u003ecreate('Mirrored Repository', 'https://composer.example.com', 'add_on_use', 543);\n```\nReturns the new mirrored repository.\n\n#### Edit a mirrored repository\n```php\n$mirroredRepositoryId = 42;\n$mirroredRepository = $client-\u003emirroredRepositories()-\u003ecreate($mirroredRepositoryId, 'Mirrored Repository', 'https://composer.example.com', 'add_on_use', 543);\n```\nReturns the edited mirrored repository.\n\n#### Delete a mirrored repository\n```php\n$mirroredRepositoryId = 42;\n$client-\u003emirroredRepositories()-\u003eremove($mirroredRepositoryId);\n```\n\n#### List all mirrored packages from one repository\n```php\n$mirroredRepositoryId = 42;\n$packages = $client-\u003emirroredRepositories()-\u003elistPackages($mirroredRepositoryId);\n```\nReturns an array of packages.\n\n#### Add mirrored packages from one repository\n```php\n$mirroredRepositoryId = 42;\n$packages = [\n    'acme/cool-lib\n];\n$jobs = $client-\u003emirroredRepositories()-\u003eaddPackages($mirroredRepositoryId, $packages);\n```\nReturns an array of jobs.\n\n#### Remove all mirrored packages from one repository\n```php\n$mirroredRepositoryId = 42;\n$client-\u003emirroredRepositories()-\u003eremovePackages($mirroredRepositoryId);\n```\n\n### Job\n\n#### Show a job\n```php\n$job = $client-\u003ejobs()-\u003eshow($jobId);\n```\nReturns the job.\n\n#### Wait for a job to finish\nThis will periodically poll the job status until the job either finished or the maximum wait time was reached\n```php\n$numberOfSecondsToWait = 180;\n$jobHelper = new \\PrivatePackagist\\ApiClient\\JobHelper($client);\ntry {\n    $job = $jobHelper-\u003ewaitForJob($jobId, $numberOfSecondsToWait);\n} catch (\\PrivatePackagist\\ApiClient\\Exception\\JobTimeoutException $e) {\n    // Job didn't finish within the specified time\n} catch (\\PrivatePackagist\\ApiClient\\Exception\\JobErrorException $e) {\n    // Job finished with an error. See the message for more information\n    echo $e-\u003egetMessage();\n}\n\n\n\n```\nReturns the job.\n\n### Security Issue\n\n#### List an organization's security issues\n\n```php\n$filters = [\n    'security-issue-state' =\u003e \\PrivatePackagist\\ApiClient\\Api\\SecurityIssues::STATE_OPEN, // optional filter to filter packages with open security issues,\n];\n$packages = $client-\u003esecurityIssues()-\u003eall($filters);\n```\nReturns an array of security issues.\n\n### Magento legacy keys\n\n#### List all legacy keys for a customer\n```php\n$customerId = 42;\n$legacyKeys = $client-\u003ecustomers()-\u003emagentoLegacyKeys()-\u003eall($customerId);\n```\nReturns a list of Magento legacy keys.\n\n#### Create a new legacy keys for a customer\n```php\n$legacyKey = $client-\u003ecustomers()-\u003emagentoLegacyKeys()-\u003ecreate($customerId, $publicKey, $privateKey);\n```\nReturns the new Magento legacy key.\n\n#### Delete a legacy keys from a customer\n```php\n$client-\u003ecustomers()-\u003emagentoLegacyKeys()-\u003eremove($customerId, $publicKey);\n```\n\n### Validate incoming webhook payloads\n\nWhen you create or update a webhook in Private Packagist an optional secret can be set. This secret gets used to create a signature which is sent with each request in the headers as `Packagist-Signature`. The secret and signature can then be used on your server to validate that the request was made by Private Packagist. If no secret is set then no signature is sent.\n\n```php\n$request = /** any Psr7 request */;\n$secret = 'webhook-secret';\n$webhookSignature = new \\PrivatePackagist\\ApiClient\\WebhookSignature($secret);\n$requestSignature = $request-\u003ehasHeader('Packagist-Signature') ? $request-\u003egetHeader('Packagist-Signature')[0] : null;\n$webhookSignature-\u003evalidate($requestSignature, (string) $request-\u003egetBody());\n```\n\n## License\n\n`private-packagist/api-client` is licensed under the MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpackagist%2Fprivate-packagist-api-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpackagist%2Fprivate-packagist-api-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpackagist%2Fprivate-packagist-api-client/lists"}