For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inTry it free
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
  • REST API overview
    • Access Tokens
    • Account Members
    • Account Usage Beta
    • AI Configs
    • Announcements
    • Applications Beta
    • Approvals
    • Approvals Beta
    • Audit Log
    • Code References
    • Contexts
    • Context Settings
    • Custom Roles
    • Data Export Destinations
    • Environments
    • Experiments
    • Feature Flags
    • Feature Flags Beta
    • Flag Import Configurations Beta
    • Flag Links Beta
    • Flag Triggers
    • Follow Flags
    • Holdouts Beta
    • Insights Charts Beta
    • Insights Deployments Beta
    • Insights Flag Events Beta
    • Insights Pull Requests Beta
    • Insights Repositories Beta
    • Insights Scores Beta
    • Integration Audit Log Subscriptions
    • Integration Delivery Configurations Beta
    • Integrations Beta
    • Layers
    • Metrics
    • Metrics Beta
    • OAuth2 Clients
    • Persistent Store Integrations Beta
    • Projects
    • Relay Proxy Configurations
    • Release Pipelines Beta
    • Releases Beta
    • Scheduled Changes
    • Segments
    • Tags
    • Teams
      • POSTAdd multiple members to team
      • POSTCreate team
      • DELDelete team
      • GETGet team
      • GETGet team custom roles
      • GETGet team maintainers
      • GETList teams
      • PATCHUpdate team
    • Teams Beta
    • Users
    • Users Beta
    • User Settings
    • Views Beta
    • Webhooks
    • Workflows
    • Workflow Templates
    • Other
Sign inTry it free
LogoLogo
REST API overviewTeams

Create team

POST
/api/v2/teams
POST
/api/v2/teams
$curl -X POST https://app.launchdarkly.com/api/v2/teams \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "key": "team-key-123abc",
> "name": "Example team",
> "customRoleKeys": [
> "example-role1",
> "example-role2"
> ],
> "description": "An example team",
> "memberIDs": [
> "12ab3c45de678910fgh12345"
> ]
>}'
1{
2 "description": "Description for this team.",
3 "key": "team-key-123abc",
4 "name": "Example team",
5 "_access": {
6 "denied": [
7 {
8 "action": "string",
9 "reason": {
10 "effect": "allow",
11 "resources": [
12 "proj/*:env/*;qa_*:/flag/*"
13 ],
14 "notResources": [
15 "string"
16 ],
17 "actions": [
18 "*"
19 ],
20 "notActions": [
21 "string"
22 ],
23 "role_name": "string"
24 }
25 }
26 ],
27 "allowed": [
28 {
29 "action": "string",
30 "reason": {
31 "effect": "allow",
32 "resources": [
33 "proj/*:env/*;qa_*:/flag/*"
34 ],
35 "notResources": [
36 "string"
37 ],
38 "actions": [
39 "*"
40 ],
41 "notActions": [
42 "string"
43 ],
44 "role_name": "string"
45 }
46 }
47 ]
48 },
49 "_creationDate": 1648671956143,
50 "_links": {
51 "parent": {
52 "href": "/api/v2/teams",
53 "type": "application/json"
54 },
55 "roles": {
56 "href": "/api/v2/teams/example-team/roles",
57 "type": "application/json"
58 },
59 "self": {
60 "href": "/api/v2/teams/example-team",
61 "type": "application/json"
62 }
63 },
64 "_lastModified": 1648672446072,
65 "_version": 3,
66 "_idpSynced": true,
67 "roleAttributes": "{\"developerProjectKey\": [\"default\"]}",
68 "roles": {
69 "totalCount": 1,
70 "items": [
71 {
72 "key": "role-key-123abc",
73 "name": "Example role",
74 "projects": {
75 "totalCount": 1,
76 "items": [
77 {
78 "_id": "57be1db38b75bf0772d11383",
79 "_links": {
80 "environments": {
81 "href": "/api/v2/projects/example-project/environments",
82 "type": "application/json"
83 },
84 "self": {
85 "href": "/api/v2/projects/example-project",
86 "type": "application/json"
87 }
88 },
89 "key": "project-key-123abc",
90 "name": "Example project"
91 }
92 ]
93 },
94 "appliedOn": 1648672018410
95 }
96 ],
97 "_links": {
98 "self": {
99 "href": "/api/v2/teams/example-team/roles?limit=25",
100 "type": "application/json"
101 }
102 }
103 },
104 "members": {
105 "totalCount": 15
106 },
107 "projects": {
108 "totalCount": 1,
109 "items": [
110 {
111 "_id": "57be1db38b75bf0772d11383",
112 "_links": {
113 "environments": {
114 "href": "/api/v2/projects/example-project/environments",
115 "type": "application/json"
116 },
117 "self": {
118 "href": "/api/v2/projects/example-project",
119 "type": "application/json"
120 }
121 },
122 "key": "project-key-123abc",
123 "name": "Example project"
124 }
125 ]
126 },
127 "maintainers": {
128 "totalCount": 1,
129 "items": [
130 {
131 "_links": {
132 "self": {
133 "href": "/api/v2/members/569f183514f4432160000007",
134 "type": "application/json"
135 }
136 },
137 "_id": "569f183514f4432160000007",
138 "role": "reader",
139 "email": "ariel@acme.com",
140 "firstName": "Ariel",
141 "lastName": "Flores"
142 }
143 ],
144 "_links": {
145 "self": {
146 "href": "/api/v2/teams/example-team/maintainers?limit=20",
147 "type": "application/json"
148 }
149 }
150 }
151}
Create a team. To learn more, read [Creating a team](https://launchdarkly.com/docs/home/account/create-teams). ### Expanding the teams response LaunchDarkly supports four fields for expanding the "Create team" response. By default, these fields are **not** included in the response. To expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields: * `members` includes the total count of members that belong to the team. * `roles` includes a paginated list of the custom roles that you have assigned to the team. * `projects` includes a paginated list of the projects that the team has any write access to. * `maintainers` includes a paginated list of the maintainers that you have assigned to the team. For example, `expand=members,roles` includes the `members` and `roles` fields in the response.
Was this page helpful?
Previous

Delete team

Next
Built with

Create a team. To learn more, read Creating a team.

Expanding the teams response

LaunchDarkly supports four fields for expanding the “Create team” response. By default, these fields are not included in the response.

To expand the response, append the expand query parameter and add a comma-separated list with any of the following fields:

  • members includes the total count of members that belong to the team.
  • roles includes a paginated list of the custom roles that you have assigned to the team.
  • projects includes a paginated list of the projects that the team has any write access to.
  • maintainers includes a paginated list of the maintainers that you have assigned to the team.

For example, expand=members,roles includes the members and roles fields in the response.

Authentication

Authorizationstring
API Key authentication via header

Query parameters

expandstringOptionalformat: "string"

A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above.

Request

This endpoint expects an object.
keystringRequired
The team key
namestringRequired

A human-friendly name for the team

customRoleKeyslist of stringsOptional
List of custom role keys the team will access
descriptionstringOptional
A description of the team
memberIDslist of stringsOptional
A list of member IDs who belong to the team
permissionGrantslist of objectsOptional
A list of permission grants. Permission grants allow access to a specific action, without having to create or update a custom role.
roleAttributesmap from strings to lists of stringsOptional
A map of role attributes for the team

Response

Teams response
descriptionstring
A description of the team
keystring
The team key
namestring

A human-friendly name for the team

_accessobject
Details on the allowed and denied actions for this team
_creationDatelong
Timestamp of when the team was created
_linksmap from strings to objects
The location and content type of related resources
_lastModifiedlong
Timestamp of when the team was most recently updated
_versioninteger
The team version
_idpSyncedboolean

Whether the team has been synced with an external identity provider (IdP). Team sync is available to customers on an Enterprise plan.

roleAttributesmap from strings to lists of strings
A map of role attributes for the team
rolesobject

Paginated list of the custom roles assigned to this team. Only included if specified in the expand query parameter.

membersobject

Details on the total count of members that belong to the team. Only included if specified in the expand query parameter.

projectsobject

Paginated list of the projects that the team has any write access to. Only included if specified in the expand query parameter.

maintainersobject

Paginated list of the maintainers assigned to this team. Only included if specified in the expand query parameter.

Errors

400
Bad Request Error
401
Unauthorized Error
405
Method Not Allowed Error
429
Too Many Requests Error