The Teams entity, its details, and details of its members can be accessed through the Atlassian platform GraphQL API in an experimental beta query. Teams is available to be queried, read and integrated into applications. Read more about the benefits of creating and using Atlassian Teams for your projects.
Developers are able to fetch Teams data, allowing them to:
Attach a team to existing objects
Integrate a team dashboard
Display the team profile and the members of the team
The API authenticates users making requests to fetch a team. Only users with permission can view and access teams.
Read more about authentication from the GraphQL reference documentation.
A query takes the following form, where 'teamId'
is the ID of the team you wish to query:
query getTeam ($teamId: ID!) {
team {
team (id: $teamId) {
id
displayName
description
smallHeaderImageUrl
largeHeaderImageUrl
smallAvatarImageUrl
largeAvatarImageUrl
organizationId
creator {
accountId
name
picture
}
state
membershipSetting
members {
nodes {
member {
accountId
name
picture
}
state
role
}
edges {
cursor
node {
member {
accountId
name
picture
}
state
role
}
}
pageInfo {
startCursor
endCursor
hasNextPage
hasPreviousPage
}
}
}
}
}
The team's ID must be in the form of an Atlassian Resource Identifier (ARI).
The member
field can contain additional query parameters:
(first: Int! = 100, after: String, state: [MembershipState!]! = FULL_MEMBER)
'first'
describes the number of team members to return and is defaulted to the first 100 members.
'after'
is a cursor string describing after which member in the list should the members
list start returning.
'MembershipState'
describes the state of an individual's membership within a team, taking the values:
FULL_MEMBER
,INVITED
,ALUMNI
,REQUESTING_TO_JOIN
The default value is 'FULL_MEMBER'
, but the parameter can take a list of states and will return any member with those membership states.
The query is defaulted to return the first 100 'FULL_MEMBER'
s of a team.
Rate limits are applied to users when they send:
40 requests to a team within a minute
20 requests to team members within a minute
These rate limits may be increased or decreased in the future.
The Team entity is in Beta state which allows us to monitor and ensure it operates as expected. The Team query requires additional headers to access beta fields:
{
"X-ExperimentalApi": ["teams-beta", "team-members-beta"]
}
The 'teams-beta'
header is required to query a team.
The additional 'team-members-beta'
header is required to query the members of a team.
Leave some feedback or ask a question through the Atlassian Community.
Read more about the Atlassian platform GraphQL API and find API reference documentation describing in further detail about the fields of a team and team members.
Unfortunately not at the moment. Connect apps uses a different authentication approach, Atlassian GraphQL does not support authenticating Connect apps yet.
If this is only for your personal use, you could use an user token instead. Visit https://id.atlassian.com/manage-profile/security/api-tokens to generate your own token. This will unfortunately be suitable for your private apps though.
Regards,
Ishan
Thanks for the answer @Ishan Somasiri !
It is for the Connect App to be able to retrieve Teams from Jira (so that users do not need to create and manage teams twice - in Jira and then in the app).
Regards,
Oleh
Hi @Amrendra Kumar , such an API does not exist at present unfortunately. For us to look more in to this requirement, could you explain what you meant by "all teams" ?
Is it,
Looking forward to hear your thoughts.
Thanks for your reply @Ishan Somasiri . I was looking to list all the teams that are "open team" which I can join.
The current GraphQL query requires ARI for a team to query but I am not sure if we have that information unless we list that information.
Hello! I was trying to use this, but I constantly get an error about malformed ARI, could you give an example of a correctly formatted one?
As a side not I am getting mine from the URL for the team.
Thanks.
Hi @BobbyDaBrick ,
A correct ARI should look like ari:cloud:identity::team/TEAM-ID . TEAM-ID can be found by visiting your team profile and copying the long ID that's shown at the and of the address bar (so how you obtain the team id seems to be correct, it just needs to be prefixed with above).
See documentation here for further details. Let us know if you need further help.
Hi @BobbyDaBrick ,
A while ago we fixed a typo in our documentation. The format of the team ARI was incorrectly described at https://developer.atlassian.com/platform/teams/teams-graphql-api/using-team-query/ . After fixing the typo, the documentation now reads as follows:
ari:cloud:identity::team/xxx-xxx-xxxx
Can you please confirm that you are trying with that format?
Thank you for using our API.