SpyBara
Go Premium

Reference 2026-05-20 06:35 UTC to 2026-05-22 06:33 UTC

25 files changed +7,444 −1,185. View all changes and history on the product overview
2026
Wed 27 06:42 Fri 22 06:33 Wed 20 06:35 Tue 19 06:34 Mon 18 22:01 Mon 11 18:00 Thu 7 21:57 Tue 5 23:00 Sat 2 05:57
Details

38 38 

39 Unix timestamp (in seconds) when the group was created.39 Unix timestamp (in seconds) when the group was created.

40 40 

41 - `group_type: string`41 - `group_type: "group" or "tenant_group"`

42 42 

43 The type of the group.43 The type of the group.

44 44 

45 - `"group"`

46 

47 - `"tenant_group"`

48 

45 - `is_scim_managed: boolean`49 - `is_scim_managed: boolean`

46 50 

47 Whether the group is managed through SCIM and controlled by your identity provider.51 Whether the group is managed through SCIM and controlled by your identity provider.


79 {83 {

80 "id": "id",84 "id": "id",

81 "created_at": 0,85 "created_at": 0,

82 "group_type": "group_type",86 "group_type": "group",

83 "is_scim_managed": true,87 "is_scim_managed": true,

84 "name": "name"88 "name": "name"

85 }89 }


143 147 

144 Unix timestamp (in seconds) when the group was created.148 Unix timestamp (in seconds) when the group was created.

145 149 

146 - `group_type: string`150 - `group_type: "group" or "tenant_group"`

147 151 

148 The type of the group.152 The type of the group.

149 153 

154 - `"group"`

155 

156 - `"tenant_group"`

157 

150 - `is_scim_managed: boolean`158 - `is_scim_managed: boolean`

151 159 

152 Whether the group is managed through SCIM and controlled by your identity provider.160 Whether the group is managed through SCIM and controlled by your identity provider.


172{180{

173 "id": "id",181 "id": "id",

174 "created_at": 0,182 "created_at": 0,

175 "group_type": "group_type",183 "group_type": "group",

176 "is_scim_managed": true,184 "is_scim_managed": true,

177 "name": "name"185 "name": "name"

178}186}


201}209}

202```210```

203 211 

212## Retrieve group

213 

214**get** `/organization/groups/{group_id}`

215 

216Retrieves a group.

217 

218### Path Parameters

219 

220- `group_id: string`

221 

222### Returns

223 

224- `Group object { id, created_at, group_type, 2 more }`

225 

226 Details about an organization group.

227 

228 - `id: string`

229 

230 Identifier for the group.

231 

232 - `created_at: number`

233 

234 Unix timestamp (in seconds) when the group was created.

235 

236 - `group_type: "group" or "tenant_group"`

237 

238 The type of the group.

239 

240 - `"group"`

241 

242 - `"tenant_group"`

243 

244 - `is_scim_managed: boolean`

245 

246 Whether the group is managed through SCIM and controlled by your identity provider.

247 

248 - `name: string`

249 

250 Display name of the group.

251 

252### Example

253 

254```http

255curl https://api.openai.com/v1/organization/groups/$GROUP_ID \

256 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

257```

258 

259#### Response

260 

261```json

262{

263 "id": "id",

264 "created_at": 0,

265 "group_type": "group",

266 "is_scim_managed": true,

267 "name": "name"

268}

269```

270 

271### Example

272 

273```http

274curl https://api.openai.com/v1/organization/groups/group_01J1F8ABCDXYZ \

275 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

276 -H "Content-Type: application/json"

277```

278 

279#### Response

280 

281```json

282{

283 "id": "group_01J1F8ABCDXYZ",

284 "name": "Support Team",

285 "created_at": 1711471533,

286 "is_scim_managed": false,

287 "group_type": "group"

288}

289```

290 

204## Update group291## Update group

205 292 

206**post** `/organization/groups/{group_id}`293**post** `/organization/groups/{group_id}`


357 444 

358 Unix timestamp (in seconds) when the group was created.445 Unix timestamp (in seconds) when the group was created.

359 446 

360 - `group_type: string`447 - `group_type: "group" or "tenant_group"`

361 448 

362 The type of the group.449 The type of the group.

363 450 

451 - `"group"`

452 

453 - `"tenant_group"`

454 

364 - `is_scim_managed: boolean`455 - `is_scim_managed: boolean`

365 456 

366 Whether the group is managed through SCIM and controlled by your identity provider.457 Whether the group is managed through SCIM and controlled by your identity provider.


596}687}

597```688```

598 689 

690## Retrieve group user

691 

692**get** `/organization/groups/{group_id}/users/{user_id}`

693 

694Retrieves a user in a group.

695 

696### Path Parameters

697 

698- `group_id: string`

699 

700- `user_id: string`

701 

702### Returns

703 

704- `id: string`

705 

706 Identifier for the user.

707 

708- `email: string`

709 

710 Email address of the user, or `null` for users without an email.

711 

712- `is_service_account: boolean`

713 

714 Whether the user is a service account.

715 

716- `name: string`

717 

718 Display name of the user.

719 

720- `picture: string`

721 

722 URL of the user's profile picture, if available.

723 

724- `user_type: "user" or "tenant_user"`

725 

726 The type of user.

727 

728 - `"user"`

729 

730 - `"tenant_user"`

731 

732### Example

733 

734```http

735curl https://api.openai.com/v1/organization/groups/$GROUP_ID/users/$USER_ID \

736 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

737```

738 

739#### Response

740 

741```json

742{

743 "id": "id",

744 "email": "email",

745 "is_service_account": true,

746 "name": "name",

747 "picture": "picture",

748 "user_type": "user"

749}

750```

751 

752### Example

753 

754```http

755curl https://api.openai.com/v1/organization/groups/group_01J1F8ABCDXYZ/users/user_abc123 \

756 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

757 -H "Content-Type: application/json"

758```

759 

760#### Response

761 

762```json

763{

764 "id": "user_abc123",

765 "name": "Ada Lovelace",

766 "email": "ada@example.com",

767 "picture": null,

768 "is_service_account": false,

769 "user_type": "user"

770}

771```

772 

599## Remove group user773## Remove group user

600 774 

601**delete** `/organization/groups/{group_id}/users/{user_id}`775**delete** `/organization/groups/{group_id}/users/{user_id}`


694 868 

695 Identifier of the user that was added.869 Identifier of the user that was added.

696 870 

871### User Retrieve Response

872 

873- `UserRetrieveResponse object { id, email, is_service_account, 3 more }`

874 

875 Details about a user returned from an organization group membership lookup.

876 

877 - `id: string`

878 

879 Identifier for the user.

880 

881 - `email: string`

882 

883 Email address of the user, or `null` for users without an email.

884 

885 - `is_service_account: boolean`

886 

887 Whether the user is a service account.

888 

889 - `name: string`

890 

891 Display name of the user.

892 

893 - `picture: string`

894 

895 URL of the user's profile picture, if available.

896 

897 - `user_type: "user" or "tenant_user"`

898 

899 The type of user.

900 

901 - `"user"`

902 

903 - `"tenant_user"`

904 

697### User Delete Response905### User Delete Response

698 906 

699- `UserDeleteResponse object { deleted, object }`907- `UserDeleteResponse object { deleted, object }`


742 950 

743### Returns951### Returns

744 952 

745- `data: array of object { id, created_at, created_by, 8 more }`953- `data: array of object { id, assignment_sources, created_at, 9 more }`

746 954 

747 Role assignments returned in the current page.955 Role assignments returned in the current page.

748 956 


750 958 

751 Identifier for the role.959 Identifier for the role.

752 960 

961 - `assignment_sources: array of object { principal_id, principal_type }`

962 

963 Principals from which the role assignment is inherited, when available.

964 

965 - `principal_id: string`

966 

967 - `principal_type: string`

968 

753 - `created_at: number`969 - `created_at: number`

754 970 

755 When the role was created.971 When the role was created.


818 "data": [1034 "data": [

819 {1035 {

820 "id": "id",1036 "id": "id",

1037 "assignment_sources": [

1038 {

1039 "principal_id": "principal_id",

1040 "principal_type": "principal_type"

1041 }

1042 ],

821 "created_at": 0,1043 "created_at": 0,

822 "created_by": "created_by",1044 "created_by": "created_by",

823 "created_by_user_obj": {1045 "created_by_user_obj": {


1041}1263}

1042```1264```

1043 1265 

1266## Retrieve group organization role

1267 

1268**get** `/organization/groups/{group_id}/roles/{role_id}`

1269 

1270Retrieves an organization role assigned to a group.

1271 

1272### Path Parameters

1273 

1274- `group_id: string`

1275 

1276- `role_id: string`

1277 

1278### Returns

1279 

1280- `id: string`

1281 

1282 Identifier for the role.

1283 

1284- `assignment_sources: array of object { principal_id, principal_type }`

1285 

1286 Principals from which the role assignment is inherited, when available.

1287 

1288 - `principal_id: string`

1289 

1290 - `principal_type: string`

1291 

1292- `created_at: number`

1293 

1294 When the role was created.

1295 

1296- `created_by: string`

1297 

1298 Identifier of the actor who created the role.

1299 

1300- `created_by_user_obj: map[unknown]`

1301 

1302 User details for the actor that created the role, when available.

1303 

1304- `description: string`

1305 

1306 Description of the role.

1307 

1308- `metadata: map[unknown]`

1309 

1310 Arbitrary metadata stored on the role.

1311 

1312- `name: string`

1313 

1314 Name of the role.

1315 

1316- `permissions: array of string`

1317 

1318 Permissions associated with the role.

1319 

1320- `predefined_role: boolean`

1321 

1322 Whether the role is predefined by OpenAI.

1323 

1324- `resource_type: string`

1325 

1326 Resource type the role applies to.

1327 

1328- `updated_at: number`

1329 

1330 When the role was last updated.

1331 

1332### Example

1333 

1334```http

1335curl https://api.openai.com/v1/organization/groups/$GROUP_ID/roles/$ROLE_ID \

1336 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

1337```

1338 

1339#### Response

1340 

1341```json

1342{

1343 "id": "id",

1344 "assignment_sources": [

1345 {

1346 "principal_id": "principal_id",

1347 "principal_type": "principal_type"

1348 }

1349 ],

1350 "created_at": 0,

1351 "created_by": "created_by",

1352 "created_by_user_obj": {

1353 "foo": "bar"

1354 },

1355 "description": "description",

1356 "metadata": {

1357 "foo": "bar"

1358 },

1359 "name": "name",

1360 "permissions": [

1361 "string"

1362 ],

1363 "predefined_role": true,

1364 "resource_type": "resource_type",

1365 "updated_at": 0

1366}

1367```

1368 

1369### Example

1370 

1371```http

1372curl https://api.openai.com/v1/organization/groups/group_01J1F8ABCDXYZ/roles/role_01J1F8ROLE01 \

1373 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

1374 -H "Content-Type: application/json"

1375```

1376 

1377#### Response

1378 

1379```json

1380{

1381 "id": "role_01J1F8ROLE01",

1382 "name": "API Group Manager",

1383 "permissions": [

1384 "api.groups.read",

1385 "api.groups.write"

1386 ],

1387 "resource_type": "api.organization",

1388 "predefined_role": false,

1389 "description": "Allows managing organization groups",

1390 "created_at": 1711471533,

1391 "updated_at": 1711472599,

1392 "created_by": "user_abc123",

1393 "created_by_user_obj": null,

1394 "metadata": {},

1395 "assignment_sources": null

1396}

1397```

1398 

1044## Unassign organization role from group1399## Unassign organization role from group

1045 1400 

1046**delete** `/organization/groups/{group_id}/roles/{role_id}`1401**delete** `/organization/groups/{group_id}/roles/{role_id}`


1101 1456 

1102### Role List Response1457### Role List Response

1103 1458 

1104- `RoleListResponse object { id, created_at, created_by, 8 more }`1459- `RoleListResponse object { id, assignment_sources, created_at, 9 more }`

1105 1460 

1106 Detailed information about a role assignment entry returned when listing assignments.1461 Detailed information about a role assignment entry returned when listing assignments.

1107 1462 


1109 1464 

1110 Identifier for the role.1465 Identifier for the role.

1111 1466 

1467 - `assignment_sources: array of object { principal_id, principal_type }`

1468 

1469 Principals from which the role assignment is inherited, when available.

1470 

1471 - `principal_id: string`

1472 

1473 - `principal_type: string`

1474 

1112 - `created_at: number`1475 - `created_at: number`

1113 1476 

1114 When the role was created.1477 When the role was created.


1221 1584 

1222 Resource type the role is bound to (for example `api.organization` or `api.project`).1585 Resource type the role is bound to (for example `api.organization` or `api.project`).

1223 1586 

1587### Role Retrieve Response

1588 

1589- `RoleRetrieveResponse object { id, assignment_sources, created_at, 9 more }`

1590 

1591 Detailed information about a role assignment entry returned when listing assignments.

1592 

1593 - `id: string`

1594 

1595 Identifier for the role.

1596 

1597 - `assignment_sources: array of object { principal_id, principal_type }`

1598 

1599 Principals from which the role assignment is inherited, when available.

1600 

1601 - `principal_id: string`

1602 

1603 - `principal_type: string`

1604 

1605 - `created_at: number`

1606 

1607 When the role was created.

1608 

1609 - `created_by: string`

1610 

1611 Identifier of the actor who created the role.

1612 

1613 - `created_by_user_obj: map[unknown]`

1614 

1615 User details for the actor that created the role, when available.

1616 

1617 - `description: string`

1618 

1619 Description of the role.

1620 

1621 - `metadata: map[unknown]`

1622 

1623 Arbitrary metadata stored on the role.

1624 

1625 - `name: string`

1626 

1627 Name of the role.

1628 

1629 - `permissions: array of string`

1630 

1631 Permissions associated with the role.

1632 

1633 - `predefined_role: boolean`

1634 

1635 Whether the role is predefined by OpenAI.

1636 

1637 - `resource_type: string`

1638 

1639 Resource type the role applies to.

1640 

1641 - `updated_at: number`

1642 

1643 When the role was last updated.

1644 

1224### Role Delete Response1645### Role Delete Response

1225 1646 

1226- `RoleDeleteResponse object { deleted, object }`1647- `RoleDeleteResponse object { deleted, object }`

Details

24 24 

25 Unix timestamp (in seconds) when the group was created.25 Unix timestamp (in seconds) when the group was created.

26 26 

27 - `group_type: string`27 - `group_type: "group" or "tenant_group"`

28 28 

29 The type of the group.29 The type of the group.

30 30 

31 - `"group"`

32 

33 - `"tenant_group"`

34 

31 - `is_scim_managed: boolean`35 - `is_scim_managed: boolean`

32 36 

33 Whether the group is managed through SCIM and controlled by your identity provider.37 Whether the group is managed through SCIM and controlled by your identity provider.


53{57{

54 "id": "id",58 "id": "id",

55 "created_at": 0,59 "created_at": 0,

56 "group_type": "group_type",60 "group_type": "group",

57 "is_scim_managed": true,61 "is_scim_managed": true,

58 "name": "name"62 "name": "name"

59}63}

Details

36 36 

37 Unix timestamp (in seconds) when the group was created.37 Unix timestamp (in seconds) when the group was created.

38 38 

39 - `group_type: string`39 - `group_type: "group" or "tenant_group"`

40 40 

41 The type of the group.41 The type of the group.

42 42 

43 - `"group"`

44 

45 - `"tenant_group"`

46 

43 - `is_scim_managed: boolean`47 - `is_scim_managed: boolean`

44 48 

45 Whether the group is managed through SCIM and controlled by your identity provider.49 Whether the group is managed through SCIM and controlled by your identity provider.


77 {81 {

78 "id": "id",82 "id": "id",

79 "created_at": 0,83 "created_at": 0,

80 "group_type": "group_type",84 "group_type": "group",

81 "is_scim_managed": true,85 "is_scim_managed": true,

82 "name": "name"86 "name": "name"

83 }87 }

Details

183}183}

184```184```

185 185 

186## Retrieve group user

187 

188**get** `/organization/groups/{group_id}/users/{user_id}`

189 

190Retrieves a user in a group.

191 

192### Path Parameters

193 

194- `group_id: string`

195 

196- `user_id: string`

197 

198### Returns

199 

200- `id: string`

201 

202 Identifier for the user.

203 

204- `email: string`

205 

206 Email address of the user, or `null` for users without an email.

207 

208- `is_service_account: boolean`

209 

210 Whether the user is a service account.

211 

212- `name: string`

213 

214 Display name of the user.

215 

216- `picture: string`

217 

218 URL of the user's profile picture, if available.

219 

220- `user_type: "user" or "tenant_user"`

221 

222 The type of user.

223 

224 - `"user"`

225 

226 - `"tenant_user"`

227 

228### Example

229 

230```http

231curl https://api.openai.com/v1/organization/groups/$GROUP_ID/users/$USER_ID \

232 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

233```

234 

235#### Response

236 

237```json

238{

239 "id": "id",

240 "email": "email",

241 "is_service_account": true,

242 "name": "name",

243 "picture": "picture",

244 "user_type": "user"

245}

246```

247 

248### Example

249 

250```http

251curl https://api.openai.com/v1/organization/groups/group_01J1F8ABCDXYZ/users/user_abc123 \

252 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

253 -H "Content-Type: application/json"

254```

255 

256#### Response

257 

258```json

259{

260 "id": "user_abc123",

261 "name": "Ada Lovelace",

262 "email": "ada@example.com",

263 "picture": null,

264 "is_service_account": false,

265 "user_type": "user"

266}

267```

268 

186## Remove group user269## Remove group user

187 270 

188**delete** `/organization/groups/{group_id}/users/{user_id}`271**delete** `/organization/groups/{group_id}/users/{user_id}`


281 364 

282 Identifier of the user that was added.365 Identifier of the user that was added.

283 366 

367### User Retrieve Response

368 

369- `UserRetrieveResponse object { id, email, is_service_account, 3 more }`

370 

371 Details about a user returned from an organization group membership lookup.

372 

373 - `id: string`

374 

375 Identifier for the user.

376 

377 - `email: string`

378 

379 Email address of the user, or `null` for users without an email.

380 

381 - `is_service_account: boolean`

382 

383 Whether the user is a service account.

384 

385 - `name: string`

386 

387 Display name of the user.

388 

389 - `picture: string`

390 

391 URL of the user's profile picture, if available.

392 

393 - `user_type: "user" or "tenant_user"`

394 

395 The type of user.

396 

397 - `"user"`

398 

399 - `"tenant_user"`

400 

284### User Delete Response401### User Delete Response

285 402 

286- `UserDeleteResponse object { deleted, object }`403- `UserDeleteResponse object { deleted, object }`

Details

1079 1079 

1080### Returns1080### Returns

1081 1081 

1082- `data: array of object { id, created_at, created_by, 8 more }`1082- `data: array of object { id, assignment_sources, created_at, 9 more }`

1083 1083 

1084 Role assignments returned in the current page.1084 Role assignments returned in the current page.

1085 1085 


1087 1087 

1088 Identifier for the role.1088 Identifier for the role.

1089 1089 

1090 - `assignment_sources: array of object { principal_id, principal_type }`

1091 

1092 Principals from which the role assignment is inherited, when available.

1093 

1094 - `principal_id: string`

1095 

1096 - `principal_type: string`

1097 

1090 - `created_at: number`1098 - `created_at: number`

1091 1099 

1092 When the role was created.1100 When the role was created.


1155 "data": [1163 "data": [

1156 {1164 {

1157 "id": "id",1165 "id": "id",

1166 "assignment_sources": [

1167 {

1168 "principal_id": "principal_id",

1169 "principal_type": "principal_type"

1170 }

1171 ],

1158 "created_at": 0,1172 "created_at": 0,

1159 "created_by": "created_by",1173 "created_by": "created_by",

1160 "created_by_user_obj": {1174 "created_by_user_obj": {


1484}1498}

1485```1499```

1486 1500 

1501## Retrieve project user role

1502 

1503**get** `/projects/{project_id}/users/{user_id}/roles/{role_id}`

1504 

1505Retrieves a project role assigned to a user.

1506 

1507### Path Parameters

1508 

1509- `project_id: string`

1510 

1511- `user_id: string`

1512 

1513- `role_id: string`

1514 

1515### Returns

1516 

1517- `id: string`

1518 

1519 Identifier for the role.

1520 

1521- `assignment_sources: array of object { principal_id, principal_type }`

1522 

1523 Principals from which the role assignment is inherited, when available.

1524 

1525 - `principal_id: string`

1526 

1527 - `principal_type: string`

1528 

1529- `created_at: number`

1530 

1531 When the role was created.

1532 

1533- `created_by: string`

1534 

1535 Identifier of the actor who created the role.

1536 

1537- `created_by_user_obj: map[unknown]`

1538 

1539 User details for the actor that created the role, when available.

1540 

1541- `description: string`

1542 

1543 Description of the role.

1544 

1545- `metadata: map[unknown]`

1546 

1547 Arbitrary metadata stored on the role.

1548 

1549- `name: string`

1550 

1551 Name of the role.

1552 

1553- `permissions: array of string`

1554 

1555 Permissions associated with the role.

1556 

1557- `predefined_role: boolean`

1558 

1559 Whether the role is predefined by OpenAI.

1560 

1561- `resource_type: string`

1562 

1563 Resource type the role applies to.

1564 

1565- `updated_at: number`

1566 

1567 When the role was last updated.

1568 

1569### Example

1570 

1571```http

1572curl https://api.openai.com/v1/projects/$PROJECT_ID/users/$USER_ID/roles/$ROLE_ID \

1573 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

1574```

1575 

1576#### Response

1577 

1578```json

1579{

1580 "id": "id",

1581 "assignment_sources": [

1582 {

1583 "principal_id": "principal_id",

1584 "principal_type": "principal_type"

1585 }

1586 ],

1587 "created_at": 0,

1588 "created_by": "created_by",

1589 "created_by_user_obj": {

1590 "foo": "bar"

1591 },

1592 "description": "description",

1593 "metadata": {

1594 "foo": "bar"

1595 },

1596 "name": "name",

1597 "permissions": [

1598 "string"

1599 ],

1600 "predefined_role": true,

1601 "resource_type": "resource_type",

1602 "updated_at": 0

1603}

1604```

1605 

1606### Example

1607 

1608```http

1609curl https://api.openai.com/v1/projects/proj_abc123/users/user_abc123/roles/role_01J1F8PROJ \

1610 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

1611 -H "Content-Type: application/json"

1612```

1613 

1614#### Response

1615 

1616```json

1617{

1618 "id": "role_01J1F8PROJ",

1619 "name": "API Project Key Manager",

1620 "permissions": [

1621 "api.organization.projects.api_keys.read",

1622 "api.organization.projects.api_keys.write"

1623 ],

1624 "resource_type": "api.project",

1625 "predefined_role": false,

1626 "description": "Allows managing API keys for the project",

1627 "created_at": 1711471533,

1628 "updated_at": 1711472599,

1629 "created_by": "user_abc123",

1630 "created_by_user_obj": null,

1631 "metadata": {},

1632 "assignment_sources": null

1633}

1634```

1635 

1487## Unassign project role from user1636## Unassign project role from user

1488 1637 

1489**delete** `/projects/{project_id}/users/{user_id}/roles/{role_id}`1638**delete** `/projects/{project_id}/users/{user_id}/roles/{role_id}`


1546 1695 

1547### Role List Response1696### Role List Response

1548 1697 

1549- `RoleListResponse object { id, created_at, created_by, 8 more }`1698- `RoleListResponse object { id, assignment_sources, created_at, 9 more }`

1550 1699 

1551 Detailed information about a role assignment entry returned when listing assignments.1700 Detailed information about a role assignment entry returned when listing assignments.

1552 1701 


1554 1703 

1555 Identifier for the role.1704 Identifier for the role.

1556 1705 

1706 - `assignment_sources: array of object { principal_id, principal_type }`

1707 

1708 Principals from which the role assignment is inherited, when available.

1709 

1710 - `principal_id: string`

1711 

1712 - `principal_type: string`

1713 

1557 - `created_at: number`1714 - `created_at: number`

1558 1715 

1559 When the role was created.1716 When the role was created.


1740 1897 

1741 - `picture: optional string`1898 - `picture: optional string`

1742 1899 

1900### Role Retrieve Response

1901 

1902- `RoleRetrieveResponse object { id, assignment_sources, created_at, 9 more }`

1903 

1904 Detailed information about a role assignment entry returned when listing assignments.

1905 

1906 - `id: string`

1907 

1908 Identifier for the role.

1909 

1910 - `assignment_sources: array of object { principal_id, principal_type }`

1911 

1912 Principals from which the role assignment is inherited, when available.

1913 

1914 - `principal_id: string`

1915 

1916 - `principal_type: string`

1917 

1918 - `created_at: number`

1919 

1920 When the role was created.

1921 

1922 - `created_by: string`

1923 

1924 Identifier of the actor who created the role.

1925 

1926 - `created_by_user_obj: map[unknown]`

1927 

1928 User details for the actor that created the role, when available.

1929 

1930 - `description: string`

1931 

1932 Description of the role.

1933 

1934 - `metadata: map[unknown]`

1935 

1936 Arbitrary metadata stored on the role.

1937 

1938 - `name: string`

1939 

1940 Name of the role.

1941 

1942 - `permissions: array of string`

1943 

1944 Permissions associated with the role.

1945 

1946 - `predefined_role: boolean`

1947 

1948 Whether the role is predefined by OpenAI.

1949 

1950 - `resource_type: string`

1951 

1952 Resource type the role applies to.

1953 

1954 - `updated_at: number`

1955 

1956 When the role was last updated.

1957 

1743### Role Delete Response1958### Role Delete Response

1744 1959 

1745- `RoleDeleteResponse object { deleted, object }`1960- `RoleDeleteResponse object { deleted, object }`


2064}2279}

2065```2280```

2066 2281 

2067## Delete project service account2282## Update project service account

2068 

2069**delete** `/organization/projects/{project_id}/service_accounts/{service_account_id}`

2070 2283 

2071Deletes a service account from the project.2284**post** `/organization/projects/{project_id}/service_accounts/{service_account_id}`

2072 2285 

2073Returns confirmation of service account deletion, or an error if the project2286Updates a service account in the project.

2074is archived (archived projects have no service accounts).

2075 2287 

2076### Path Parameters2288### Path Parameters

2077 2289 


2079 2291 

2080- `service_account_id: string`2292- `service_account_id: string`

2081 2293 

2082### Returns2294### Body Parameters

2083 

2084- `id: string`

2085 

2086- `deleted: boolean`

2087 

2088- `object: "organization.project.service_account.deleted"`

2089 

2090 - `"organization.project.service_account.deleted"`

2091 

2092### Example

2093 

2094```http

2095curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/service_accounts/$SERVICE_ACCOUNT_ID \

2096 -X DELETE \

2097 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

2098```

2099 

2100#### Response

2101 2295 

2102```json2296- `name: optional string`

2103{

2104 "id": "id",

2105 "deleted": true,

2106 "object": "organization.project.service_account.deleted"

2107}

2108```

2109 2297 

2110### Example2298 The updated service account name.

2111 2299 

2112```http2300- `role: optional "member" or "owner"`

2113curl -X DELETE https://api.openai.com/v1/organization/projects/proj_abc/service_accounts/svc_acct_abc \

2114 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

2115 -H "Content-Type: application/json"

2116```

2117 2301 

2118#### Response2302 The updated service account role.

2119 2303 

2120```json2304 - `"member"`

2121{

2122 "object": "organization.project.service_account.deleted",

2123 "id": "svc_acct_abc",

2124 "deleted": true

2125}

2126```

2127 2305 

2128## Domain Types2306 - `"owner"`

2129 2307 

2130### Project Service Account2308### Returns

2131 2309 

2132- `ProjectServiceAccount object { id, created_at, name, 2 more }`2310- `ProjectServiceAccount object { id, created_at, name, 2 more }`

2133 2311 


2159 2337 

2160 - `"member"`2338 - `"member"`

2161 2339 

2162### Service Account Create Response2340### Example

2163 

2164- `ServiceAccountCreateResponse object { id, api_key, created_at, 3 more }`

2165 2341 

2166 - `id: string`2342```http

2343curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/service_accounts/$SERVICE_ACCOUNT_ID \

2344 -H 'Content-Type: application/json' \

2345 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

2346 -d '{}'

2347```

2167 2348 

2168 - `api_key: object { id, created_at, name, 2 more }`2349#### Response

2169 2350 

2170 - `id: string`2351```json

2352{

2353 "id": "id",

2354 "created_at": 0,

2355 "name": "name",

2356 "object": "organization.project.service_account",

2357 "role": "owner"

2358}

2359```

2171 2360 

2172 - `created_at: number`2361### Example

2173 2362 

2174 - `name: string`2363```http

2364curl -X POST https://api.openai.com/v1/organization/projects/proj_abc/service_accounts/svc_acct_abc \

2365 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

2366 -H "Content-Type: application/json" \

2367 -d '{

2368 "name": "Updated service account",

2369 "role": "member"

2370 }'

2371```

2372 

2373#### Response

2374 

2375```json

2376{

2377 "object": "organization.project.service_account",

2378 "id": "svc_acct_abc",

2379 "name": "Updated service account",

2380 "role": "member",

2381 "created_at": 1711471533

2382}

2383```

2384 

2385## Delete project service account

2386 

2387**delete** `/organization/projects/{project_id}/service_accounts/{service_account_id}`

2388 

2389Deletes a service account from the project.

2390 

2391Returns confirmation of service account deletion, or an error if the project

2392is archived (archived projects have no service accounts).

2393 

2394### Path Parameters

2395 

2396- `project_id: string`

2397 

2398- `service_account_id: string`

2399 

2400### Returns

2401 

2402- `id: string`

2403 

2404- `deleted: boolean`

2405 

2406- `object: "organization.project.service_account.deleted"`

2407 

2408 - `"organization.project.service_account.deleted"`

2409 

2410### Example

2411 

2412```http

2413curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/service_accounts/$SERVICE_ACCOUNT_ID \

2414 -X DELETE \

2415 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

2416```

2417 

2418#### Response

2419 

2420```json

2421{

2422 "id": "id",

2423 "deleted": true,

2424 "object": "organization.project.service_account.deleted"

2425}

2426```

2427 

2428### Example

2429 

2430```http

2431curl -X DELETE https://api.openai.com/v1/organization/projects/proj_abc/service_accounts/svc_acct_abc \

2432 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

2433 -H "Content-Type: application/json"

2434```

2435 

2436#### Response

2437 

2438```json

2439{

2440 "object": "organization.project.service_account.deleted",

2441 "id": "svc_acct_abc",

2442 "deleted": true

2443}

2444```

2445 

2446## Domain Types

2447 

2448### Project Service Account

2449 

2450- `ProjectServiceAccount object { id, created_at, name, 2 more }`

2451 

2452 Represents an individual service account in a project.

2453 

2454 - `id: string`

2455 

2456 The identifier, which can be referenced in API endpoints

2457 

2458 - `created_at: number`

2459 

2460 The Unix timestamp (in seconds) of when the service account was created

2461 

2462 - `name: string`

2463 

2464 The name of the service account

2465 

2466 - `object: "organization.project.service_account"`

2467 

2468 The object type, which is always `organization.project.service_account`

2469 

2470 - `"organization.project.service_account"`

2471 

2472 - `role: "owner" or "member"`

2473 

2474 `owner` or `member`

2475 

2476 - `"owner"`

2477 

2478 - `"member"`

2479 

2480### Service Account Create Response

2481 

2482- `ServiceAccountCreateResponse object { id, api_key, created_at, 3 more }`

2483 

2484 - `id: string`

2485 

2486 - `api_key: object { id, created_at, name, 2 more }`

2487 

2488 - `id: string`

2489 

2490 - `created_at: number`

2491 

2492 - `name: string`

2175 2493 

2176 - `object: "organization.project.service_account.api_key"`2494 - `object: "organization.project.service_account.api_key"`

2177 2495 


3705 4023 

3706 Display name of the group.4024 Display name of the group.

3707 4025 

3708 - `group_type: string`4026 - `group_type: "group" or "tenant_group"`

3709 4027 

3710 The type of the group.4028 The type of the group.

3711 4029 

4030 - `"group"`

4031 

4032 - `"tenant_group"`

4033 

3712 - `object: "project.group"`4034 - `object: "project.group"`

3713 4035 

3714 Always `project.group`.4036 Always `project.group`.


3749 "created_at": 0,4071 "created_at": 0,

3750 "group_id": "group_id",4072 "group_id": "group_id",

3751 "group_name": "group_name",4073 "group_name": "group_name",

3752 "group_type": "group_type",4074 "group_type": "group",

3753 "object": "project.group",4075 "object": "project.group",

3754 "project_id": "project_id"4076 "project_id": "project_id"

3755 }4077 }


3825 4147 

3826 Display name of the group.4148 Display name of the group.

3827 4149 

3828 - `group_type: string`4150 - `group_type: "group" or "tenant_group"`

3829 4151 

3830 The type of the group.4152 The type of the group.

3831 4153 

4154 - `"group"`

4155 

4156 - `"tenant_group"`

4157 

3832 - `object: "project.group"`4158 - `object: "project.group"`

3833 4159 

3834 Always `project.group`.4160 Always `project.group`.


3858 "created_at": 0,4184 "created_at": 0,

3859 "group_id": "group_id",4185 "group_id": "group_id",

3860 "group_name": "group_name",4186 "group_name": "group_name",

3861 "group_type": "group_type",4187 "group_type": "group",

3862 "object": "project.group",4188 "object": "project.group",

3863 "project_id": "project_id"4189 "project_id": "project_id"

3864}4190}


3888}4214}

3889```4215```

3890 4216 

4217## Retrieve project group

4218 

4219**get** `/organization/projects/{project_id}/groups/{group_id}`

4220 

4221Retrieves a project's group.

4222 

4223### Path Parameters

4224 

4225- `project_id: string`

4226 

4227- `group_id: string`

4228 

4229### Query Parameters

4230 

4231- `group_type: optional "group" or "tenant_group"`

4232 

4233 The type of group to retrieve.

4234 

4235 - `"group"`

4236 

4237 - `"tenant_group"`

4238 

4239### Returns

4240 

4241- `ProjectGroup object { created_at, group_id, group_name, 3 more }`

4242 

4243 Details about a group's membership in a project.

4244 

4245 - `created_at: number`

4246 

4247 Unix timestamp (in seconds) when the group was granted project access.

4248 

4249 - `group_id: string`

4250 

4251 Identifier of the group that has access to the project.

4252 

4253 - `group_name: string`

4254 

4255 Display name of the group.

4256 

4257 - `group_type: "group" or "tenant_group"`

4258 

4259 The type of the group.

4260 

4261 - `"group"`

4262 

4263 - `"tenant_group"`

4264 

4265 - `object: "project.group"`

4266 

4267 Always `project.group`.

4268 

4269 - `"project.group"`

4270 

4271 - `project_id: string`

4272 

4273 Identifier of the project.

4274 

4275### Example

4276 

4277```http

4278curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/groups/$GROUP_ID \

4279 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

4280```

4281 

4282#### Response

4283 

4284```json

4285{

4286 "created_at": 0,

4287 "group_id": "group_id",

4288 "group_name": "group_name",

4289 "group_type": "group",

4290 "object": "project.group",

4291 "project_id": "project_id"

4292}

4293```

4294 

4295### Example

4296 

4297```http

4298curl https://api.openai.com/v1/organization/projects/proj_abc123/groups/group_01J1F8ABCDXYZ \

4299 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

4300 -H "Content-Type: application/json"

4301```

4302 

4303#### Response

4304 

4305```json

4306{

4307 "object": "project.group",

4308 "project_id": "proj_abc123",

4309 "group_id": "group_01J1F8ABCDXYZ",

4310 "group_name": "Support Team",

4311 "group_type": "group",

4312 "created_at": 1711471533

4313}

4314```

4315 

3891## Remove project group4316## Remove project group

3892 4317 

3893**delete** `/organization/projects/{project_id}/groups/{group_id}`4318**delete** `/organization/projects/{project_id}/groups/{group_id}`


3966 4391 

3967 Display name of the group.4392 Display name of the group.

3968 4393 

3969 - `group_type: string`4394 - `group_type: "group" or "tenant_group"`

3970 4395 

3971 The type of the group.4396 The type of the group.

3972 4397 

4398 - `"group"`

4399 

4400 - `"tenant_group"`

4401 

3973 - `object: "project.group"`4402 - `object: "project.group"`

3974 4403 

3975 Always `project.group`.4404 Always `project.group`.


4030 4459 

4031### Returns4460### Returns

4032 4461 

4033- `data: array of object { id, created_at, created_by, 8 more }`4462- `data: array of object { id, assignment_sources, created_at, 9 more }`

4034 4463 

4035 Role assignments returned in the current page.4464 Role assignments returned in the current page.

4036 4465 


4038 4467 

4039 Identifier for the role.4468 Identifier for the role.

4040 4469 

4470 - `assignment_sources: array of object { principal_id, principal_type }`

4471 

4472 Principals from which the role assignment is inherited, when available.

4473 

4474 - `principal_id: string`

4475 

4476 - `principal_type: string`

4477 

4041 - `created_at: number`4478 - `created_at: number`

4042 4479 

4043 When the role was created.4480 When the role was created.


4106 "data": [4543 "data": [

4107 {4544 {

4108 "id": "id",4545 "id": "id",

4546 "assignment_sources": [

4547 {

4548 "principal_id": "principal_id",

4549 "principal_type": "principal_type"

4550 }

4551 ],

4109 "created_at": 0,4552 "created_at": 0,

4110 "created_by": "created_by",4553 "created_by": "created_by",

4111 "created_by_user_obj": {4554 "created_by_user_obj": {


4331}4774}

4332```4775```

4333 4776 

4334## Unassign project role from group4777## Retrieve project group role

4335 4778 

4336**delete** `/projects/{project_id}/groups/{group_id}/roles/{role_id}`4779**get** `/projects/{project_id}/groups/{group_id}/roles/{role_id}`

4337 4780 

4338Unassigns a project role from a group within a project.4781Retrieves a project role assigned to a group.

4339 4782 

4340### Path Parameters4783### Path Parameters

4341 4784 


4347 4790 

4348### Returns4791### Returns

4349 4792 

4350- `deleted: boolean`4793- `id: string`

4351 4794 

4352 Whether the assignment was removed.4795 Identifier for the role.

4353 4796 

4354- `object: string`4797- `assignment_sources: array of object { principal_id, principal_type }`

4355 4798 

4356 Identifier for the deleted assignment, such as `group.role.deleted` or `user.role.deleted`.4799 Principals from which the role assignment is inherited, when available.

4357 4800 

4358### Example4801 - `principal_id: string`

4359 4802 

4360```http4803 - `principal_type: string`

4361curl https://api.openai.com/v1/projects/$PROJECT_ID/groups/$GROUP_ID/roles/$ROLE_ID \

4362 -X DELETE \

4363 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

4364```

4365 4804 

4366#### Response4805- `created_at: number`

4367 4806 

4368```json4807 When the role was created.

4369{

4370 "deleted": true,

4371 "object": "object"

4372}

4373```

4374 4808 

4375### Example4809- `created_by: string`

4810 

4811 Identifier of the actor who created the role.

4812 

4813- `created_by_user_obj: map[unknown]`

4814 

4815 User details for the actor that created the role, when available.

4816 

4817- `description: string`

4818 

4819 Description of the role.

4820 

4821- `metadata: map[unknown]`

4822 

4823 Arbitrary metadata stored on the role.

4824 

4825- `name: string`

4826 

4827 Name of the role.

4828 

4829- `permissions: array of string`

4830 

4831 Permissions associated with the role.

4832 

4833- `predefined_role: boolean`

4834 

4835 Whether the role is predefined by OpenAI.

4836 

4837- `resource_type: string`

4838 

4839 Resource type the role applies to.

4840 

4841- `updated_at: number`

4842 

4843 When the role was last updated.

4844 

4845### Example

4846 

4847```http

4848curl https://api.openai.com/v1/projects/$PROJECT_ID/groups/$GROUP_ID/roles/$ROLE_ID \

4849 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

4850```

4851 

4852#### Response

4853 

4854```json

4855{

4856 "id": "id",

4857 "assignment_sources": [

4858 {

4859 "principal_id": "principal_id",

4860 "principal_type": "principal_type"

4861 }

4862 ],

4863 "created_at": 0,

4864 "created_by": "created_by",

4865 "created_by_user_obj": {

4866 "foo": "bar"

4867 },

4868 "description": "description",

4869 "metadata": {

4870 "foo": "bar"

4871 },

4872 "name": "name",

4873 "permissions": [

4874 "string"

4875 ],

4876 "predefined_role": true,

4877 "resource_type": "resource_type",

4878 "updated_at": 0

4879}

4880```

4881 

4882### Example

4883 

4884```http

4885curl https://api.openai.com/v1/projects/proj_abc123/groups/group_01J1F8ABCDXYZ/roles/role_01J1F8PROJ \

4886 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

4887 -H "Content-Type: application/json"

4888```

4889 

4890#### Response

4891 

4892```json

4893{

4894 "id": "role_01J1F8PROJ",

4895 "name": "API Project Key Manager",

4896 "permissions": [

4897 "api.organization.projects.api_keys.read",

4898 "api.organization.projects.api_keys.write"

4899 ],

4900 "resource_type": "api.project",

4901 "predefined_role": false,

4902 "description": "Allows managing API keys for the project",

4903 "created_at": 1711471533,

4904 "updated_at": 1711472599,

4905 "created_by": "user_abc123",

4906 "created_by_user_obj": null,

4907 "metadata": {},

4908 "assignment_sources": null

4909}

4910```

4911 

4912## Unassign project role from group

4913 

4914**delete** `/projects/{project_id}/groups/{group_id}/roles/{role_id}`

4915 

4916Unassigns a project role from a group within a project.

4917 

4918### Path Parameters

4919 

4920- `project_id: string`

4921 

4922- `group_id: string`

4923 

4924- `role_id: string`

4925 

4926### Returns

4927 

4928- `deleted: boolean`

4929 

4930 Whether the assignment was removed.

4931 

4932- `object: string`

4933 

4934 Identifier for the deleted assignment, such as `group.role.deleted` or `user.role.deleted`.

4935 

4936### Example

4937 

4938```http

4939curl https://api.openai.com/v1/projects/$PROJECT_ID/groups/$GROUP_ID/roles/$ROLE_ID \

4940 -X DELETE \

4941 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

4942```

4943 

4944#### Response

4945 

4946```json

4947{

4948 "deleted": true,

4949 "object": "object"

4950}

4951```

4952 

4953### Example

4376 4954 

4377```http4955```http

4378curl -X DELETE https://api.openai.com/v1/projects/proj_abc123/groups/group_01J1F8ABCDXYZ/roles/role_01J1F8PROJ \4956curl -X DELETE https://api.openai.com/v1/projects/proj_abc123/groups/group_01J1F8ABCDXYZ/roles/role_01J1F8PROJ \


4393 4971 

4394### Role List Response4972### Role List Response

4395 4973 

4396- `RoleListResponse object { id, created_at, created_by, 8 more }`4974- `RoleListResponse object { id, assignment_sources, created_at, 9 more }`

4397 4975 

4398 Detailed information about a role assignment entry returned when listing assignments.4976 Detailed information about a role assignment entry returned when listing assignments.

4399 4977 


4401 4979 

4402 Identifier for the role.4980 Identifier for the role.

4403 4981 

4982 - `assignment_sources: array of object { principal_id, principal_type }`

4983 

4984 Principals from which the role assignment is inherited, when available.

4985 

4986 - `principal_id: string`

4987 

4988 - `principal_type: string`

4989 

4404 - `created_at: number`4990 - `created_at: number`

4405 4991 

4406 When the role was created.4992 When the role was created.


4513 5099 

4514 Resource type the role is bound to (for example `api.organization` or `api.project`).5100 Resource type the role is bound to (for example `api.organization` or `api.project`).

4515 5101 

5102### Role Retrieve Response

5103 

5104- `RoleRetrieveResponse object { id, assignment_sources, created_at, 9 more }`

5105 

5106 Detailed information about a role assignment entry returned when listing assignments.

5107 

5108 - `id: string`

5109 

5110 Identifier for the role.

5111 

5112 - `assignment_sources: array of object { principal_id, principal_type }`

5113 

5114 Principals from which the role assignment is inherited, when available.

5115 

5116 - `principal_id: string`

5117 

5118 - `principal_type: string`

5119 

5120 - `created_at: number`

5121 

5122 When the role was created.

5123 

5124 - `created_by: string`

5125 

5126 Identifier of the actor who created the role.

5127 

5128 - `created_by_user_obj: map[unknown]`

5129 

5130 User details for the actor that created the role, when available.

5131 

5132 - `description: string`

5133 

5134 Description of the role.

5135 

5136 - `metadata: map[unknown]`

5137 

5138 Arbitrary metadata stored on the role.

5139 

5140 - `name: string`

5141 

5142 Name of the role.

5143 

5144 - `permissions: array of string`

5145 

5146 Permissions associated with the role.

5147 

5148 - `predefined_role: boolean`

5149 

5150 Whether the role is predefined by OpenAI.

5151 

5152 - `resource_type: string`

5153 

5154 Resource type the role applies to.

5155 

5156 - `updated_at: number`

5157 

5158 When the role was last updated.

5159 

4516### Role Delete Response5160### Role Delete Response

4517 5161 

4518- `RoleDeleteResponse object { deleted, object }`5162- `RoleDeleteResponse object { deleted, object }`


4792}5436}

4793```5437```

4794 5438 

4795## Update project role5439## Retrieve project role

4796 5440 

4797**post** `/projects/{project_id}/roles/{role_id}`5441**get** `/projects/{project_id}/roles/{role_id}`

4798 5442 

4799Updates an existing project role.5443Retrieves a project role.

4800 5444 

4801### Path Parameters5445### Path Parameters

4802 5446 


4804 5448 

4805- `role_id: string`5449- `role_id: string`

4806 5450 

4807### Body Parameters

4808 

4809- `description: optional string`

4810 

4811 New description for the role.

4812 

4813- `permissions: optional array of string`

4814 

4815 Updated set of permissions for the role.

4816 

4817- `role_name: optional string`

4818 

4819 New name for the role.

4820 

4821### Returns5451### Returns

4822 5452 

4823- `Role object { id, description, name, 4 more }`5453- `Role object { id, description, name, 4 more }`


4858 5488 

4859```http5489```http

4860curl https://api.openai.com/v1/projects/$PROJECT_ID/roles/$ROLE_ID \5490curl https://api.openai.com/v1/projects/$PROJECT_ID/roles/$ROLE_ID \

4861 -H 'Content-Type: application/json' \5491 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

4862 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

4863 -d '{}'

4864```5492```

4865 5493 

4866#### Response5494#### Response


4882### Example5510### Example

4883 5511 

4884```http5512```http

4885curl -X POST https://api.openai.com/v1/projects/proj_abc123/roles/role_01J1F8PROJ \5513curl https://api.openai.com/v1/projects/proj_abc123/roles/role_01J1F8PROJ \

4886 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \5514 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

4887 -H "Content-Type: application/json" \5515 -H "Content-Type: application/json"

4888 -d '{

4889 "role_name": "API Project Key Manager",

4890 "permissions": [

4891 "api.organization.projects.api_keys.read",

4892 "api.organization.projects.api_keys.write"

4893 ],

4894 "description": "Allows managing API keys for the project"

4895 }'

4896```5516```

4897 5517 

4898#### Response5518#### Response


4912}5532}

4913```5533```

4914 5534 

4915## Delete project role5535## Update project role

4916 5536 

4917**delete** `/projects/{project_id}/roles/{role_id}`5537**post** `/projects/{project_id}/roles/{role_id}`

4918 5538 

4919Deletes a custom role from a project.5539Updates an existing project role.

4920 5540 

4921### Path Parameters5541### Path Parameters

4922 5542 


4924 5544 

4925- `role_id: string`5545- `role_id: string`

4926 5546 

4927### Returns5547### Body Parameters

4928 5548 

4929- `id: string`5549- `description: optional string`

4930 5550 

4931 Identifier of the deleted role.5551 New description for the role.

4932 5552 

4933- `deleted: boolean`5553- `permissions: optional array of string`

4934 5554 

4935 Whether the role was deleted.5555 Updated set of permissions for the role.

4936 5556 

4937- `object: "role.deleted"`5557- `role_name: optional string`

4938 5558 

4939 Always `role.deleted`.5559 New name for the role.

4940 5560 

4941 - `"role.deleted"`5561### Returns

4942 5562 

4943### Example5563- `Role object { id, description, name, 4 more }`

4944 5564 

4945```http5565 Details about a role that can be assigned through the public Roles API.

4946curl https://api.openai.com/v1/projects/$PROJECT_ID/roles/$ROLE_ID \

4947 -X DELETE \

4948 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

4949```

4950 5566 

4951#### Response5567 - `id: string`

4952 5568 

4953```json5569 Identifier for the role.

4954{5570 

4955 "id": "id",5571 - `description: string`

4956 "deleted": true,5572 

4957 "object": "role.deleted"5573 Optional description of the role.

5574 

5575 - `name: string`

5576 

5577 Unique name for the role.

5578 

5579 - `object: "role"`

5580 

5581 Always `role`.

5582 

5583 - `"role"`

5584 

5585 - `permissions: array of string`

5586 

5587 Permissions granted by the role.

5588 

5589 - `predefined_role: boolean`

5590 

5591 Whether the role is predefined and managed by OpenAI.

5592 

5593 - `resource_type: string`

5594 

5595 Resource type the role is bound to (for example `api.organization` or `api.project`).

5596 

5597### Example

5598 

5599```http

5600curl https://api.openai.com/v1/projects/$PROJECT_ID/roles/$ROLE_ID \

5601 -H 'Content-Type: application/json' \

5602 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

5603 -d '{}'

5604```

5605 

5606#### Response

5607 

5608```json

5609{

5610 "id": "id",

5611 "description": "description",

5612 "name": "name",

5613 "object": "role",

5614 "permissions": [

5615 "string"

5616 ],

5617 "predefined_role": true,

5618 "resource_type": "resource_type"

5619}

5620```

5621 

5622### Example

5623 

5624```http

5625curl -X POST https://api.openai.com/v1/projects/proj_abc123/roles/role_01J1F8PROJ \

5626 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

5627 -H "Content-Type: application/json" \

5628 -d '{

5629 "role_name": "API Project Key Manager",

5630 "permissions": [

5631 "api.organization.projects.api_keys.read",

5632 "api.organization.projects.api_keys.write"

5633 ],

5634 "description": "Allows managing API keys for the project"

5635 }'

5636```

5637 

5638#### Response

5639 

5640```json

5641{

5642 "object": "role",

5643 "id": "role_01J1F8PROJ",

5644 "name": "API Project Key Manager",

5645 "description": "Allows managing API keys for the project",

5646 "permissions": [

5647 "api.organization.projects.api_keys.read",

5648 "api.organization.projects.api_keys.write"

5649 ],

5650 "resource_type": "api.project",

5651 "predefined_role": false

5652}

5653```

5654 

5655## Delete project role

5656 

5657**delete** `/projects/{project_id}/roles/{role_id}`

5658 

5659Deletes a custom role from a project.

5660 

5661### Path Parameters

5662 

5663- `project_id: string`

5664 

5665- `role_id: string`

5666 

5667### Returns

5668 

5669- `id: string`

5670 

5671 Identifier of the deleted role.

5672 

5673- `deleted: boolean`

5674 

5675 Whether the role was deleted.

5676 

5677- `object: "role.deleted"`

5678 

5679 Always `role.deleted`.

5680 

5681 - `"role.deleted"`

5682 

5683### Example

5684 

5685```http

5686curl https://api.openai.com/v1/projects/$PROJECT_ID/roles/$ROLE_ID \

5687 -X DELETE \

5688 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

5689```

5690 

5691#### Response

5692 

5693```json

5694{

5695 "id": "id",

5696 "deleted": true,

5697 "object": "role.deleted"

4958}5698}

4959```5699```

4960 5700 


4998 5738 

4999 - `"role.deleted"`5739 - `"role.deleted"`

5000 5740 

5741# Data Retention

5742 

5743## Retrieve project data retention

5744 

5745**get** `/organization/projects/{project_id}/data_retention`

5746 

5747Retrieves project data retention controls.

5748 

5749### Path Parameters

5750 

5751- `project_id: string`

5752 

5753### Returns

5754 

5755- `ProjectDataRetention object { object, type }`

5756 

5757 Represents a project's data retention control setting.

5758 

5759 - `object: "project.data_retention"`

5760 

5761 The object type, which is always `project.data_retention`.

5762 

5763 - `"project.data_retention"`

5764 

5765 - `type: "organization_default" or "none" or "zero_data_retention" or 3 more`

5766 

5767 The configured project data retention type.

5768 

5769 - `"organization_default"`

5770 

5771 - `"none"`

5772 

5773 - `"zero_data_retention"`

5774 

5775 - `"modified_abuse_monitoring"`

5776 

5777 - `"enhanced_zero_data_retention"`

5778 

5779 - `"enhanced_modified_abuse_monitoring"`

5780 

5781### Example

5782 

5783```http

5784curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/data_retention \

5785 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

5786```

5787 

5788#### Response

5789 

5790```json

5791{

5792 "object": "project.data_retention",

5793 "type": "organization_default"

5794}

5795```

5796 

5797### Example

5798 

5799```http

5800curl https://api.openai.com/v1/organization/projects/proj_abc/data_retention \

5801 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

5802 -H "Content-Type: application/json"

5803```

5804 

5805#### Response

5806 

5807```json

5808{

5809 "object": "project.data_retention",

5810 "type": "organization_default"

5811}

5812```

5813 

5814## Update project data retention

5815 

5816**post** `/organization/projects/{project_id}/data_retention`

5817 

5818Updates project data retention controls.

5819 

5820### Path Parameters

5821 

5822- `project_id: string`

5823 

5824### Body Parameters

5825 

5826- `retention_type: "organization_default" or "none" or "zero_data_retention" or 3 more`

5827 

5828 The desired project data retention type.

5829 

5830 - `"organization_default"`

5831 

5832 - `"none"`

5833 

5834 - `"zero_data_retention"`

5835 

5836 - `"modified_abuse_monitoring"`

5837 

5838 - `"enhanced_zero_data_retention"`

5839 

5840 - `"enhanced_modified_abuse_monitoring"`

5841 

5842### Returns

5843 

5844- `ProjectDataRetention object { object, type }`

5845 

5846 Represents a project's data retention control setting.

5847 

5848 - `object: "project.data_retention"`

5849 

5850 The object type, which is always `project.data_retention`.

5851 

5852 - `"project.data_retention"`

5853 

5854 - `type: "organization_default" or "none" or "zero_data_retention" or 3 more`

5855 

5856 The configured project data retention type.

5857 

5858 - `"organization_default"`

5859 

5860 - `"none"`

5861 

5862 - `"zero_data_retention"`

5863 

5864 - `"modified_abuse_monitoring"`

5865 

5866 - `"enhanced_zero_data_retention"`

5867 

5868 - `"enhanced_modified_abuse_monitoring"`

5869 

5870### Example

5871 

5872```http

5873curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/data_retention \

5874 -H 'Content-Type: application/json' \

5875 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

5876 -d '{

5877 "retention_type": "organization_default"

5878 }'

5879```

5880 

5881#### Response

5882 

5883```json

5884{

5885 "object": "project.data_retention",

5886 "type": "organization_default"

5887}

5888```

5889 

5890### Example

5891 

5892```http

5893curl -X POST https://api.openai.com/v1/organization/projects/proj_abc/data_retention \

5894 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

5895 -H "Content-Type: application/json" \

5896 -d '{

5897 "retention_type": "modified_abuse_monitoring"

5898 }'

5899```

5900 

5901#### Response

5902 

5903```json

5904{

5905 "object": "project.data_retention",

5906 "type": "modified_abuse_monitoring"

5907}

5908```

5909 

5910## Domain Types

5911 

5912### Project Data Retention

5913 

5914- `ProjectDataRetention object { object, type }`

5915 

5916 Represents a project's data retention control setting.

5917 

5918 - `object: "project.data_retention"`

5919 

5920 The object type, which is always `project.data_retention`.

5921 

5922 - `"project.data_retention"`

5923 

5924 - `type: "organization_default" or "none" or "zero_data_retention" or 3 more`

5925 

5926 The configured project data retention type.

5927 

5928 - `"organization_default"`

5929 

5930 - `"none"`

5931 

5932 - `"zero_data_retention"`

5933 

5934 - `"modified_abuse_monitoring"`

5935 

5936 - `"enhanced_zero_data_retention"`

5937 

5938 - `"enhanced_modified_abuse_monitoring"`

5939 

5940# Spend Alerts

5941 

5942## List project spend alerts

5943 

5944**get** `/organization/projects/{project_id}/spend_alerts`

5945 

5946Lists project spend alerts.

5947 

5948### Path Parameters

5949 

5950- `project_id: string`

5951 

5952### Query Parameters

5953 

5954- `after: optional string`

5955 

5956 Cursor for pagination. Provide the ID of the last spend alert from the previous response to fetch the next page.

5957 

5958- `before: optional string`

5959 

5960 Cursor for pagination. Provide the ID of the first spend alert from the previous response to fetch the previous page.

5961 

5962- `limit: optional number`

5963 

5964 A limit on the number of spend alerts to return. Defaults to 20.

5965 

5966- `order: optional "asc" or "desc"`

5967 

5968 Sort order for the returned spend alerts.

5969 

5970 - `"asc"`

5971 

5972 - `"desc"`

5973 

5974### Returns

5975 

5976- `data: array of ProjectSpendAlert`

5977 

5978 Spend alerts returned in the current page.

5979 

5980 - `id: string`

5981 

5982 The identifier, which can be referenced in API endpoints.

5983 

5984 - `currency: "USD"`

5985 

5986 The currency for the threshold amount.

5987 

5988 - `"USD"`

5989 

5990 - `interval: "month"`

5991 

5992 The time interval for evaluating spend against the threshold.

5993 

5994 - `"month"`

5995 

5996 - `notification_channel: object { recipients, type, subject_prefix }`

5997 

5998 Email notification settings for a spend alert.

5999 

6000 - `recipients: array of string`

6001 

6002 Email addresses that receive the spend alert notification.

6003 

6004 - `type: "email"`

6005 

6006 The notification channel type. Currently only `email` is supported.

6007 

6008 - `"email"`

6009 

6010 - `subject_prefix: optional string`

6011 

6012 Optional subject prefix for alert emails.

6013 

6014 - `object: "project.spend_alert"`

6015 

6016 The object type, which is always `project.spend_alert`.

6017 

6018 - `"project.spend_alert"`

6019 

6020 - `threshold_amount: number`

6021 

6022 The alert threshold amount, in cents.

6023 

6024- `first_id: string`

6025 

6026 The ID of the first spend alert in this page.

6027 

6028- `has_more: boolean`

6029 

6030 Whether more spend alerts are available when paginating.

6031 

6032- `last_id: string`

6033 

6034 The ID of the last spend alert in this page.

6035 

6036- `object: "list"`

6037 

6038 Always `list`.

6039 

6040 - `"list"`

6041 

6042### Example

6043 

6044```http

6045curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/spend_alerts \

6046 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

6047```

6048 

6049#### Response

6050 

6051```json

6052{

6053 "data": [

6054 {

6055 "id": "id",

6056 "currency": "USD",

6057 "interval": "month",

6058 "notification_channel": {

6059 "recipients": [

6060 "string"

6061 ],

6062 "type": "email",

6063 "subject_prefix": "subject_prefix"

6064 },

6065 "object": "project.spend_alert",

6066 "threshold_amount": 0

6067 }

6068 ],

6069 "first_id": "first_id",

6070 "has_more": true,

6071 "last_id": "last_id",

6072 "object": "list"

6073}

6074```

6075 

6076### Example

6077 

6078```http

6079curl https://api.openai.com/v1/organization/projects/proj_abc/spend_alerts?limit=20&order=asc \

6080 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

6081 -H "Content-Type: application/json"

6082```

6083 

6084#### Response

6085 

6086```json

6087{

6088 "object": "list",

6089 "data": [

6090 {

6091 "id": "alert_abc123",

6092 "object": "project.spend_alert",

6093 "threshold_amount": 100000,

6094 "currency": "USD",

6095 "interval": "month",

6096 "notification_channel": {

6097 "type": "email",

6098 "recipients": ["finance@example.com"],

6099 "subject_prefix": "OpenAI spend alert"

6100 }

6101 }

6102 ],

6103 "first_id": "alert_abc123",

6104 "last_id": "alert_abc123",

6105 "has_more": false

6106}

6107```

6108 

6109## Create project spend alert

6110 

6111**post** `/organization/projects/{project_id}/spend_alerts`

6112 

6113Creates a project spend alert.

6114 

6115### Path Parameters

6116 

6117- `project_id: string`

6118 

6119### Body Parameters

6120 

6121- `currency: "USD"`

6122 

6123 The currency for the threshold amount.

6124 

6125 - `"USD"`

6126 

6127- `interval: "month"`

6128 

6129 The time interval for evaluating spend against the threshold.

6130 

6131 - `"month"`

6132 

6133- `notification_channel: object { recipients, type, subject_prefix }`

6134 

6135 Email notification settings for a spend alert.

6136 

6137 - `recipients: array of string`

6138 

6139 Email addresses that receive the spend alert notification.

6140 

6141 - `type: "email"`

6142 

6143 The notification channel type. Currently only `email` is supported.

6144 

6145 - `"email"`

6146 

6147 - `subject_prefix: optional string`

6148 

6149 Optional subject prefix for alert emails.

6150 

6151- `threshold_amount: number`

6152 

6153 The alert threshold amount, in cents.

6154 

6155### Returns

6156 

6157- `ProjectSpendAlert object { id, currency, interval, 3 more }`

6158 

6159 Represents a spend alert configured at the project level.

6160 

6161 - `id: string`

6162 

6163 The identifier, which can be referenced in API endpoints.

6164 

6165 - `currency: "USD"`

6166 

6167 The currency for the threshold amount.

6168 

6169 - `"USD"`

6170 

6171 - `interval: "month"`

6172 

6173 The time interval for evaluating spend against the threshold.

6174 

6175 - `"month"`

6176 

6177 - `notification_channel: object { recipients, type, subject_prefix }`

6178 

6179 Email notification settings for a spend alert.

6180 

6181 - `recipients: array of string`

6182 

6183 Email addresses that receive the spend alert notification.

6184 

6185 - `type: "email"`

6186 

6187 The notification channel type. Currently only `email` is supported.

6188 

6189 - `"email"`

6190 

6191 - `subject_prefix: optional string`

6192 

6193 Optional subject prefix for alert emails.

6194 

6195 - `object: "project.spend_alert"`

6196 

6197 The object type, which is always `project.spend_alert`.

6198 

6199 - `"project.spend_alert"`

6200 

6201 - `threshold_amount: number`

6202 

6203 The alert threshold amount, in cents.

6204 

6205### Example

6206 

6207```http

6208curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/spend_alerts \

6209 -H 'Content-Type: application/json' \

6210 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

6211 -d '{

6212 "currency": "USD",

6213 "interval": "month",

6214 "notification_channel": {

6215 "recipients": [

6216 "string"

6217 ],

6218 "type": "email"

6219 },

6220 "threshold_amount": 0

6221 }'

6222```

6223 

6224#### Response

6225 

6226```json

6227{

6228 "id": "id",

6229 "currency": "USD",

6230 "interval": "month",

6231 "notification_channel": {

6232 "recipients": [

6233 "string"

6234 ],

6235 "type": "email",

6236 "subject_prefix": "subject_prefix"

6237 },

6238 "object": "project.spend_alert",

6239 "threshold_amount": 0

6240}

6241```

6242 

6243### Example

6244 

6245```http

6246curl -X POST https://api.openai.com/v1/organization/projects/proj_abc/spend_alerts \

6247 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

6248 -H "Content-Type: application/json" \

6249 -d '{

6250 "threshold_amount": 100000,

6251 "currency": "USD",

6252 "interval": "month",

6253 "notification_channel": {

6254 "type": "email",

6255 "recipients": ["finance@example.com"],

6256 "subject_prefix": "OpenAI spend alert"

6257 }

6258 }'

6259```

6260 

6261#### Response

6262 

6263```json

6264{

6265 "id": "alert_abc123",

6266 "object": "project.spend_alert",

6267 "threshold_amount": 100000,

6268 "currency": "USD",

6269 "interval": "month",

6270 "notification_channel": {

6271 "type": "email",

6272 "recipients": ["finance@example.com"],

6273 "subject_prefix": "OpenAI spend alert"

6274 }

6275}

6276```

6277 

6278## Update project spend alert

6279 

6280**post** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

6281 

6282Updates a project spend alert.

6283 

6284### Path Parameters

6285 

6286- `project_id: string`

6287 

6288- `alert_id: string`

6289 

6290### Body Parameters

6291 

6292- `currency: "USD"`

6293 

6294 The currency for the threshold amount.

6295 

6296 - `"USD"`

6297 

6298- `interval: "month"`

6299 

6300 The time interval for evaluating spend against the threshold.

6301 

6302 - `"month"`

6303 

6304- `notification_channel: object { recipients, type, subject_prefix }`

6305 

6306 Email notification settings for a spend alert.

6307 

6308 - `recipients: array of string`

6309 

6310 Email addresses that receive the spend alert notification.

6311 

6312 - `type: "email"`

6313 

6314 The notification channel type. Currently only `email` is supported.

6315 

6316 - `"email"`

6317 

6318 - `subject_prefix: optional string`

6319 

6320 Optional subject prefix for alert emails.

6321 

6322- `threshold_amount: number`

6323 

6324 The alert threshold amount, in cents.

6325 

6326### Returns

6327 

6328- `ProjectSpendAlert object { id, currency, interval, 3 more }`

6329 

6330 Represents a spend alert configured at the project level.

6331 

6332 - `id: string`

6333 

6334 The identifier, which can be referenced in API endpoints.

6335 

6336 - `currency: "USD"`

6337 

6338 The currency for the threshold amount.

6339 

6340 - `"USD"`

6341 

6342 - `interval: "month"`

6343 

6344 The time interval for evaluating spend against the threshold.

6345 

6346 - `"month"`

6347 

6348 - `notification_channel: object { recipients, type, subject_prefix }`

6349 

6350 Email notification settings for a spend alert.

6351 

6352 - `recipients: array of string`

6353 

6354 Email addresses that receive the spend alert notification.

6355 

6356 - `type: "email"`

6357 

6358 The notification channel type. Currently only `email` is supported.

6359 

6360 - `"email"`

6361 

6362 - `subject_prefix: optional string`

6363 

6364 Optional subject prefix for alert emails.

6365 

6366 - `object: "project.spend_alert"`

6367 

6368 The object type, which is always `project.spend_alert`.

6369 

6370 - `"project.spend_alert"`

6371 

6372 - `threshold_amount: number`

6373 

6374 The alert threshold amount, in cents.

6375 

6376### Example

6377 

6378```http

6379curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/spend_alerts/$ALERT_ID \

6380 -H 'Content-Type: application/json' \

6381 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

6382 -d '{

6383 "currency": "USD",

6384 "interval": "month",

6385 "notification_channel": {

6386 "recipients": [

6387 "string"

6388 ],

6389 "type": "email"

6390 },

6391 "threshold_amount": 0

6392 }'

6393```

6394 

6395#### Response

6396 

6397```json

6398{

6399 "id": "id",

6400 "currency": "USD",

6401 "interval": "month",

6402 "notification_channel": {

6403 "recipients": [

6404 "string"

6405 ],

6406 "type": "email",

6407 "subject_prefix": "subject_prefix"

6408 },

6409 "object": "project.spend_alert",

6410 "threshold_amount": 0

6411}

6412```

6413 

6414### Example

6415 

6416```http

6417curl -X POST https://api.openai.com/v1/organization/projects/proj_abc/spend_alerts/alert_abc123 \

6418 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

6419 -H "Content-Type: application/json" \

6420 -d '{

6421 "threshold_amount": 150000,

6422 "currency": "USD",

6423 "interval": "month",

6424 "notification_channel": {

6425 "type": "email",

6426 "recipients": ["finance@example.com"],

6427 "subject_prefix": "OpenAI spend alert"

6428 }

6429 }'

6430```

6431 

6432#### Response

6433 

6434```json

6435{

6436 "id": "alert_abc123",

6437 "object": "project.spend_alert",

6438 "threshold_amount": 150000,

6439 "currency": "USD",

6440 "interval": "month",

6441 "notification_channel": {

6442 "type": "email",

6443 "recipients": ["finance@example.com"],

6444 "subject_prefix": "OpenAI spend alert"

6445 }

6446}

6447```

6448 

6449## Delete project spend alert

6450 

6451**delete** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

6452 

6453Deletes a project spend alert.

6454 

6455### Path Parameters

6456 

6457- `project_id: string`

6458 

6459- `alert_id: string`

6460 

6461### Returns

6462 

6463- `ProjectSpendAlertDeleted object { id, deleted, object }`

6464 

6465 Confirmation payload returned after deleting a project spend alert.

6466 

6467 - `id: string`

6468 

6469 The deleted spend alert ID.

6470 

6471 - `deleted: boolean`

6472 

6473 Whether the spend alert was deleted.

6474 

6475 - `object: "project.spend_alert.deleted"`

6476 

6477 Always `project.spend_alert.deleted`.

6478 

6479 - `"project.spend_alert.deleted"`

6480 

6481### Example

6482 

6483```http

6484curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/spend_alerts/$ALERT_ID \

6485 -X DELETE \

6486 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

6487```

6488 

6489#### Response

6490 

6491```json

6492{

6493 "id": "id",

6494 "deleted": true,

6495 "object": "project.spend_alert.deleted"

6496}

6497```

6498 

6499### Example

6500 

6501```http

6502curl -X DELETE https://api.openai.com/v1/organization/projects/proj_abc/spend_alerts/alert_abc123 \

6503 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

6504 -H "Content-Type: application/json"

6505```

6506 

6507#### Response

6508 

6509```json

6510{

6511 "id": "alert_abc123",

6512 "object": "project.spend_alert.deleted",

6513 "deleted": true

6514}

6515```

6516 

6517## Domain Types

6518 

6519### Project Spend Alert

6520 

6521- `ProjectSpendAlert object { id, currency, interval, 3 more }`

6522 

6523 Represents a spend alert configured at the project level.

6524 

6525 - `id: string`

6526 

6527 The identifier, which can be referenced in API endpoints.

6528 

6529 - `currency: "USD"`

6530 

6531 The currency for the threshold amount.

6532 

6533 - `"USD"`

6534 

6535 - `interval: "month"`

6536 

6537 The time interval for evaluating spend against the threshold.

6538 

6539 - `"month"`

6540 

6541 - `notification_channel: object { recipients, type, subject_prefix }`

6542 

6543 Email notification settings for a spend alert.

6544 

6545 - `recipients: array of string`

6546 

6547 Email addresses that receive the spend alert notification.

6548 

6549 - `type: "email"`

6550 

6551 The notification channel type. Currently only `email` is supported.

6552 

6553 - `"email"`

6554 

6555 - `subject_prefix: optional string`

6556 

6557 Optional subject prefix for alert emails.

6558 

6559 - `object: "project.spend_alert"`

6560 

6561 The object type, which is always `project.spend_alert`.

6562 

6563 - `"project.spend_alert"`

6564 

6565 - `threshold_amount: number`

6566 

6567 The alert threshold amount, in cents.

6568 

6569### Project Spend Alert Deleted

6570 

6571- `ProjectSpendAlertDeleted object { id, deleted, object }`

6572 

6573 Confirmation payload returned after deleting a project spend alert.

6574 

6575 - `id: string`

6576 

6577 The deleted spend alert ID.

6578 

6579 - `deleted: boolean`

6580 

6581 Whether the spend alert was deleted.

6582 

6583 - `object: "project.spend_alert.deleted"`

6584 

6585 Always `project.spend_alert.deleted`.

6586 

6587 - `"project.spend_alert.deleted"`

6588 

5001# Certificates6589# Certificates

5002 6590 

5003## List project certificates6591## List project certificates

Details

46 46 

47 Display name of the group.47 Display name of the group.

48 48 

49 - `group_type: string`49 - `group_type: "group" or "tenant_group"`

50 50 

51 The type of the group.51 The type of the group.

52 52 

53 - `"group"`

54 

55 - `"tenant_group"`

56 

53 - `object: "project.group"`57 - `object: "project.group"`

54 58 

55 Always `project.group`.59 Always `project.group`.


90 "created_at": 0,94 "created_at": 0,

91 "group_id": "group_id",95 "group_id": "group_id",

92 "group_name": "group_name",96 "group_name": "group_name",

93 "group_type": "group_type",97 "group_type": "group",

94 "object": "project.group",98 "object": "project.group",

95 "project_id": "project_id"99 "project_id": "project_id"

96 }100 }


166 170 

167 Display name of the group.171 Display name of the group.

168 172 

169 - `group_type: string`173 - `group_type: "group" or "tenant_group"`

170 174 

171 The type of the group.175 The type of the group.

172 176 

177 - `"group"`

178 

179 - `"tenant_group"`

180 

173 - `object: "project.group"`181 - `object: "project.group"`

174 182 

175 Always `project.group`.183 Always `project.group`.


199 "created_at": 0,207 "created_at": 0,

200 "group_id": "group_id",208 "group_id": "group_id",

201 "group_name": "group_name",209 "group_name": "group_name",

202 "group_type": "group_type",210 "group_type": "group",

203 "object": "project.group",211 "object": "project.group",

204 "project_id": "project_id"212 "project_id": "project_id"

205}213}


229}237}

230```238```

231 239 

240## Retrieve project group

241 

242**get** `/organization/projects/{project_id}/groups/{group_id}`

243 

244Retrieves a project's group.

245 

246### Path Parameters

247 

248- `project_id: string`

249 

250- `group_id: string`

251 

252### Query Parameters

253 

254- `group_type: optional "group" or "tenant_group"`

255 

256 The type of group to retrieve.

257 

258 - `"group"`

259 

260 - `"tenant_group"`

261 

262### Returns

263 

264- `ProjectGroup object { created_at, group_id, group_name, 3 more }`

265 

266 Details about a group's membership in a project.

267 

268 - `created_at: number`

269 

270 Unix timestamp (in seconds) when the group was granted project access.

271 

272 - `group_id: string`

273 

274 Identifier of the group that has access to the project.

275 

276 - `group_name: string`

277 

278 Display name of the group.

279 

280 - `group_type: "group" or "tenant_group"`

281 

282 The type of the group.

283 

284 - `"group"`

285 

286 - `"tenant_group"`

287 

288 - `object: "project.group"`

289 

290 Always `project.group`.

291 

292 - `"project.group"`

293 

294 - `project_id: string`

295 

296 Identifier of the project.

297 

298### Example

299 

300```http

301curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/groups/$GROUP_ID \

302 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

303```

304 

305#### Response

306 

307```json

308{

309 "created_at": 0,

310 "group_id": "group_id",

311 "group_name": "group_name",

312 "group_type": "group",

313 "object": "project.group",

314 "project_id": "project_id"

315}

316```

317 

318### Example

319 

320```http

321curl https://api.openai.com/v1/organization/projects/proj_abc123/groups/group_01J1F8ABCDXYZ \

322 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

323 -H "Content-Type: application/json"

324```

325 

326#### Response

327 

328```json

329{

330 "object": "project.group",

331 "project_id": "proj_abc123",

332 "group_id": "group_01J1F8ABCDXYZ",

333 "group_name": "Support Team",

334 "group_type": "group",

335 "created_at": 1711471533

336}

337```

338 

232## Remove project group339## Remove project group

233 340 

234**delete** `/organization/projects/{project_id}/groups/{group_id}`341**delete** `/organization/projects/{project_id}/groups/{group_id}`


307 414 

308 Display name of the group.415 Display name of the group.

309 416 

310 - `group_type: string`417 - `group_type: "group" or "tenant_group"`

311 418 

312 The type of the group.419 The type of the group.

313 420 

421 - `"group"`

422 

423 - `"tenant_group"`

424 

314 - `object: "project.group"`425 - `object: "project.group"`

315 426 

316 Always `project.group`.427 Always `project.group`.


371 482 

372### Returns483### Returns

373 484 

374- `data: array of object { id, created_at, created_by, 8 more }`485- `data: array of object { id, assignment_sources, created_at, 9 more }`

375 486 

376 Role assignments returned in the current page.487 Role assignments returned in the current page.

377 488 


379 490 

380 Identifier for the role.491 Identifier for the role.

381 492 

493 - `assignment_sources: array of object { principal_id, principal_type }`

494 

495 Principals from which the role assignment is inherited, when available.

496 

497 - `principal_id: string`

498 

499 - `principal_type: string`

500 

382 - `created_at: number`501 - `created_at: number`

383 502 

384 When the role was created.503 When the role was created.


447 "data": [566 "data": [

448 {567 {

449 "id": "id",568 "id": "id",

569 "assignment_sources": [

570 {

571 "principal_id": "principal_id",

572 "principal_type": "principal_type"

573 }

574 ],

450 "created_at": 0,575 "created_at": 0,

451 "created_by": "created_by",576 "created_by": "created_by",

452 "created_by_user_obj": {577 "created_by_user_obj": {


672}797}

673```798```

674 799 

800## Retrieve project group role

801 

802**get** `/projects/{project_id}/groups/{group_id}/roles/{role_id}`

803 

804Retrieves a project role assigned to a group.

805 

806### Path Parameters

807 

808- `project_id: string`

809 

810- `group_id: string`

811 

812- `role_id: string`

813 

814### Returns

815 

816- `id: string`

817 

818 Identifier for the role.

819 

820- `assignment_sources: array of object { principal_id, principal_type }`

821 

822 Principals from which the role assignment is inherited, when available.

823 

824 - `principal_id: string`

825 

826 - `principal_type: string`

827 

828- `created_at: number`

829 

830 When the role was created.

831 

832- `created_by: string`

833 

834 Identifier of the actor who created the role.

835 

836- `created_by_user_obj: map[unknown]`

837 

838 User details for the actor that created the role, when available.

839 

840- `description: string`

841 

842 Description of the role.

843 

844- `metadata: map[unknown]`

845 

846 Arbitrary metadata stored on the role.

847 

848- `name: string`

849 

850 Name of the role.

851 

852- `permissions: array of string`

853 

854 Permissions associated with the role.

855 

856- `predefined_role: boolean`

857 

858 Whether the role is predefined by OpenAI.

859 

860- `resource_type: string`

861 

862 Resource type the role applies to.

863 

864- `updated_at: number`

865 

866 When the role was last updated.

867 

868### Example

869 

870```http

871curl https://api.openai.com/v1/projects/$PROJECT_ID/groups/$GROUP_ID/roles/$ROLE_ID \

872 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

873```

874 

875#### Response

876 

877```json

878{

879 "id": "id",

880 "assignment_sources": [

881 {

882 "principal_id": "principal_id",

883 "principal_type": "principal_type"

884 }

885 ],

886 "created_at": 0,

887 "created_by": "created_by",

888 "created_by_user_obj": {

889 "foo": "bar"

890 },

891 "description": "description",

892 "metadata": {

893 "foo": "bar"

894 },

895 "name": "name",

896 "permissions": [

897 "string"

898 ],

899 "predefined_role": true,

900 "resource_type": "resource_type",

901 "updated_at": 0

902}

903```

904 

905### Example

906 

907```http

908curl https://api.openai.com/v1/projects/proj_abc123/groups/group_01J1F8ABCDXYZ/roles/role_01J1F8PROJ \

909 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

910 -H "Content-Type: application/json"

911```

912 

913#### Response

914 

915```json

916{

917 "id": "role_01J1F8PROJ",

918 "name": "API Project Key Manager",

919 "permissions": [

920 "api.organization.projects.api_keys.read",

921 "api.organization.projects.api_keys.write"

922 ],

923 "resource_type": "api.project",

924 "predefined_role": false,

925 "description": "Allows managing API keys for the project",

926 "created_at": 1711471533,

927 "updated_at": 1711472599,

928 "created_by": "user_abc123",

929 "created_by_user_obj": null,

930 "metadata": {},

931 "assignment_sources": null

932}

933```

934 

675## Unassign project role from group935## Unassign project role from group

676 936 

677**delete** `/projects/{project_id}/groups/{group_id}/roles/{role_id}`937**delete** `/projects/{project_id}/groups/{group_id}/roles/{role_id}`


734 994 

735### Role List Response995### Role List Response

736 996 

737- `RoleListResponse object { id, created_at, created_by, 8 more }`997- `RoleListResponse object { id, assignment_sources, created_at, 9 more }`

738 998 

739 Detailed information about a role assignment entry returned when listing assignments.999 Detailed information about a role assignment entry returned when listing assignments.

740 1000 


742 1002 

743 Identifier for the role.1003 Identifier for the role.

744 1004 

1005 - `assignment_sources: array of object { principal_id, principal_type }`

1006 

1007 Principals from which the role assignment is inherited, when available.

1008 

1009 - `principal_id: string`

1010 

1011 - `principal_type: string`

1012 

745 - `created_at: number`1013 - `created_at: number`

746 1014 

747 When the role was created.1015 When the role was created.


854 1122 

855 Resource type the role is bound to (for example `api.organization` or `api.project`).1123 Resource type the role is bound to (for example `api.organization` or `api.project`).

856 1124 

1125### Role Retrieve Response

1126 

1127- `RoleRetrieveResponse object { id, assignment_sources, created_at, 9 more }`

1128 

1129 Detailed information about a role assignment entry returned when listing assignments.

1130 

1131 - `id: string`

1132 

1133 Identifier for the role.

1134 

1135 - `assignment_sources: array of object { principal_id, principal_type }`

1136 

1137 Principals from which the role assignment is inherited, when available.

1138 

1139 - `principal_id: string`

1140 

1141 - `principal_type: string`

1142 

1143 - `created_at: number`

1144 

1145 When the role was created.

1146 

1147 - `created_by: string`

1148 

1149 Identifier of the actor who created the role.

1150 

1151 - `created_by_user_obj: map[unknown]`

1152 

1153 User details for the actor that created the role, when available.

1154 

1155 - `description: string`

1156 

1157 Description of the role.

1158 

1159 - `metadata: map[unknown]`

1160 

1161 Arbitrary metadata stored on the role.

1162 

1163 - `name: string`

1164 

1165 Name of the role.

1166 

1167 - `permissions: array of string`

1168 

1169 Permissions associated with the role.

1170 

1171 - `predefined_role: boolean`

1172 

1173 Whether the role is predefined by OpenAI.

1174 

1175 - `resource_type: string`

1176 

1177 Resource type the role applies to.

1178 

1179 - `updated_at: number`

1180 

1181 When the role was last updated.

1182 

857### Role Delete Response1183### Role Delete Response

858 1184 

859- `RoleDeleteResponse object { deleted, object }`1185- `RoleDeleteResponse object { deleted, object }`

Details

44 44 

45 Display name of the group.45 Display name of the group.

46 46 

47 - `group_type: string`47 - `group_type: "group" or "tenant_group"`

48 48 

49 The type of the group.49 The type of the group.

50 50 

51 - `"group"`

52 

53 - `"tenant_group"`

54 

51 - `object: "project.group"`55 - `object: "project.group"`

52 56 

53 Always `project.group`.57 Always `project.group`.


88 "created_at": 0,92 "created_at": 0,

89 "group_id": "group_id",93 "group_id": "group_id",

90 "group_name": "group_name",94 "group_name": "group_name",

91 "group_type": "group_type",95 "group_type": "group",

92 "object": "project.group",96 "object": "project.group",

93 "project_id": "project_id"97 "project_id": "project_id"

94 }98 }

Details

30 30 

31### Returns31### Returns

32 32 

33- `data: array of object { id, created_at, created_by, 8 more }`33- `data: array of object { id, assignment_sources, created_at, 9 more }`

34 34 

35 Role assignments returned in the current page.35 Role assignments returned in the current page.

36 36 


38 38 

39 Identifier for the role.39 Identifier for the role.

40 40 

41 - `assignment_sources: array of object { principal_id, principal_type }`

42 

43 Principals from which the role assignment is inherited, when available.

44 

45 - `principal_id: string`

46 

47 - `principal_type: string`

48 

41 - `created_at: number`49 - `created_at: number`

42 50 

43 When the role was created.51 When the role was created.


106 "data": [114 "data": [

107 {115 {

108 "id": "id",116 "id": "id",

117 "assignment_sources": [

118 {

119 "principal_id": "principal_id",

120 "principal_type": "principal_type"

121 }

122 ],

109 "created_at": 0,123 "created_at": 0,

110 "created_by": "created_by",124 "created_by": "created_by",

111 "created_by_user_obj": {125 "created_by_user_obj": {

Details

308}308}

309```309```

310 310 

311## Update project service account

312 

313**post** `/organization/projects/{project_id}/service_accounts/{service_account_id}`

314 

315Updates a service account in the project.

316 

317### Path Parameters

318 

319- `project_id: string`

320 

321- `service_account_id: string`

322 

323### Body Parameters

324 

325- `name: optional string`

326 

327 The updated service account name.

328 

329- `role: optional "member" or "owner"`

330 

331 The updated service account role.

332 

333 - `"member"`

334 

335 - `"owner"`

336 

337### Returns

338 

339- `ProjectServiceAccount object { id, created_at, name, 2 more }`

340 

341 Represents an individual service account in a project.

342 

343 - `id: string`

344 

345 The identifier, which can be referenced in API endpoints

346 

347 - `created_at: number`

348 

349 The Unix timestamp (in seconds) of when the service account was created

350 

351 - `name: string`

352 

353 The name of the service account

354 

355 - `object: "organization.project.service_account"`

356 

357 The object type, which is always `organization.project.service_account`

358 

359 - `"organization.project.service_account"`

360 

361 - `role: "owner" or "member"`

362 

363 `owner` or `member`

364 

365 - `"owner"`

366 

367 - `"member"`

368 

369### Example

370 

371```http

372curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/service_accounts/$SERVICE_ACCOUNT_ID \

373 -H 'Content-Type: application/json' \

374 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

375 -d '{}'

376```

377 

378#### Response

379 

380```json

381{

382 "id": "id",

383 "created_at": 0,

384 "name": "name",

385 "object": "organization.project.service_account",

386 "role": "owner"

387}

388```

389 

390### Example

391 

392```http

393curl -X POST https://api.openai.com/v1/organization/projects/proj_abc/service_accounts/svc_acct_abc \

394 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

395 -H "Content-Type: application/json" \

396 -d '{

397 "name": "Updated service account",

398 "role": "member"

399 }'

400```

401 

402#### Response

403 

404```json

405{

406 "object": "organization.project.service_account",

407 "id": "svc_acct_abc",

408 "name": "Updated service account",

409 "role": "member",

410 "created_at": 1711471533

411}

412```

413 

311## Delete project service account414## Delete project service account

312 415 

313**delete** `/organization/projects/{project_id}/service_accounts/{service_account_id}`416**delete** `/organization/projects/{project_id}/service_accounts/{service_account_id}`

Details

541 541 

542### Returns542### Returns

543 543 

544- `data: array of object { id, created_at, created_by, 8 more }`544- `data: array of object { id, assignment_sources, created_at, 9 more }`

545 545 

546 Role assignments returned in the current page.546 Role assignments returned in the current page.

547 547 


549 549 

550 Identifier for the role.550 Identifier for the role.

551 551 

552 - `assignment_sources: array of object { principal_id, principal_type }`

553 

554 Principals from which the role assignment is inherited, when available.

555 

556 - `principal_id: string`

557 

558 - `principal_type: string`

559 

552 - `created_at: number`560 - `created_at: number`

553 561 

554 When the role was created.562 When the role was created.


617 "data": [625 "data": [

618 {626 {

619 "id": "id",627 "id": "id",

628 "assignment_sources": [

629 {

630 "principal_id": "principal_id",

631 "principal_type": "principal_type"

632 }

633 ],

620 "created_at": 0,634 "created_at": 0,

621 "created_by": "created_by",635 "created_by": "created_by",

622 "created_by_user_obj": {636 "created_by_user_obj": {


946}960}

947```961```

948 962 

963## Retrieve project user role

964 

965**get** `/projects/{project_id}/users/{user_id}/roles/{role_id}`

966 

967Retrieves a project role assigned to a user.

968 

969### Path Parameters

970 

971- `project_id: string`

972 

973- `user_id: string`

974 

975- `role_id: string`

976 

977### Returns

978 

979- `id: string`

980 

981 Identifier for the role.

982 

983- `assignment_sources: array of object { principal_id, principal_type }`

984 

985 Principals from which the role assignment is inherited, when available.

986 

987 - `principal_id: string`

988 

989 - `principal_type: string`

990 

991- `created_at: number`

992 

993 When the role was created.

994 

995- `created_by: string`

996 

997 Identifier of the actor who created the role.

998 

999- `created_by_user_obj: map[unknown]`

1000 

1001 User details for the actor that created the role, when available.

1002 

1003- `description: string`

1004 

1005 Description of the role.

1006 

1007- `metadata: map[unknown]`

1008 

1009 Arbitrary metadata stored on the role.

1010 

1011- `name: string`

1012 

1013 Name of the role.

1014 

1015- `permissions: array of string`

1016 

1017 Permissions associated with the role.

1018 

1019- `predefined_role: boolean`

1020 

1021 Whether the role is predefined by OpenAI.

1022 

1023- `resource_type: string`

1024 

1025 Resource type the role applies to.

1026 

1027- `updated_at: number`

1028 

1029 When the role was last updated.

1030 

1031### Example

1032 

1033```http

1034curl https://api.openai.com/v1/projects/$PROJECT_ID/users/$USER_ID/roles/$ROLE_ID \

1035 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

1036```

1037 

1038#### Response

1039 

1040```json

1041{

1042 "id": "id",

1043 "assignment_sources": [

1044 {

1045 "principal_id": "principal_id",

1046 "principal_type": "principal_type"

1047 }

1048 ],

1049 "created_at": 0,

1050 "created_by": "created_by",

1051 "created_by_user_obj": {

1052 "foo": "bar"

1053 },

1054 "description": "description",

1055 "metadata": {

1056 "foo": "bar"

1057 },

1058 "name": "name",

1059 "permissions": [

1060 "string"

1061 ],

1062 "predefined_role": true,

1063 "resource_type": "resource_type",

1064 "updated_at": 0

1065}

1066```

1067 

1068### Example

1069 

1070```http

1071curl https://api.openai.com/v1/projects/proj_abc123/users/user_abc123/roles/role_01J1F8PROJ \

1072 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

1073 -H "Content-Type: application/json"

1074```

1075 

1076#### Response

1077 

1078```json

1079{

1080 "id": "role_01J1F8PROJ",

1081 "name": "API Project Key Manager",

1082 "permissions": [

1083 "api.organization.projects.api_keys.read",

1084 "api.organization.projects.api_keys.write"

1085 ],

1086 "resource_type": "api.project",

1087 "predefined_role": false,

1088 "description": "Allows managing API keys for the project",

1089 "created_at": 1711471533,

1090 "updated_at": 1711472599,

1091 "created_by": "user_abc123",

1092 "created_by_user_obj": null,

1093 "metadata": {},

1094 "assignment_sources": null

1095}

1096```

1097 

949## Unassign project role from user1098## Unassign project role from user

950 1099 

951**delete** `/projects/{project_id}/users/{user_id}/roles/{role_id}`1100**delete** `/projects/{project_id}/users/{user_id}/roles/{role_id}`


1008 1157 

1009### Role List Response1158### Role List Response

1010 1159 

1011- `RoleListResponse object { id, created_at, created_by, 8 more }`1160- `RoleListResponse object { id, assignment_sources, created_at, 9 more }`

1012 1161 

1013 Detailed information about a role assignment entry returned when listing assignments.1162 Detailed information about a role assignment entry returned when listing assignments.

1014 1163 


1016 1165 

1017 Identifier for the role.1166 Identifier for the role.

1018 1167 

1168 - `assignment_sources: array of object { principal_id, principal_type }`

1169 

1170 Principals from which the role assignment is inherited, when available.

1171 

1172 - `principal_id: string`

1173 

1174 - `principal_type: string`

1175 

1019 - `created_at: number`1176 - `created_at: number`

1020 1177 

1021 When the role was created.1178 When the role was created.


1202 1359 

1203 - `picture: optional string`1360 - `picture: optional string`

1204 1361 

1362### Role Retrieve Response

1363 

1364- `RoleRetrieveResponse object { id, assignment_sources, created_at, 9 more }`

1365 

1366 Detailed information about a role assignment entry returned when listing assignments.

1367 

1368 - `id: string`

1369 

1370 Identifier for the role.

1371 

1372 - `assignment_sources: array of object { principal_id, principal_type }`

1373 

1374 Principals from which the role assignment is inherited, when available.

1375 

1376 - `principal_id: string`

1377 

1378 - `principal_type: string`

1379 

1380 - `created_at: number`

1381 

1382 When the role was created.

1383 

1384 - `created_by: string`

1385 

1386 Identifier of the actor who created the role.

1387 

1388 - `created_by_user_obj: map[unknown]`

1389 

1390 User details for the actor that created the role, when available.

1391 

1392 - `description: string`

1393 

1394 Description of the role.

1395 

1396 - `metadata: map[unknown]`

1397 

1398 Arbitrary metadata stored on the role.

1399 

1400 - `name: string`

1401 

1402 Name of the role.

1403 

1404 - `permissions: array of string`

1405 

1406 Permissions associated with the role.

1407 

1408 - `predefined_role: boolean`

1409 

1410 Whether the role is predefined by OpenAI.

1411 

1412 - `resource_type: string`

1413 

1414 Resource type the role applies to.

1415 

1416 - `updated_at: number`

1417 

1418 When the role was last updated.

1419 

1205### Role Delete Response1420### Role Delete Response

1206 1421 

1207- `RoleDeleteResponse object { deleted, object }`1422- `RoleDeleteResponse object { deleted, object }`

Details

30 30 

31### Returns31### Returns

32 32 

33- `data: array of object { id, created_at, created_by, 8 more }`33- `data: array of object { id, assignment_sources, created_at, 9 more }`

34 34 

35 Role assignments returned in the current page.35 Role assignments returned in the current page.

36 36 


38 38 

39 Identifier for the role.39 Identifier for the role.

40 40 

41 - `assignment_sources: array of object { principal_id, principal_type }`

42 

43 Principals from which the role assignment is inherited, when available.

44 

45 - `principal_id: string`

46 

47 - `principal_type: string`

48 

41 - `created_at: number`49 - `created_at: number`

42 50 

43 When the role was created.51 When the role was created.


106 "data": [114 "data": [

107 {115 {

108 "id": "id",116 "id": "id",

117 "assignment_sources": [

118 {

119 "principal_id": "principal_id",

120 "principal_type": "principal_type"

121 }

122 ],

109 "created_at": 0,123 "created_at": 0,

110 "created_by": "created_by",124 "created_by": "created_by",

111 "created_by_user_obj": {125 "created_by_user_obj": {

Details

255}255}

256```256```

257 257 

258## Retrieve organization role

259 

260**get** `/organization/roles/{role_id}`

261 

262Retrieves an organization role.

263 

264### Path Parameters

265 

266- `role_id: string`

267 

268### Returns

269 

270- `Role object { id, description, name, 4 more }`

271 

272 Details about a role that can be assigned through the public Roles API.

273 

274 - `id: string`

275 

276 Identifier for the role.

277 

278 - `description: string`

279 

280 Optional description of the role.

281 

282 - `name: string`

283 

284 Unique name for the role.

285 

286 - `object: "role"`

287 

288 Always `role`.

289 

290 - `"role"`

291 

292 - `permissions: array of string`

293 

294 Permissions granted by the role.

295 

296 - `predefined_role: boolean`

297 

298 Whether the role is predefined and managed by OpenAI.

299 

300 - `resource_type: string`

301 

302 Resource type the role is bound to (for example `api.organization` or `api.project`).

303 

304### Example

305 

306```http

307curl https://api.openai.com/v1/organization/roles/$ROLE_ID \

308 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

309```

310 

311#### Response

312 

313```json

314{

315 "id": "id",

316 "description": "description",

317 "name": "name",

318 "object": "role",

319 "permissions": [

320 "string"

321 ],

322 "predefined_role": true,

323 "resource_type": "resource_type"

324}

325```

326 

327### Example

328 

329```http

330curl https://api.openai.com/v1/organization/roles/role_01J1F8ROLE01 \

331 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

332 -H "Content-Type: application/json"

333```

334 

335#### Response

336 

337```json

338{

339 "object": "role",

340 "id": "role_01J1F8ROLE01",

341 "name": "API Group Manager",

342 "description": "Allows managing organization groups",

343 "permissions": [

344 "api.groups.read",

345 "api.groups.write"

346 ],

347 "resource_type": "api.organization",

348 "predefined_role": false

349}

350```

351 

258## Update organization role352## Update organization role

259 353 

260**post** `/organization/roles/{role_id}`354**post** `/organization/roles/{role_id}`

Details

804 804 

805### Returns805### Returns

806 806 

807- `data: array of object { id, created_at, created_by, 8 more }`807- `data: array of object { id, assignment_sources, created_at, 9 more }`

808 808 

809 Role assignments returned in the current page.809 Role assignments returned in the current page.

810 810 


812 812 

813 Identifier for the role.813 Identifier for the role.

814 814 

815 - `assignment_sources: array of object { principal_id, principal_type }`

816 

817 Principals from which the role assignment is inherited, when available.

818 

819 - `principal_id: string`

820 

821 - `principal_type: string`

822 

815 - `created_at: number`823 - `created_at: number`

816 824 

817 When the role was created.825 When the role was created.


880 "data": [888 "data": [

881 {889 {

882 "id": "id",890 "id": "id",

891 "assignment_sources": [

892 {

893 "principal_id": "principal_id",

894 "principal_type": "principal_type"

895 }

896 ],

883 "created_at": 0,897 "created_at": 0,

884 "created_by": "created_by",898 "created_by": "created_by",

885 "created_by_user_obj": {899 "created_by_user_obj": {


1207}1221}

1208```1222```

1209 1223 

1224## Retrieve user organization role

1225 

1226**get** `/organization/users/{user_id}/roles/{role_id}`

1227 

1228Retrieves an organization role assigned to a user.

1229 

1230### Path Parameters

1231 

1232- `user_id: string`

1233 

1234- `role_id: string`

1235 

1236### Returns

1237 

1238- `id: string`

1239 

1240 Identifier for the role.

1241 

1242- `assignment_sources: array of object { principal_id, principal_type }`

1243 

1244 Principals from which the role assignment is inherited, when available.

1245 

1246 - `principal_id: string`

1247 

1248 - `principal_type: string`

1249 

1250- `created_at: number`

1251 

1252 When the role was created.

1253 

1254- `created_by: string`

1255 

1256 Identifier of the actor who created the role.

1257 

1258- `created_by_user_obj: map[unknown]`

1259 

1260 User details for the actor that created the role, when available.

1261 

1262- `description: string`

1263 

1264 Description of the role.

1265 

1266- `metadata: map[unknown]`

1267 

1268 Arbitrary metadata stored on the role.

1269 

1270- `name: string`

1271 

1272 Name of the role.

1273 

1274- `permissions: array of string`

1275 

1276 Permissions associated with the role.

1277 

1278- `predefined_role: boolean`

1279 

1280 Whether the role is predefined by OpenAI.

1281 

1282- `resource_type: string`

1283 

1284 Resource type the role applies to.

1285 

1286- `updated_at: number`

1287 

1288 When the role was last updated.

1289 

1290### Example

1291 

1292```http

1293curl https://api.openai.com/v1/organization/users/$USER_ID/roles/$ROLE_ID \

1294 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

1295```

1296 

1297#### Response

1298 

1299```json

1300{

1301 "id": "id",

1302 "assignment_sources": [

1303 {

1304 "principal_id": "principal_id",

1305 "principal_type": "principal_type"

1306 }

1307 ],

1308 "created_at": 0,

1309 "created_by": "created_by",

1310 "created_by_user_obj": {

1311 "foo": "bar"

1312 },

1313 "description": "description",

1314 "metadata": {

1315 "foo": "bar"

1316 },

1317 "name": "name",

1318 "permissions": [

1319 "string"

1320 ],

1321 "predefined_role": true,

1322 "resource_type": "resource_type",

1323 "updated_at": 0

1324}

1325```

1326 

1327### Example

1328 

1329```http

1330curl https://api.openai.com/v1/organization/users/user_abc123/roles/role_01J1F8ROLE01 \

1331 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

1332 -H "Content-Type: application/json"

1333```

1334 

1335#### Response

1336 

1337```json

1338{

1339 "id": "role_01J1F8ROLE01",

1340 "name": "API Group Manager",

1341 "permissions": [

1342 "api.groups.read",

1343 "api.groups.write"

1344 ],

1345 "resource_type": "api.organization",

1346 "predefined_role": false,

1347 "description": "Allows managing organization groups",

1348 "created_at": 1711471533,

1349 "updated_at": 1711472599,

1350 "created_by": "user_abc123",

1351 "created_by_user_obj": null,

1352 "metadata": {},

1353 "assignment_sources": null

1354}

1355```

1356 

1210## Unassign organization role from user1357## Unassign organization role from user

1211 1358 

1212**delete** `/organization/users/{user_id}/roles/{role_id}`1359**delete** `/organization/users/{user_id}/roles/{role_id}`


1267 1414 

1268### Role List Response1415### Role List Response

1269 1416 

1270- `RoleListResponse object { id, created_at, created_by, 8 more }`1417- `RoleListResponse object { id, assignment_sources, created_at, 9 more }`

1271 1418 

1272 Detailed information about a role assignment entry returned when listing assignments.1419 Detailed information about a role assignment entry returned when listing assignments.

1273 1420 


1275 1422 

1276 Identifier for the role.1423 Identifier for the role.

1277 1424 

1425 - `assignment_sources: array of object { principal_id, principal_type }`

1426 

1427 Principals from which the role assignment is inherited, when available.

1428 

1429 - `principal_id: string`

1430 

1431 - `principal_type: string`

1432 

1278 - `created_at: number`1433 - `created_at: number`

1279 1434 

1280 When the role was created.1435 When the role was created.


1461 1616 

1462 - `picture: optional string`1617 - `picture: optional string`

1463 1618 

1619### Role Retrieve Response

1620 

1621- `RoleRetrieveResponse object { id, assignment_sources, created_at, 9 more }`

1622 

1623 Detailed information about a role assignment entry returned when listing assignments.

1624 

1625 - `id: string`

1626 

1627 Identifier for the role.

1628 

1629 - `assignment_sources: array of object { principal_id, principal_type }`

1630 

1631 Principals from which the role assignment is inherited, when available.

1632 

1633 - `principal_id: string`

1634 

1635 - `principal_type: string`

1636 

1637 - `created_at: number`

1638 

1639 When the role was created.

1640 

1641 - `created_by: string`

1642 

1643 Identifier of the actor who created the role.

1644 

1645 - `created_by_user_obj: map[unknown]`

1646 

1647 User details for the actor that created the role, when available.

1648 

1649 - `description: string`

1650 

1651 Description of the role.

1652 

1653 - `metadata: map[unknown]`

1654 

1655 Arbitrary metadata stored on the role.

1656 

1657 - `name: string`

1658 

1659 Name of the role.

1660 

1661 - `permissions: array of string`

1662 

1663 Permissions associated with the role.

1664 

1665 - `predefined_role: boolean`

1666 

1667 Whether the role is predefined by OpenAI.

1668 

1669 - `resource_type: string`

1670 

1671 Resource type the role applies to.

1672 

1673 - `updated_at: number`

1674 

1675 When the role was last updated.

1676 

1464### Role Delete Response1677### Role Delete Response

1465 1678 

1466- `RoleDeleteResponse object { deleted, object }`1679- `RoleDeleteResponse object { deleted, object }`

Details

28 28 

29### Returns29### Returns

30 30 

31- `data: array of object { id, created_at, created_by, 8 more }`31- `data: array of object { id, assignment_sources, created_at, 9 more }`

32 32 

33 Role assignments returned in the current page.33 Role assignments returned in the current page.

34 34 


36 36 

37 Identifier for the role.37 Identifier for the role.

38 38 

39 - `assignment_sources: array of object { principal_id, principal_type }`

40 

41 Principals from which the role assignment is inherited, when available.

42 

43 - `principal_id: string`

44 

45 - `principal_type: string`

46 

39 - `created_at: number`47 - `created_at: number`

40 48 

41 When the role was created.49 When the role was created.


104 "data": [112 "data": [

105 {113 {

106 "id": "id",114 "id": "id",

115 "assignment_sources": [

116 {

117 "principal_id": "principal_id",

118 "principal_type": "principal_type"

119 }

120 ],

107 "created_at": 0,121 "created_at": 0,

108 "created_by": "created_by",122 "created_by": "created_by",

109 "created_by_user_obj": {123 "created_by_user_obj": {

Details

833 833 

834 - `type: "open_page"`834 - `type: "open_page"`

835 835 

836 The action type. Always `open_page`.836 The action type.

837 837 

838 - `"open_page"`838 - `"open_page"`

839 839 


4441 4441 

4442 - `type: "open_page"`4442 - `type: "open_page"`

4443 4443 

4444 The action type. Always `open_page`.4444 The action type.

4445 4445 

4446 - `"open_page"`4446 - `"open_page"`

4447 4447 


7009 7009 

7010 - `type: "open_page"`7010 - `type: "open_page"`

7011 7011 

7012 The action type. Always `open_page`.7012 The action type.

7013 7013 

7014 - `"open_page"`7014 - `"open_page"`

7015 7015 


9968 9968 

9969 - `type: "open_page"`9969 - `type: "open_page"`

9970 9970 

9971 The action type. Always `open_page`.9971 The action type.

9972 9972 

9973 - `"open_page"`9973 - `"open_page"`

9974 9974 


12860 12860 

12861 - `type: "open_page"`12861 - `type: "open_page"`

12862 12862 

12863 The action type. Always `open_page`.12863 The action type.

12864 12864 

12865 - `"open_page"`12865 - `"open_page"`

12866 12866 


15757 15757 

15758 - `type: "open_page"`15758 - `type: "open_page"`

15759 15759 

15760 The action type. Always `open_page`.15760 The action type.

15761 15761 

15762 - `"open_page"`15762 - `"open_page"`

15763 15763 


18538 18538 

18539 - `type: "open_page"`18539 - `type: "open_page"`

18540 18540 

18541 The action type. Always `open_page`.18541 The action type.

18542 18542 

18543 - `"open_page"`18543 - `"open_page"`

18544 18544 

Details

919 919 

920 - `type: "open_page"`920 - `type: "open_page"`

921 921 

922 The action type. Always `open_page`.922 The action type.

923 923 

924 - `"open_page"`924 - `"open_page"`

925 925 


5250 5250 

5251 - `type: "open_page"`5251 - `type: "open_page"`

5252 5252 

5253 The action type. Always `open_page`.5253 The action type.

5254 5254 

5255 - `"open_page"`5255 - `"open_page"`

5256 5256 


7688 7688 

7689 - `type: "open_page"`7689 - `type: "open_page"`

7690 7690 

7691 The action type. Always `open_page`.7691 The action type.

7692 7692 

7693 - `"open_page"`7693 - `"open_page"`

7694 7694 


12539 12539 

12540 - `type: "open_page"`12540 - `type: "open_page"`

12541 12541 

12542 The action type. Always `open_page`.12542 The action type.

12543 12543 

12544 - `"open_page"`12544 - `"open_page"`

12545 12545 


14977 14977 

14978 - `type: "open_page"`14978 - `type: "open_page"`

14979 14979 

14980 The action type. Always `open_page`.14980 The action type.

14981 14981 

14982 - `"open_page"`14982 - `"open_page"`

14983 14983 


19128 19128 

19129 - `type: "open_page"`19129 - `type: "open_page"`

19130 19130 

19131 The action type. Always `open_page`.19131 The action type.

19132 19132 

19133 - `"open_page"`19133 - `"open_page"`

19134 19134 


21566 21566 

21567 - `type: "open_page"`21567 - `type: "open_page"`

21568 21568 

21569 The action type. Always `open_page`.21569 The action type.

21570 21570 

21571 - `"open_page"`21571 - `"open_page"`

21572 21572 


25787 25787 

25788 - `type: "open_page"`25788 - `type: "open_page"`

25789 25789 

25790 The action type. Always `open_page`.25790 The action type.

25791 25791 

25792 - `"open_page"`25792 - `"open_page"`

25793 25793 


29453 29453 

29454 - `type: "open_page"`29454 - `type: "open_page"`

29455 29455 

29456 The action type. Always `open_page`.29456 The action type.

29457 29457 

29458 - `"open_page"`29458 - `"open_page"`

29459 29459 


32398 32398 

32399 - `type: "open_page"`32399 - `type: "open_page"`

32400 32400 

32401 The action type. Always `open_page`.32401 The action type.

32402 32402 

32403 - `"open_page"`32403 - `"open_page"`

32404 32404 


35313 35313 

35314 - `type: "open_page"`35314 - `type: "open_page"`

35315 35315 

35316 The action type. Always `open_page`.35316 The action type.

35317 35317 

35318 - `"open_page"`35318 - `"open_page"`

35319 35319 


37751 37751 

37752 - `type: "open_page"`37752 - `type: "open_page"`

37753 37753 

37754 The action type. Always `open_page`.37754 The action type.

37755 37755 

37756 - `"open_page"`37756 - `"open_page"`

37757 37757 


41858 41858 

41859 - `type: "open_page"`41859 - `type: "open_page"`

41860 41860 

41861 The action type. Always `open_page`.41861 The action type.

41862 41862 

41863 - `"open_page"`41863 - `"open_page"`

41864 41864 


44296 44296 

44297 - `type: "open_page"`44297 - `type: "open_page"`

44298 44298 

44299 The action type. Always `open_page`.44299 The action type.

44300 44300 

44301 - `"open_page"`44301 - `"open_page"`

44302 44302 


48880 48880 

48881 - `type: "open_page"`48881 - `type: "open_page"`

48882 48882 

48883 The action type. Always `open_page`.48883 The action type.

48884 48884 

48885 - `"open_page"`48885 - `"open_page"`

48886 48886 


51318 51318 

51319 - `type: "open_page"`51319 - `type: "open_page"`

51320 51320 

51321 The action type. Always `open_page`.51321 The action type.

51322 51322 

51323 - `"open_page"`51323 - `"open_page"`

51324 51324 


55369 55369 

55370 - `type: "open_page"`55370 - `type: "open_page"`

55371 55371 

55372 The action type. Always `open_page`.55372 The action type.

55373 55373 

55374 - `"open_page"`55374 - `"open_page"`

55375 55375 


57807 57807 

57808 - `type: "open_page"`57808 - `type: "open_page"`

57809 57809 

57810 The action type. Always `open_page`.57810 The action type.

57811 57811 

57812 - `"open_page"`57812 - `"open_page"`

57813 57813 


62111 62111 

62112 - `type: "open_page"`62112 - `type: "open_page"`

62113 62113 

62114 The action type. Always `open_page`.62114 The action type.

62115 62115 

62116 - `"open_page"`62116 - `"open_page"`

62117 62117 


64549 64549 

64550 - `type: "open_page"`64550 - `type: "open_page"`

64551 64551 

64552 The action type. Always `open_page`.64552 The action type.

64553 64553 

64554 - `"open_page"`64554 - `"open_page"`

64555 64555 


68497 68497 

68498 - `type: "open_page"`68498 - `type: "open_page"`

68499 68499 

68500 The action type. Always `open_page`.68500 The action type.

68501 68501 

68502 - `"open_page"`68502 - `"open_page"`

68503 68503 


70935 70935 

70936 - `type: "open_page"`70936 - `type: "open_page"`

70937 70937 

70938 The action type. Always `open_page`.70938 The action type.

70939 70939 

70940 - `"open_page"`70940 - `"open_page"`

70941 70941 


75128 75128 

75129 - `type: "open_page"`75129 - `type: "open_page"`

75130 75130 

75131 The action type. Always `open_page`.75131 The action type.

75132 75132 

75133 - `"open_page"`75133 - `"open_page"`

75134 75134 


77832 77832 

77833 - `type: "open_page"`77833 - `type: "open_page"`

77834 77834 

77835 The action type. Always `open_page`.77835 The action type.

77836 77836 

77837 - `"open_page"`77837 - `"open_page"`

77838 77838 


80550 80550 

80551 - `type: "open_page"`80551 - `type: "open_page"`

80552 80552 

80553 The action type. Always `open_page`.80553 The action type.

80554 80554 

80555 - `"open_page"`80555 - `"open_page"`

80556 80556 


84178 84178 

84179 - `type: "open_page"`84179 - `type: "open_page"`

84180 84180 

84181 The action type. Always `open_page`.84181 The action type.

84182 84182 

84183 - `"open_page"`84183 - `"open_page"`

84184 84184 


86616 86616 

86617 - `type: "open_page"`86617 - `type: "open_page"`

86618 86618 

86619 The action type. Always `open_page`.86619 The action type.

86620 86620 

86621 - `"open_page"`86621 - `"open_page"`

86622 86622 


91014 91014 

91015 - `type: "open_page"`91015 - `type: "open_page"`

91016 91016 

91017 The action type. Always `open_page`.91017 The action type.

91018 91018 

91019 - `"open_page"`91019 - `"open_page"`

91020 91020 


93452 93452 

93453 - `type: "open_page"`93453 - `type: "open_page"`

93454 93454 

93455 The action type. Always `open_page`.93455 The action type.

93456 93456 

93457 - `"open_page"`93457 - `"open_page"`

93458 93458 


98963 98963 

98964 - `type: "open_page"`98964 - `type: "open_page"`

98965 98965 

98966 The action type. Always `open_page`.98966 The action type.

98967 98967 

98968 - `"open_page"`98968 - `"open_page"`

98969 98969 


103486 103486 

103487 - `type: "open_page"`103487 - `type: "open_page"`

103488 103488 

103489 The action type. Always `open_page`.103489 The action type.

103490 103490 

103491 - `"open_page"`103491 - `"open_page"`

103492 103492 


105924 105924 

105925 - `type: "open_page"`105925 - `type: "open_page"`

105926 105926 

105927 The action type. Always `open_page`.105927 The action type.

105928 105928 

105929 - `"open_page"`105929 - `"open_page"`

105930 105930 


111236 111236 

111237 - `type: "open_page"`111237 - `type: "open_page"`

111238 111238 

111239 The action type. Always `open_page`.111239 The action type.

111240 111240 

111241 - `"open_page"`111241 - `"open_page"`

111242 111242 


114088 114088 

114089 - `type: "open_page"`114089 - `type: "open_page"`

114090 114090 

114091 The action type. Always `open_page`.114091 The action type.

114092 114092 

114093 - `"open_page"`114093 - `"open_page"`

114094 114094 


116950 116950 

116951 - `type: "open_page"`116951 - `type: "open_page"`

116952 116952 

116953 The action type. Always `open_page`.116953 The action type.

116954 116954 

116955 - `"open_page"`116955 - `"open_page"`

116956 116956 

Details

921 921 

922 - `type: "open_page"`922 - `type: "open_page"`

923 923 

924 The action type. Always `open_page`.924 The action type.

925 925 

926 - `"open_page"`926 - `"open_page"`

927 927 


3359 3359 

3360 - `type: "open_page"`3360 - `type: "open_page"`

3361 3361 

3362 The action type. Always `open_page`.3362 The action type.

3363 3363 

3364 - `"open_page"`3364 - `"open_page"`

3365 3365 

Details

1035 1035 

1036 - `type: "open_page"`1036 - `type: "open_page"`

1037 1037 

1038 The action type. Always `open_page`.1038 The action type.

1039 1039 

1040 - `"open_page"`1040 - `"open_page"`

1041 1041 


4701 4701 

4702 - `type: "open_page"`4702 - `type: "open_page"`

4703 4703 

4704 The action type. Always `open_page`.4704 The action type.

4705 4705 

4706 - `"open_page"`4706 - `"open_page"`

4707 4707 

Details

917 917 

918 - `type: "open_page"`918 - `type: "open_page"`

919 919 

920 The action type. Always `open_page`.920 The action type.

921 921 

922 - `"open_page"`922 - `"open_page"`

923 923 


5248 5248 

5249 - `type: "open_page"`5249 - `type: "open_page"`

5250 5250 

5251 The action type. Always `open_page`.5251 The action type.

5252 5252 

5253 - `"open_page"`5253 - `"open_page"`

5254 5254 


7686 7686 

7687 - `type: "open_page"`7687 - `type: "open_page"`

7688 7688 

7689 The action type. Always `open_page`.7689 The action type.

7690 7690 

7691 - `"open_page"`7691 - `"open_page"`

7692 7692 

Details

965 965 

966 - `type: "open_page"`966 - `type: "open_page"`

967 967 

968 The action type. Always `open_page`.968 The action type.

969 969 

970 - `"open_page"`970 - `"open_page"`

971 971 


3403 3403 

3404 - `type: "open_page"`3404 - `type: "open_page"`

3405 3405 

3406 The action type. Always `open_page`.3406 The action type.

3407 3407 

3408 - `"open_page"`3408 - `"open_page"`

3409 3409