The Teams REST API enables you to build apps, script interactions, or develop any other type of integration with Atlassian teams.
This documentation is for version 1 of the Teams REST API, which is the latest version.
Basic auth requires API tokens. You generate an API token for your Atlassian account and use it to authenticate anywhere where you would have used a password. This enhances security because:
See the Atlassian Cloud Support API tokens article to discover how to generate an API token.
Most client software provides a simple mechanism for supplying a user name (in our case, the email address) and API token that the client uses to build the required authentication headers. For example, you can specify the -u argument in cURL as follows
1 2curl -u fred@example.com:freds_api_token \ -X GET \ -H "Content-Type: application/json" \ https://sitename.atlassian.net/gateway/api/public/teams/v1/org/{orgId}/teams/{teamId}
You can construct and send basic auth headers. To do this you perform the following steps:
useremail:api_token
.1 2echo -n user@example.com:api_token_string | base64
1 2$Text = ‘user@example.com:api_token_string’ $Bytes = [System.Text.Encoding]::UTF8.GetBytes($Text) $EncodedText = [Convert]::ToBase64String($Bytes) $EncodedText
Authorization
header with content Basic
followed by the encoded string. For example, the string fred:fred
encodes to ZnJlZDpmcmVk
in base64, so you would make the request as follows:1 2curl -X GET \ -H "Authorization: Basic ZnJlZDpmcmVk" \ -H "Content-Type: application/json" \ 'https://sitename.atlassian.net/gateway/api/public/teams/v1/org/{orgId}/teams/{teamId}'
Organization admins, unlike regular users, can also change any team and its members through the public API without being a member of the team.
When you're making calls to the Team Get Members REST API, there’s a good chance the search will return a huge amount of results. We paginate results to help make responses easier to handle.
Set the first
parameter to ensure you know how many results per page you'll get. The maximum number of results we can return is 50.
Your GET would look something like this:
1 2curl -D- \ -X POST \ -H "Authorization: Basic ZnJlZDpmcmVk" \ -H "Content-Type: application/json" \ -H "Accept: */*" \ -d '{ "after": <optional-cursor-to-fetch-next-set-of-items> "first": 10 }' 'https://sitename.atlassian.net/gateway/api/public/teams/v1/org/{orgId}/teams/{teamId}/members'
This is indicated by the hasNextPage
key in the response.
You can then make a call to return the next page. Use the endCursor
from the earlier response here as input for the after
parameter to get the next set of results.
1 2{ "pageInfo": { "hasNextPage": true, "endCursor": "<cursor-feeds-into-after-parameter>" }, "results": [ ... ] }
POST /gateway/api/public/teams/v1/org/{orgId}/teams/
Creates a team, and adds the requesting user as the initial member.
GET /gateway/api/public/teams/v1/org/{orgId}/teams/{teamId}
Get the information of the team.
DELETE /gateway/api/public/teams/v1/org/{orgId}/teams/{teamId}
Delete the team.
PATCH /gateway/api/public/teams/v1/org/{orgId}/teams/{teamId}
Update the details of the team.
POST /gateway/api/public/teams/v1/org/{orgId}/teams/{teamId}/members
Fetch members of the specified team.
POST /gateway/api/public/teams/v1/org/{orgId}/teams/{teamId}/members/add
Add members to a team.
POST /gateway/api/public/teams/v1/org/{orgId}/teams/{teamId}/members/remove
Remove members from a team
Rate this page: