MC-BARS.COMDomains · SSL · HTTPS · Guides
News / Development and AI
Development and AI

GitHub REST API adds cost center search for a resource

GitHub added an operation to the REST API that lets you find out which cost center a specific user, organization, repository, or enterprise team belongs to. To search, provide the resource type and its name; the response contains the cost center’s ID and name. If there is no association, the API returns an empty memberships array. The update was published in the GitHub Changelog on November 3, 2026.

Original source: GitHub Changelog · Original date: 2026-11-03 · Review published: 2026-11-06
Illustration on Development and AI

Search instead of checking every cost center

Previously, to identify the cost center for a resource, you had to retrieve the list of all cost centers and check which ones included it. The new request changes the workflow: the resource itself becomes the starting point. The client provides its type and name, and the API returns information about the corresponding cost center, if such an association exists. This is useful when you need to check a specific account, organization, repository, or team without manually reviewing the list of cost centers. The GitHub announcement does not provide request examples, its URL, or the specific parameter format; it only states that the resource type and name are needed for the search.

Which resources you can check

The operation covers four types of objects: users, organizations, repositories, and enterprise teams. Therefore, a request can be made for any of these resource types, provided the caller has the necessary viewing permissions. Do not extend the list to other objects: GitHub does not mention them in the announcement. The result is intended to identify whether a resource belongs to a cost center. The response includes the ID and name of the matching center. In this announcement, GitHub does not mention any additional information, such as spending amounts, cost allocation rules, or change history. The new operation should therefore be treated specifically as a way to check a resource’s membership, not as a replacement for other billing features.

How to interpret an empty response

If a resource does not belong to any cost center, the memberships array in the response is empty. This differs from a result where a cost center is found: in that case, the response includes its ID and name. Thus, the absence of a membership is represented explicitly rather than by a nonexistent center name or ID. When processing the response, an integration can account for both cases: a matching association and an empty array. The announcement does not describe HTTP status codes, errors for an invalid resource name, or behavior for resources the calling user cannot access. These details cannot be inferred from the brief update description; GitHub points to the REST API documentation for the format and operating conditions.

Access for enterprise owners and billing managers

Enterprise owners, billing managers, and GitHub Apps with permission to read enterprise billing data can search for any resource within that enterprise. For these categories, GitHub specifies access to all enterprise resources, not just objects already visible under a user’s more limited permissions. For apps, there is a separate requirement: the GitHub App must have read access to enterprise billing. Simply using an app or the REST API does not grant the permission described in the announcement. If this access is not available, the announcement does not promise that the search can be performed. GitHub also does not provide instructions in the announcement for configuring the permission or a list of additional authorization requirements.

Restrictions for organizations and user roles

Organization owners and users with custom roles that include permission to read enterprise billing can check only the resources and cost centers they already have permission to view. This restriction preserves existing visibility boundaries: the new operation does not, by itself, grant access to resources beyond them. As a result, feature availability depends not only on the object specified in the request, but also on the caller’s permissions. For some categories—enterprise owners, billing managers, and eligible GitHub Apps—GitHub allows searches for any resource in the enterprise. For organization owners and users with the specified custom roles, the search is limited to what they can already see.

Documentation for the new operation

GitHub recommends referring to the REST API section titled “Get cost center membership for a resource.” It describes the operation for retrieving a resource’s membership in a cost center. The announcement does not specify the exact route, API version, required headers, or code examples, so these details should be checked directly in the documentation rather than inferred from the feature name. The main change to the workflow is that checking a single resource no longer requires listing all cost centers first and matching their contents. You can now query membership by the object’s type and name. Whether a result is available still depends on the user’s or app’s permissions, and the absence of an association is indicated by an empty memberships array.

All news

IP Geolocation by DB-IP