Skip to main content
The Organizations API provides endpoints for managing organizations, members, and teams.

Overview

Organizations allow grouping repositories and users together with shared settings and permissions.

Organization Endpoints

Get Organization

Get an organization by name.
Response:

Get Organization by ID


Search Organizations

Search for organizations by name.
Response:

Check Name Availability

Check if an organization name is available.
Response:

Create Organization

Create a new organization. Requires authentication.
Validation:
  • name must be 2-39 characters
  • name must be alphanumeric with hyphens
  • name cannot start or end with a hyphen
Response: The created organization object. Example:

Update Organization

Update organization details. Requires admin permission.

Delete Organization

Delete an organization. Requires owner permission.
Response:

Member Endpoints

List Members

List all members of an organization.
Response:

List User’s Organizations

Get organizations the current user belongs to.
Response:

Check Membership

Check if a user is a member of an organization.
Response:

Add Member

Add a user to an organization. Requires admin permission.

Update Member Role

Change a member’s role. Requires owner permission.
Note: Cannot demote the last owner.

Remove Member

Remove a user from an organization. Members can remove themselves; admins can remove others.
Note: Cannot remove the last owner.

Team Endpoints

Teams allow organizing members within an organization.

List Teams

List all teams in an organization.
Response:

Get Team

Get a team by ID.

Create Team

Create a new team. Requires admin permission.

Update Team

Update team details. Requires admin permission.

Delete Team

Delete a team. Requires admin permission.

List Team Members

List members of a team.
Response:

Add Team Member

Add a user to a team. User must be an organization member. Requires admin permission.

Remove Team Member

Remove a user from a team. Members can remove themselves; admins can remove others.

Roles

Organization Roles


Error Handling


Usage Examples

Create Organization with Team

React Hook Example