user_seats
Creates, updates, deletes, gets or lists a user_seats resource.
Overview
| Name | user_seats |
| Type | Resource |
| Id | github.copilot.user_seats |
Fields
The following fields are returned by SELECT queries:
- get_copilot_seat_assignment_details_for_user
The user's GitHub Copilot seat details, including usage.
| Name | Datatype | Description |
|---|---|---|
assignee | object | A GitHub user. (title: Simple User) |
assigning_team | object | The team through which the assignee is granted access to GitHub Copilot, if applicable. (title: Team) |
created_at | string (date-time) | Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format. |
last_activity_at | string (date-time) | Timestamp of user's last GitHub Copilot activity, in ISO 8601 format. |
last_activity_editor | string | Last editor that was used by the user for a GitHub Copilot completion. |
last_authenticated_at | string (date-time) | Timestamp of the last time the user authenticated with GitHub Copilot, in ISO 8601 format. |
organization | object | A GitHub organization. (title: Organization Simple) |
pending_cancellation_date | string (date) | The pending cancellation date for the seat, in YYYY-MM-DD format. This will be null unless the assignee's Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization's next billing cycle. |
plan_type | string | The Copilot plan of the organization, or the parent enterprise, when applicable. (business, enterprise, unknown) |
updated_at | string (date-time) | Closing down notice: This field is no longer relevant and is closing down. Use the created_at field to determine when the assignee was last granted access to GitHub Copilot. Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_copilot_seat_assignment_details_for_user | select | org, username | > [!NOTE] > This endpoint is in public preview and is subject to change. Gets the GitHub Copilot seat details for a member of an organization who currently has access to GitHub Copilot. The seat object contains information about the user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in last_activity_at.For more information about activity data, see Metrics data properties for GitHub Copilot. Only organization owners can view Copilot seat assignment details for members of their organization. OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or read:org scopes to use this endpoint. | |
add_copilot_for_business_seats_for_users | insert | org, selected_usernames | > [!NOTE] > This endpoint is in public preview and is subject to change. Purchases a GitHub Copilot seat for each user specified. The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "About billing for GitHub Copilot in your organization." Only organization owners can purchase Copilot seats for their organization members. The organization must have a Copilot Business or Copilot Enterprise subscription and a configured suggestion matching policy. For more information about setting up a Copilot subscription, see "Subscribing to Copilot for your organization." For more information about setting a suggestion matching policy, see "Managing policies for Copilot in your organization." The response contains the total number of new seats that were created and existing seats that were refreshed. OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or admin:org scopes to use this endpoint. | |
cancel_copilot_seat_assignment_for_users | exec | org, selected_usernames | > [!NOTE] > This endpoint is in public preview and is subject to change. Sets seats for all users specified to "pending cancellation". This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through team membership. For more information about disabling access to Copilot, see "Revoking access to Copilot for members of your organization." Only organization owners can cancel Copilot seats for their organization members. The response contains the total number of seats set to "pending cancellation". OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or admin:org scopes to use this endpoint. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
org | string | The organization name. The name is not case sensitive. |
username | string | The handle for the GitHub user account. |
SELECT examples
- get_copilot_seat_assignment_details_for_user
> [!NOTE]
> This endpoint is in public preview and is subject to change.
Gets the GitHub Copilot seat details for a member of an organization who currently has access to GitHub Copilot.
The seat object contains information about the user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in last_activity_at.
For more information about activity data, see Metrics data properties for GitHub Copilot.
Only organization owners can view Copilot seat assignment details for members of their organization.
OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or read:org scopes to use this endpoint.
SELECT
assignee,
assigning_team,
created_at,
last_activity_at,
last_activity_editor,
last_authenticated_at,
organization,
pending_cancellation_date,
plan_type,
updated_at
FROM github.copilot.user_seats
WHERE org = '{{ org }}' -- required
AND username = '{{ username }}' -- required
;
INSERT examples
- add_copilot_for_business_seats_for_users
- Manifest
> [!NOTE]
> This endpoint is in public preview and is subject to change.
Purchases a GitHub Copilot seat for each user specified.
The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "About billing for GitHub Copilot in your organization."
Only organization owners can purchase Copilot seats for their organization members. The organization must have a Copilot Business or Copilot Enterprise subscription and a configured suggestion matching policy.
For more information about setting up a Copilot subscription, see "Subscribing to Copilot for your organization."
For more information about setting a suggestion matching policy, see "Managing policies for Copilot in your organization."
The response contains the total number of new seats that were created and existing seats that were refreshed.
OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or admin:org scopes to use this endpoint.
INSERT INTO github.copilot.user_seats (
selected_usernames,
org
)
SELECT
'{{ selected_usernames }}' /* required */,
'{{ org }}'
RETURNING
seats_created
;
# Description fields are for documentation purposes
- name: user_seats
props:
- name: org
value: "{{ org }}"
description: Required parameter for the user_seats resource.
- name: selected_usernames
value:
- "{{ selected_usernames }}"
description: |
The usernames of the organization members to be granted access to GitHub Copilot.
Lifecycle Methods
- cancel_copilot_seat_assignment_for_users
> [!NOTE]
> This endpoint is in public preview and is subject to change.
Sets seats for all users specified to "pending cancellation".
This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through team membership.
For more information about disabling access to Copilot, see "Revoking access to Copilot for members of your organization."
Only organization owners can cancel Copilot seats for their organization members.
The response contains the total number of seats set to "pending cancellation".
OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or admin:org scopes to use this endpoint.
EXEC github.copilot.user_seats.cancel_copilot_seat_assignment_for_users
@org='{{ org }}' --required
@@json=
'{
"selected_usernames": "{{ selected_usernames }}"
}'
;