{
	"openapi": "3.1.0",
	"info": {
		"title": "Notion Admin API",
		"version": "1.0.0",
		"termsOfService": "https://notion.notion.site/Terms-and-Privacy-28ffdd083dc3473e9c2da6ec011b58ac"
	},
	"servers": [
		{
			"url": "https://api.notion.com/admin"
		}
	],
	"security": [
		{
			"bearerAuth": []
		}
	],
	"tags": [
		{
			"name": "Exports",
			"description": "Workspace export endpoints"
		},
		{
			"name": "Legal holds",
			"description": "Legal hold endpoints"
		},
		{
			"name": "Managed users",
			"description": "Managed user endpoints"
		}
	],
	"components": {
		"securitySchemes": {
			"bearerAuth": {
				"type": "http",
				"scheme": "bearer"
			}
		},
		"schemas": {
			"adminApiError400": {
				"type": "object",
				"properties": {
					"type": {
						"enum": ["error"]
					},
					"code": {
						"enum": ["validation_error"]
					},
					"status": {
						"enum": [400]
					},
					"message": {
						"type": "string"
					}
				},
				"required": ["type", "code", "status", "message"],
				"additionalProperties": false
			},
			"adminApiError401": {
				"type": "object",
				"properties": {
					"type": {
						"enum": ["error"]
					},
					"code": {
						"enum": ["unauthorized"]
					},
					"status": {
						"enum": [401]
					},
					"message": {
						"type": "string"
					}
				},
				"required": ["type", "code", "status", "message"],
				"additionalProperties": false
			},
			"adminApiError403": {
				"type": "object",
				"properties": {
					"type": {
						"enum": ["error"]
					},
					"code": {
						"enum": ["missing_scope", "forbidden"]
					},
					"status": {
						"enum": [403]
					},
					"message": {
						"type": "string"
					}
				},
				"required": ["type", "code", "status", "message"],
				"additionalProperties": false
			},
			"adminApiError404": {
				"type": "object",
				"properties": {
					"type": {
						"enum": ["error"]
					},
					"code": {
						"enum": ["not_found"]
					},
					"status": {
						"enum": [404]
					},
					"message": {
						"type": "string"
					}
				},
				"required": ["type", "code", "status", "message"],
				"additionalProperties": false
			},
			"adminApiError429": {
				"type": "object",
				"properties": {
					"type": {
						"enum": ["error"]
					},
					"code": {
						"enum": ["rate_limited"]
					},
					"status": {
						"enum": [429]
					},
					"message": {
						"type": "string"
					}
				},
				"required": ["type", "code", "status", "message"],
				"additionalProperties": false
			},
			"adminApiError500": {
				"type": "object",
				"properties": {
					"type": {
						"enum": ["error"]
					},
					"code": {
						"enum": ["internal_server_error"]
					},
					"status": {
						"enum": [500]
					},
					"message": {
						"type": "string"
					}
				},
				"required": ["type", "code", "status", "message"],
				"additionalProperties": false
			},
			"adminApiPublicError400": {
				"type": "object",
				"properties": {
					"object": {
						"enum": ["error"]
					},
					"code": {
						"enum": ["validation_error"]
					},
					"status": {
						"enum": [400]
					},
					"message": {
						"type": "string"
					},
					"additional_data": {
						"type": "object",
						"additionalProperties": {
							"oneOf": [
								{
									"type": "string"
								},
								{
									"type": "array",
									"items": {
										"type": "string"
									}
								}
							]
						}
					}
				},
				"required": ["object", "code", "status", "message"],
				"additionalProperties": false
			},
			"adminApiPublicError401": {
				"type": "object",
				"properties": {
					"object": {
						"enum": ["error"]
					},
					"code": {
						"enum": ["unauthorized"]
					},
					"status": {
						"enum": [401]
					},
					"message": {
						"type": "string"
					},
					"additional_data": {
						"type": "object",
						"additionalProperties": {
							"oneOf": [
								{
									"type": "string"
								},
								{
									"type": "array",
									"items": {
										"type": "string"
									}
								}
							]
						}
					}
				},
				"required": ["object", "code", "status", "message"],
				"additionalProperties": false
			},
			"adminApiPublicError403": {
				"type": "object",
				"properties": {
					"object": {
						"enum": ["error"]
					},
					"code": {
						"enum": ["restricted_resource"]
					},
					"status": {
						"enum": [403]
					},
					"message": {
						"type": "string"
					},
					"additional_data": {
						"type": "object",
						"additionalProperties": {
							"oneOf": [
								{
									"type": "string"
								},
								{
									"type": "array",
									"items": {
										"type": "string"
									}
								}
							]
						}
					}
				},
				"required": ["object", "code", "status", "message"],
				"additionalProperties": false
			},
			"adminApiPublicError404": {
				"type": "object",
				"properties": {
					"object": {
						"enum": ["error"]
					},
					"code": {
						"enum": ["object_not_found"]
					},
					"status": {
						"enum": [404]
					},
					"message": {
						"type": "string"
					},
					"additional_data": {
						"type": "object",
						"additionalProperties": {
							"oneOf": [
								{
									"type": "string"
								},
								{
									"type": "array",
									"items": {
										"type": "string"
									}
								}
							]
						}
					}
				},
				"required": ["object", "code", "status", "message"],
				"additionalProperties": false
			},
			"adminApiPublicError409": {
				"type": "object",
				"properties": {
					"object": {
						"enum": ["error"]
					},
					"code": {
						"enum": ["conflict_error"]
					},
					"status": {
						"enum": [409]
					},
					"message": {
						"type": "string"
					},
					"additional_data": {
						"type": "object",
						"additionalProperties": {
							"oneOf": [
								{
									"type": "string"
								},
								{
									"type": "array",
									"items": {
										"type": "string"
									}
								}
							]
						}
					}
				},
				"required": ["object", "code", "status", "message"],
				"additionalProperties": false
			},
			"adminApiPublicError429": {
				"type": "object",
				"properties": {
					"object": {
						"enum": ["error"]
					},
					"code": {
						"enum": ["rate_limited"]
					},
					"status": {
						"enum": [429]
					},
					"message": {
						"type": "string"
					},
					"additional_data": {
						"type": "object",
						"additionalProperties": {
							"oneOf": [
								{
									"type": "string"
								},
								{
									"type": "array",
									"items": {
										"type": "string"
									}
								}
							]
						}
					}
				},
				"required": ["object", "code", "status", "message"],
				"additionalProperties": false
			},
			"adminApiPublicError500": {
				"type": "object",
				"properties": {
					"object": {
						"enum": ["error"]
					},
					"code": {
						"enum": ["internal_server_error"]
					},
					"status": {
						"enum": [500]
					},
					"message": {
						"type": "string"
					},
					"additional_data": {
						"type": "object",
						"additionalProperties": {
							"oneOf": [
								{
									"type": "string"
								},
								{
									"type": "array",
									"items": {
										"type": "string"
									}
								}
							]
						}
					}
				},
				"required": ["object", "code", "status", "message"],
				"additionalProperties": false
			},
			"adminApiPublicError503": {
				"type": "object",
				"properties": {
					"object": {
						"enum": ["error"]
					},
					"code": {
						"enum": ["service_unavailable"]
					},
					"status": {
						"enum": [503]
					},
					"message": {
						"type": "string"
					},
					"additional_data": {
						"type": "object",
						"additionalProperties": {
							"oneOf": [
								{
									"type": "string"
								},
								{
									"type": "array",
									"items": {
										"type": "string"
									}
								}
							]
						}
					}
				},
				"required": ["object", "code", "status", "message"],
				"additionalProperties": false
			},
			"emptyObject": {
				"type": "object",
				"properties": {},
				"additionalProperties": false
			},
			"idRequest": {
				"type": "string"
			}
		},
		"parameters": {
			"notionVersion": {
				"name": "Notion-Version",
				"in": "header",
				"required": true,
				"schema": {
					"enum": ["2026-06-01"]
				},
				"description": "The Admin API version to use for this request."
			}
		}
	},
	"paths": {
		"/v1/legal_holds/{legal_hold_id}/export": {
			"post": {
				"summary": "Export a legal hold",
				"operationId": "export-legal-hold",
				"x-scopes": ["legal-hold:export"],
				"tags": ["Legal holds"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "legal_hold_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"anyOf": [
									{
										"type": "object",
										"properties": {
											"legal_hold_export_id": {
												"type": "string",
												"format": "uuid"
											},
											"requesting_user_id": {
												"type": "string",
												"format": "uuid"
											}
										},
										"required": ["legal_hold_export_id", "requesting_user_id"]
									},
									{
										"type": "object",
										"properties": {
											"requesting_user_id": {
												"type": "string",
												"format": "uuid"
											},
											"space_id": {
												"type": "string",
												"format": "uuid"
											}
										},
										"required": ["requesting_user_id", "space_id"]
									}
								]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"legal_hold_export_id": {
											"type": "string",
											"format": "uuid"
										}
									},
									"required": ["legal_hold_export_id"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/legal_holds/{legal_hold_id}": {
			"get": {
				"summary": "Retrieve a legal hold",
				"operationId": "get-legal-hold",
				"x-scopes": ["legal-hold:read"],
				"tags": ["Legal holds"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "legal_hold_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"created_by": {
											"type": "string",
											"format": "uuid"
										},
										"created_time": {
											"type": "number"
										},
										"id": {
											"type": "string"
										},
										"start_date": {
											"type": "number"
										},
										"status": {
											"type": "string",
											"enum": ["active", "released"]
										},
										"user_interaction_type": {
											"type": "array",
											"items": {
												"type": "string",
												"enum": ["page.created", "page.edited", "page.viewed"]
											}
										},
										"users": {
											"type": "object",
											"properties": {
												"ids": {
													"type": "array",
													"items": {
														"type": "string",
														"format": "uuid"
													}
												},
												"total": {
													"type": "number"
												}
											},
											"required": ["ids", "total"]
										},
										"workspaces": {
											"type": "object",
											"properties": {
												"ids": {
													"type": "array",
													"items": {
														"type": "string",
														"format": "uuid"
													}
												},
												"total": {
													"type": "number"
												}
											},
											"required": ["ids", "total"]
										},
										"description": {
											"type": "string"
										},
										"end_date": {
											"type": "number"
										},
										"icon": {
											"type": "string"
										},
										"name": {
											"type": "string"
										}
									},
									"required": [
										"created_by",
										"created_time",
										"id",
										"start_date",
										"status",
										"user_interaction_type",
										"users",
										"workspaces"
									]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			},
			"patch": {
				"summary": "Update a legal hold",
				"operationId": "update-legal-hold",
				"x-scopes": ["legal-hold:write"],
				"tags": ["Legal holds"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "legal_hold_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"description": {
										"type": "string"
									},
									"icon": {
										"type": "string"
									},
									"name": {
										"type": "string"
									}
								},
								"required": []
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"created_by": {
											"type": "string",
											"format": "uuid"
										},
										"created_time": {
											"type": "number"
										},
										"id": {
											"type": "string"
										},
										"start_date": {
											"type": "number"
										},
										"status": {
											"type": "string",
											"enum": ["active", "released"]
										},
										"user_interaction_type": {
											"type": "array",
											"items": {
												"type": "string",
												"enum": ["page.created", "page.edited", "page.viewed"]
											}
										},
										"users": {
											"type": "object",
											"properties": {
												"ids": {
													"type": "array",
													"items": {
														"type": "string",
														"format": "uuid"
													}
												},
												"total": {
													"type": "number"
												}
											},
											"required": ["ids", "total"]
										},
										"workspaces": {
											"type": "object",
											"properties": {
												"ids": {
													"type": "array",
													"items": {
														"type": "string",
														"format": "uuid"
													}
												},
												"total": {
													"type": "number"
												}
											},
											"required": ["ids", "total"]
										},
										"description": {
											"type": "string"
										},
										"end_date": {
											"type": "number"
										},
										"icon": {
											"type": "string"
										},
										"name": {
											"type": "string"
										}
									},
									"required": [
										"created_by",
										"created_time",
										"id",
										"start_date",
										"status",
										"user_interaction_type",
										"users",
										"workspaces"
									]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/legal_holds/{legal_hold_id}/users": {
			"get": {
				"summary": "List users on a legal hold",
				"operationId": "list-legal-hold-users",
				"x-scopes": ["legal-hold:read"],
				"tags": ["Legal holds"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "legal_hold_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					},
					{
						"name": "start_cursor",
						"in": "query",
						"schema": {
							"type": "string"
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"user_ids": {
											"type": "array",
											"items": {
												"type": "string",
												"format": "uuid"
											}
										},
										"next_cursor": {
											"type": "string"
										}
									},
									"required": ["user_ids"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			},
			"post": {
				"summary": "Add users to a legal hold",
				"operationId": "add-legal-hold-users",
				"x-scopes": ["legal-hold:write"],
				"tags": ["Legal holds"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "legal_hold_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"user_ids": {
										"type": "array",
										"items": {
											"type": "string",
											"format": "uuid"
										}
									}
								},
								"required": ["user_ids"]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"created_by": {
											"type": "string",
											"format": "uuid"
										},
										"created_time": {
											"type": "number"
										},
										"id": {
											"type": "string"
										},
										"start_date": {
											"type": "number"
										},
										"status": {
											"type": "string",
											"enum": ["active", "released"]
										},
										"user_interaction_type": {
											"type": "array",
											"items": {
												"type": "string",
												"enum": ["page.created", "page.edited", "page.viewed"]
											}
										},
										"users": {
											"type": "object",
											"properties": {
												"ids": {
													"type": "array",
													"items": {
														"type": "string",
														"format": "uuid"
													}
												},
												"total": {
													"type": "number"
												}
											},
											"required": ["ids", "total"]
										},
										"workspaces": {
											"type": "object",
											"properties": {
												"ids": {
													"type": "array",
													"items": {
														"type": "string",
														"format": "uuid"
													}
												},
												"total": {
													"type": "number"
												}
											},
											"required": ["ids", "total"]
										},
										"description": {
											"type": "string"
										},
										"end_date": {
											"type": "number"
										},
										"icon": {
											"type": "string"
										},
										"name": {
											"type": "string"
										}
									},
									"required": [
										"created_by",
										"created_time",
										"id",
										"start_date",
										"status",
										"user_interaction_type",
										"users",
										"workspaces"
									]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/legal_holds": {
			"get": {
				"summary": "List legal holds",
				"operationId": "list-legal-holds",
				"x-scopes": ["legal-hold:read"],
				"tags": ["Legal holds"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "start_cursor",
						"in": "query",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "user_id",
						"in": "query",
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"legal_holds": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"created_by": {
														"type": "string",
														"format": "uuid"
													},
													"created_time": {
														"type": "number"
													},
													"id": {
														"type": "string"
													},
													"start_date": {
														"type": "number"
													},
													"status": {
														"type": "string",
														"enum": ["active", "released"]
													},
													"user_interaction_type": {
														"type": "array",
														"items": {
															"type": "string",
															"enum": [
																"page.created",
																"page.edited",
																"page.viewed"
															]
														}
													},
													"users": {
														"type": "object",
														"properties": {
															"ids": {
																"type": "array",
																"items": {
																	"type": "string",
																	"format": "uuid"
																}
															},
															"total": {
																"type": "number"
															}
														},
														"required": ["ids", "total"]
													},
													"workspaces": {
														"type": "object",
														"properties": {
															"ids": {
																"type": "array",
																"items": {
																	"type": "string",
																	"format": "uuid"
																}
															},
															"total": {
																"type": "number"
															}
														},
														"required": ["ids", "total"]
													},
													"description": {
														"type": "string"
													},
													"end_date": {
														"type": "number"
													},
													"icon": {
														"type": "string"
													},
													"name": {
														"type": "string"
													}
												},
												"required": [
													"created_by",
													"created_time",
													"id",
													"start_date",
													"status",
													"user_interaction_type",
													"users",
													"workspaces"
												]
											}
										},
										"next_cursor": {
											"type": "string"
										}
									},
									"required": ["legal_holds"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			},
			"post": {
				"summary": "Create a legal hold",
				"operationId": "create-legal-hold",
				"x-scopes": ["legal-hold:write"],
				"tags": ["Legal holds"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"name": {
										"type": "string"
									},
									"start_date": {
										"type": "number"
									},
									"user_ids": {
										"type": "array",
										"items": {
											"type": "string",
											"format": "uuid"
										}
									},
									"user_interaction_type": {
										"type": "array",
										"items": {
											"type": "string",
											"enum": ["page.created", "page.edited", "page.viewed"]
										}
									},
									"description": {
										"type": "string"
									},
									"end_date": {
										"type": "number"
									},
									"icon": {
										"type": "string"
									}
								},
								"required": [
									"name",
									"start_date",
									"user_ids",
									"user_interaction_type"
								]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"created_by": {
											"type": "string",
											"format": "uuid"
										},
										"created_time": {
											"type": "number"
										},
										"id": {
											"type": "string"
										},
										"start_date": {
											"type": "number"
										},
										"status": {
											"type": "string",
											"enum": ["active", "released"]
										},
										"user_interaction_type": {
											"type": "array",
											"items": {
												"type": "string",
												"enum": ["page.created", "page.edited", "page.viewed"]
											}
										},
										"users": {
											"type": "object",
											"properties": {
												"ids": {
													"type": "array",
													"items": {
														"type": "string",
														"format": "uuid"
													}
												},
												"total": {
													"type": "number"
												}
											},
											"required": ["ids", "total"]
										},
										"workspaces": {
											"type": "object",
											"properties": {
												"ids": {
													"type": "array",
													"items": {
														"type": "string",
														"format": "uuid"
													}
												},
												"total": {
													"type": "number"
												}
											},
											"required": ["ids", "total"]
										},
										"description": {
											"type": "string"
										},
										"end_date": {
											"type": "number"
										},
										"icon": {
											"type": "string"
										},
										"name": {
											"type": "string"
										}
									},
									"required": [
										"created_by",
										"created_time",
										"id",
										"start_date",
										"status",
										"user_interaction_type",
										"users",
										"workspaces"
									]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/legal_holds/{legal_hold_id}/workspaces": {
			"get": {
				"summary": "List workspaces on a legal hold",
				"operationId": "list-legal-hold-workspaces",
				"x-scopes": ["legal-hold:read"],
				"tags": ["Legal holds"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "legal_hold_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					},
					{
						"name": "start_cursor",
						"in": "query",
						"schema": {
							"type": "string"
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"workspace_ids": {
											"type": "array",
											"items": {
												"type": "string"
											}
										},
										"next_cursor": {
											"type": "string"
										}
									},
									"required": ["workspace_ids"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/legal_holds/{legal_hold_id}/release": {
			"post": {
				"summary": "Release a legal hold",
				"operationId": "release-legal-hold",
				"x-scopes": ["legal-hold:write-high-impact"],
				"tags": ["Legal holds"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "legal_hold_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"created_by": {
											"type": "string",
											"format": "uuid"
										},
										"created_time": {
											"type": "number"
										},
										"id": {
											"type": "string"
										},
										"start_date": {
											"type": "number"
										},
										"status": {
											"type": "string",
											"enum": ["active", "released"]
										},
										"user_interaction_type": {
											"type": "array",
											"items": {
												"type": "string",
												"enum": ["page.created", "page.edited", "page.viewed"]
											}
										},
										"users": {
											"type": "object",
											"properties": {
												"ids": {
													"type": "array",
													"items": {
														"type": "string",
														"format": "uuid"
													}
												},
												"total": {
													"type": "number"
												}
											},
											"required": ["ids", "total"]
										},
										"workspaces": {
											"type": "object",
											"properties": {
												"ids": {
													"type": "array",
													"items": {
														"type": "string",
														"format": "uuid"
													}
												},
												"total": {
													"type": "number"
												}
											},
											"required": ["ids", "total"]
										},
										"description": {
											"type": "string"
										},
										"end_date": {
											"type": "number"
										},
										"icon": {
											"type": "string"
										},
										"name": {
											"type": "string"
										}
									},
									"required": [
										"created_by",
										"created_time",
										"id",
										"start_date",
										"status",
										"user_interaction_type",
										"users",
										"workspaces"
									]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/legal_holds/{legal_hold_id}/users/{user_id}": {
			"delete": {
				"summary": "Remove a user from a legal hold",
				"operationId": "remove-legal-hold-user",
				"x-scopes": ["legal-hold:write"],
				"tags": ["Legal holds"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "legal_hold_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					},
					{
						"name": "user_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"created_by": {
											"type": "string",
											"format": "uuid"
										},
										"created_time": {
											"type": "number"
										},
										"id": {
											"type": "string"
										},
										"start_date": {
											"type": "number"
										},
										"status": {
											"type": "string",
											"enum": ["active", "released"]
										},
										"user_interaction_type": {
											"type": "array",
											"items": {
												"type": "string",
												"enum": ["page.created", "page.edited", "page.viewed"]
											}
										},
										"users": {
											"type": "object",
											"properties": {
												"ids": {
													"type": "array",
													"items": {
														"type": "string",
														"format": "uuid"
													}
												},
												"total": {
													"type": "number"
												}
											},
											"required": ["ids", "total"]
										},
										"workspaces": {
											"type": "object",
											"properties": {
												"ids": {
													"type": "array",
													"items": {
														"type": "string",
														"format": "uuid"
													}
												},
												"total": {
													"type": "number"
												}
											},
											"required": ["ids", "total"]
										},
										"description": {
											"type": "string"
										},
										"end_date": {
											"type": "number"
										},
										"icon": {
											"type": "string"
										},
										"name": {
											"type": "string"
										}
									},
									"required": [
										"created_by",
										"created_time",
										"id",
										"start_date",
										"status",
										"user_interaction_type",
										"users",
										"workspaces"
									]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/exports": {
			"post": {
				"summary": "Enqueue a workspace export",
				"operationId": "enqueue-space-export",
				"x-scopes": ["workspace:export"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"description": "UUID of the workspace (space) to export."
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"export_type": {
										"type": "string",
										"enum": ["html", "markdown"]
									},
									"on_behalf_of_user_email": {
										"type": "string"
									},
									"collection_view_export_type": {
										"type": "string",
										"enum": ["all", "currentView"]
									},
									"flatten_export_filetree": {
										"type": "boolean"
									},
									"include_comments": {
										"type": "boolean"
									},
									"include_contents": {
										"type": "string",
										"enum": ["everything", "no_files"]
									},
									"locale": {
										"type": "string"
									},
									"teamspace_ids": {
										"type": "array",
										"items": {
											"type": "string"
										}
									},
									"time_zone": {
										"type": "string"
									}
								},
								"required": ["export_type", "on_behalf_of_user_email"]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"export_job_id": {
											"type": "string"
										},
										"status": {
											"type": "string"
										}
									},
									"required": ["export_job_id", "status"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/exports/{export_job_id}": {
			"get": {
				"summary": "Get workspace export status",
				"operationId": "get-space-export-status",
				"x-scopes": ["workspace:export"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "export_job_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"description": "Identifier of the export job, as returned by the enqueue endpoint."
						}
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"description": "UUID of the workspace (space) the export belongs to."
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"created_time": {
											"type": "number"
										},
										"export_format": {
											"type": "string",
											"enum": ["html", "markdown", "pdf"]
										},
										"export_job_id": {
											"type": "string",
											"description": "Identifier of the export job, as returned by the enqueue endpoint."
										},
										"export_type": {
											"type": "string",
											"enum": ["page", "space", "teamspace"],
											"description": "Whether an entire workspace ('space'), a teamspace, or a single 'page' was exported."
										},
										"last_edited_time": {
											"type": "number"
										},
										"pages_exported": {
											"type": "number"
										},
										"status": {
											"type": "string",
											"enum": [
												"completed",
												"failed",
												"in_progress",
												"url_generation_failed"
											],
											"description": "Current state of the export: - 'in_progress': the export has not finished yet. - 'completed': the export finished and 'download_urls' is available. - 'url_generation_failed': the export finished, but a download URL could   not be generated. - 'failed': the export itself did not finish; see 'error_type' and   'error_message'."
										},
										"download_urls": {
											"type": "array",
											"items": {
												"type": "string"
											},
											"description": "Short-lived, bot-scoped download URLs for the completed export. Always present when 'status' is 'completed', and absent for every other status."
										},
										"error_message": {
											"type": "string"
										},
										"error_type": {
											"type": "string"
										},
										"url_expires_time": {
											"type": "number"
										}
									},
									"required": [
										"created_time",
										"export_format",
										"export_job_id",
										"export_type",
										"last_edited_time",
										"pages_exported",
										"status"
									]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/legal_holds/{legal_hold_id}/spaces/{space_id}/pages": {
			"get": {
				"summary": "List pages on a legal hold",
				"operationId": "list-legal-hold-pages",
				"x-scopes": ["legal-hold:read"],
				"tags": ["Legal holds"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "legal_hold_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					},
					{
						"name": "start_cursor",
						"in": "query",
						"schema": {
							"type": "string"
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"page_ids": {
											"type": "array",
											"items": {
												"type": "string"
											}
										},
										"next_cursor": {
											"type": "string"
										}
									},
									"required": ["page_ids"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/managed_users/revoke_session": {
			"post": {
				"summary": "Revoke a managed user's sessions",
				"operationId": "revoke-user-session",
				"x-scopes": ["managed-user-session:write"],
				"tags": ["Managed users"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"user": {
										"oneOf": [
											{
												"type": "object",
												"properties": {
													"type": {
														"type": "string",
														"const": "email",
														"description": "Always `email`"
													},
													"email": {
														"type": "string",
														"description": "The managed user's primary email address."
													}
												},
												"additionalProperties": false,
												"required": ["type", "email"]
											},
											{
												"type": "object",
												"properties": {
													"type": {
														"type": "string",
														"const": "id",
														"description": "Always `id`"
													},
													"id": {
														"type": "string",
														"description": "The managed user's Notion user UUID."
													}
												},
												"additionalProperties": false,
												"required": ["type", "id"]
											}
										],
										"description": "The managed user whose active sessions should be revoked."
									}
								},
								"required": ["user"]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"status": {
											"type": "string",
											"const": "revoked",
											"description": "Confirms that the user's active sessions were revoked."
										}
									},
									"required": ["status"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/mcp_client_connections": {
			"get": {
				"summary": "List MCP client connections in an organization",
				"operationId": "list-mcp-client-connections",
				"x-scopes": ["mcp-client-connection:read"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "start_cursor",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "The `next_cursor` returned by the previous page."
						}
					},
					{
						"name": "cursor",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Deprecated; use `start_cursor`.",
							"deprecated": true
						}
					},
					{
						"name": "page_size",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Number of results to return. Defaults to 100 and cannot exceed 100."
						}
					},
					{
						"name": "user_ids",
						"in": "query",
						"schema": {
							"anyOf": [
								{
									"type": "array",
									"items": {
										"type": "string",
										"format": "uuid"
									}
								},
								{
									"type": "string",
									"format": "uuid"
								}
							],
							"description": "Member IDs to include. Use bracket encoding for multiple values."
						}
					},
					{
						"name": "workspace_ids",
						"in": "query",
						"schema": {
							"anyOf": [
								{
									"type": "array",
									"items": {
										"type": "string",
										"format": "uuid"
									}
								},
								{
									"type": "string",
									"format": "uuid"
								}
							],
							"description": "Workspace IDs to include. Use bracket encoding for multiple values."
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"has_more": {
											"type": "boolean",
											"description": "Whether another page is available."
										},
										"results": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"client": {
														"type": "object",
														"properties": {
															"key": {
																"type": "string",
																"description": "Stable client key required by the revoke endpoint."
															},
															"name": {
																"type": "string",
																"description": "Name provided by Notion or reported by a custom client."
															},
															"type": {
																"type": "string",
																"enum": [
																	"canva",
																	"chatgpt",
																	"claude",
																	"composio",
																	"cursor",
																	"devin",
																	"figma_make",
																	"github",
																	"google",
																	"grok",
																	"grok_bot",
																	"hubspot",
																	"linear",
																	"lovable",
																	"make",
																	"meta_muse",
																	"microsoft_365_copilot",
																	"mistral",
																	"notion",
																	"other",
																	"perplexity",
																	"plaud",
																	"poke",
																	"ramp_glass",
																	"slack",
																	"vscode",
																	"zapier"
																],
																"description": "Client category, or 'other' for a custom or unregistered client."
															}
														},
														"required": ["key", "name", "type"],
														"description": "Details that identify the MCP client."
													},
													"created_at": {
														"type": "number",
														"description": "Earliest time the member connected this client, in epoch milliseconds."
													},
													"is_enterprise_managed": {
														"type": "boolean",
														"description": "Whether these connections use enterprise-managed authentication."
													},
													"user": {
														"type": "object",
														"properties": {
															"id": {
																"type": "string",
																"format": "uuid"
															}
														},
														"required": ["id"],
														"description": "The member connected to the client."
													},
													"workspaces": {
														"type": "array",
														"items": {
															"type": "object",
															"properties": {
																"id": {
																	"type": "string",
																	"format": "uuid"
																}
															},
															"required": ["id"]
														},
														"description": "Workspaces where the member and client have matching connection settings."
													},
													"idp_issuer": {
														"type": "string",
														"description": "Identity provider issuer URL. Present only for enterprise-managed connections."
													},
													"last_active_at": {
														"type": "number",
														"description": "Most recent time the member used the connection, in epoch milliseconds."
													}
												},
												"required": [
													"client",
													"created_at",
													"is_enterprise_managed",
													"user",
													"workspaces"
												]
											},
											"description": "MCP client connections grouped by member, client, and connection settings."
										},
										"next_cursor": {
											"type": "string",
											"description": "Cursor for the next page. Present only when 'has_more' is true."
										}
									},
									"required": ["has_more", "results"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/mcp_client_connections/enterprise_managed_access": {
			"put": {
				"summary": "Deny or restore enterprise-managed MCP client access",
				"operationId": "update-mcp-client-connection-enterprise-managed-access",
				"x-scopes": ["mcp-client-connection:write-high-impact"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"access": {
										"type": "string",
										"enum": ["allowed", "denied"],
										"description": "'denied' blocks access; 'allowed' restores access."
									},
									"user_id": {
										"type": "string",
										"format": "uuid"
									},
									"workspace_id": {
										"type": "string",
										"format": "uuid"
									}
								},
								"required": ["access", "user_id", "workspace_id"]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"access": {
											"type": "string",
											"enum": ["allowed", "denied"],
											"description": "Access state applied to the member."
										},
										"revoked_token_count": {
											"type": "number",
											"description": "Number of active tokens revoked. Always zero when restoring access."
										}
									},
									"required": ["access", "revoked_token_count"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/mcp_client_connections/revoke": {
			"post": {
				"summary": "Revoke an MCP client connection",
				"operationId": "revoke-mcp-client-connection",
				"x-scopes": ["mcp-client-connection:write-high-impact"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"client_key": {
										"type": "string",
										"description": "Stable client key returned by the list endpoint."
									},
									"user_id": {
										"type": "string",
										"format": "uuid"
									},
									"workspace_id": {
										"type": "string",
										"format": "uuid"
									}
								},
								"required": ["client_key", "user_id", "workspace_id"]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"revoked_token_count": {
											"type": "number",
											"description": "Number of active tokens revoked."
										}
									},
									"required": ["revoked_token_count"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/groups/{group_id}": {
			"get": {
				"summary": "Retrieve a group",
				"operationId": "retrieve-permission-group",
				"x-scopes": ["permission-group:read"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "group_id",
						"in": "path",
						"required": true,
						"schema": {
							"$ref": "#/components/schemas/idRequest",
							"description": "The ID of the group."
						}
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"object": {
											"type": "string",
											"const": "group",
											"description": "Always `group`"
										},
										"id": {
											"type": "string",
											"description": "The ID of the group."
										},
										"name": {
											"type": "string",
											"description": "The name of the group."
										}
									},
									"required": ["object", "id", "name"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError400"
								},
								"example": {
									"object": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError401"
								},
								"example": {
									"object": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError403"
								},
								"example": {
									"object": "error",
									"code": "restricted_resource",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError404"
								},
								"example": {
									"object": "error",
									"code": "object_not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"409": {
						"description": "The request conflicts with the current state of the resource.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError409"
								},
								"example": {
									"object": "error",
									"code": "conflict_error",
									"status": 409,
									"message": "The request conflicts with the current resource state."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError429"
								},
								"example": {
									"object": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError500"
								},
								"example": {
									"object": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					},
					"503": {
						"description": "A required service is temporarily unavailable.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError503"
								},
								"example": {
									"object": "error",
									"code": "service_unavailable",
									"status": 503,
									"message": "Service temporarily unavailable."
								}
							}
						}
					}
				}
			},
			"patch": {
				"summary": "Update a group",
				"operationId": "update-permission-group",
				"x-scopes": ["permission-group:write"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "group_id",
						"in": "path",
						"required": true,
						"schema": {
							"$ref": "#/components/schemas/idRequest",
							"description": "The ID of the group."
						}
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"name": {
										"type": "string",
										"minLength": 1,
										"maxLength": 200,
										"pattern": "\\S",
										"description": "The new name of the group."
									}
								},
								"required": ["name"]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"object": {
											"type": "string",
											"const": "group",
											"description": "Always `group`"
										},
										"id": {
											"type": "string",
											"description": "The ID of the group."
										},
										"name": {
											"type": "string",
											"description": "The name of the group."
										}
									},
									"required": ["object", "id", "name"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError400"
								},
								"example": {
									"object": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError401"
								},
								"example": {
									"object": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError403"
								},
								"example": {
									"object": "error",
									"code": "restricted_resource",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError404"
								},
								"example": {
									"object": "error",
									"code": "object_not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"409": {
						"description": "The request conflicts with the current state of the resource.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError409"
								},
								"example": {
									"object": "error",
									"code": "conflict_error",
									"status": 409,
									"message": "The request conflicts with the current resource state."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError429"
								},
								"example": {
									"object": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError500"
								},
								"example": {
									"object": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					},
					"503": {
						"description": "A required service is temporarily unavailable.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError503"
								},
								"example": {
									"object": "error",
									"code": "service_unavailable",
									"status": 503,
									"message": "Service temporarily unavailable."
								}
							}
						}
					}
				}
			},
			"delete": {
				"summary": "Delete a group",
				"operationId": "delete-permission-group",
				"x-scopes": ["permission-group:write"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "group_id",
						"in": "path",
						"required": true,
						"schema": {
							"$ref": "#/components/schemas/idRequest",
							"description": "The ID of the group."
						}
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					},
					{
						"name": "transfer_to_owner_id",
						"in": "query",
						"schema": {
							"$ref": "#/components/schemas/idRequest",
							"description": "Active workspace owner who receives access that would otherwise be orphaned."
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"object": {
											"type": "string",
											"const": "group",
											"description": "Always `group`"
										},
										"id": {
											"type": "string",
											"description": "The ID of the group."
										},
										"name": {
											"type": "string",
											"description": "The name of the group."
										}
									},
									"required": ["object", "id", "name"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError400"
								},
								"example": {
									"object": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError401"
								},
								"example": {
									"object": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError403"
								},
								"example": {
									"object": "error",
									"code": "restricted_resource",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError404"
								},
								"example": {
									"object": "error",
									"code": "object_not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"409": {
						"description": "The request conflicts with the current state of the resource.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError409"
								},
								"example": {
									"object": "error",
									"code": "conflict_error",
									"status": 409,
									"message": "The request conflicts with the current resource state."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError429"
								},
								"example": {
									"object": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError500"
								},
								"example": {
									"object": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					},
					"503": {
						"description": "A required service is temporarily unavailable.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError503"
								},
								"example": {
									"object": "error",
									"code": "service_unavailable",
									"status": 503,
									"message": "Service temporarily unavailable."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/groups": {
			"get": {
				"summary": "List groups",
				"operationId": "list-permission-groups",
				"x-scopes": ["permission-group:read"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					},
					{
						"name": "page_size",
						"in": "query",
						"schema": {
							"type": "integer",
							"minimum": 1,
							"maximum": 100,
							"description": "Number of groups to return (1–100; default 100)."
						}
					},
					{
						"name": "start_cursor",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Opaque continuation cursor from a previous page."
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"object": {
											"type": "string",
											"const": "list",
											"description": "Always `list`"
										},
										"type": {
											"type": "string",
											"const": "group",
											"description": "Always `group`"
										},
										"results": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"object": {
														"type": "string",
														"const": "group",
														"description": "Always `group`"
													},
													"id": {
														"type": "string",
														"description": "The ID of the group."
													},
													"name": {
														"type": "string",
														"description": "The name of the group."
													}
												},
												"required": ["object", "id", "name"]
											},
											"maxItems": 100,
											"description": "The permission groups in the workspace."
										},
										"has_more": {
											"type": "boolean",
											"description": "Whether another page is available."
										},
										"next_cursor": {
											"oneOf": [
												{
													"type": "string"
												},
												{
													"type": "null"
												}
											],
											"description": "Cursor for the next page, or null on the last page."
										}
									},
									"required": [
										"object",
										"type",
										"results",
										"has_more",
										"next_cursor"
									]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError400"
								},
								"example": {
									"object": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError401"
								},
								"example": {
									"object": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError403"
								},
								"example": {
									"object": "error",
									"code": "restricted_resource",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError404"
								},
								"example": {
									"object": "error",
									"code": "object_not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"409": {
						"description": "The request conflicts with the current state of the resource.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError409"
								},
								"example": {
									"object": "error",
									"code": "conflict_error",
									"status": 409,
									"message": "The request conflicts with the current resource state."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError429"
								},
								"example": {
									"object": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError500"
								},
								"example": {
									"object": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					},
					"503": {
						"description": "A required service is temporarily unavailable.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError503"
								},
								"example": {
									"object": "error",
									"code": "service_unavailable",
									"status": 503,
									"message": "Service temporarily unavailable."
								}
							}
						}
					}
				}
			},
			"post": {
				"summary": "Create a group",
				"operationId": "create-permission-group",
				"x-scopes": ["permission-group:write"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"name": {
										"type": "string",
										"minLength": 1,
										"maxLength": 200,
										"pattern": "\\S",
										"description": "The name of the group."
									}
								},
								"required": ["name"]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"object": {
											"type": "string",
											"const": "group",
											"description": "Always `group`"
										},
										"id": {
											"type": "string",
											"description": "The ID of the group."
										},
										"name": {
											"type": "string",
											"description": "The name of the group."
										}
									},
									"required": ["object", "id", "name"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError400"
								},
								"example": {
									"object": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError401"
								},
								"example": {
									"object": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError403"
								},
								"example": {
									"object": "error",
									"code": "restricted_resource",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError404"
								},
								"example": {
									"object": "error",
									"code": "object_not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"409": {
						"description": "The request conflicts with the current state of the resource.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError409"
								},
								"example": {
									"object": "error",
									"code": "conflict_error",
									"status": 409,
									"message": "The request conflicts with the current resource state."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError429"
								},
								"example": {
									"object": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError500"
								},
								"example": {
									"object": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					},
					"503": {
						"description": "A required service is temporarily unavailable.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError503"
								},
								"example": {
									"object": "error",
									"code": "service_unavailable",
									"status": 503,
									"message": "Service temporarily unavailable."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces": {
			"get": {
				"summary": "List workspaces in the organization",
				"operationId": "list-spaces",
				"x-scopes": ["workspace:read"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "start_cursor",
						"in": "query",
						"schema": {
							"type": "string",
							"minLength": 1,
							"description": "Opaque continuation cursor from the previous page."
						}
					},
					{
						"name": "page_size",
						"in": "query",
						"schema": {
							"type": "integer",
							"minimum": 1,
							"maximum": 100,
							"description": "Number of workspaces per page (1–100; default 100)."
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"object": {
											"type": "string",
											"const": "list",
											"description": "Always `list`"
										},
										"type": {
											"type": "string",
											"const": "space",
											"description": "Always `space`"
										},
										"space": {
											"$ref": "#/components/schemas/emptyObject"
										},
										"results": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"object": {
														"type": "string",
														"const": "space",
														"description": "Always `space`"
													},
													"id": {
														"type": "string",
														"format": "uuid",
														"description": "The workspace ID."
													},
													"name": {
														"oneOf": [
															{
																"type": "string"
															},
															{
																"type": "null"
															}
														],
														"description": "The workspace name, or null when it has none."
													}
												},
												"additionalProperties": false,
												"required": ["object", "id", "name"]
											},
											"maxItems": 100,
											"description": "Live workspaces owned by the organization on this page, ordered by ID."
										},
										"has_more": {
											"type": "boolean",
											"description": "Whether another page of workspaces is available."
										},
										"next_cursor": {
											"oneOf": [
												{
													"type": "string"
												},
												{
													"type": "null"
												}
											],
											"description": "Opaque continuation cursor for the next page, or null when has_more is false."
										}
									},
									"additionalProperties": false,
									"required": [
										"object",
										"type",
										"space",
										"results",
										"has_more",
										"next_cursor"
									]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError400"
								},
								"example": {
									"object": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError401"
								},
								"example": {
									"object": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError403"
								},
								"example": {
									"object": "error",
									"code": "restricted_resource",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError404"
								},
								"example": {
									"object": "error",
									"code": "object_not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"409": {
						"description": "The request conflicts with the current state of the resource.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError409"
								},
								"example": {
									"object": "error",
									"code": "conflict_error",
									"status": 409,
									"message": "The request conflicts with the current resource state."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError429"
								},
								"example": {
									"object": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError500"
								},
								"example": {
									"object": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					},
					"503": {
						"description": "A required service is temporarily unavailable.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError503"
								},
								"example": {
									"object": "error",
									"code": "service_unavailable",
									"status": 503,
									"message": "Service temporarily unavailable."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/users": {
			"get": {
				"summary": "List users",
				"operationId": "list-users",
				"x-scopes": ["user:read"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					},
					{
						"name": "start_cursor",
						"in": "query",
						"schema": {
							"type": "string",
							"minLength": 1,
							"description": "Opaque continuation cursor from a previous user page."
						}
					},
					{
						"name": "page_size",
						"in": "query",
						"schema": {
							"type": "integer",
							"minimum": 1,
							"maximum": 100,
							"description": "Number of users and bots to return (1–100; default 100)."
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"object": {
											"type": "string",
											"const": "list",
											"description": "The standard list response discriminator."
										},
										"type": {
											"type": "string",
											"const": "user",
											"description": "The resource type returned in results."
										},
										"results": {
											"type": "array",
											"items": {
												"allOf": [
													{
														"type": "object",
														"properties": {
															"object": {
																"type": "string",
																"const": "user",
																"description": "The user object type name."
															},
															"id": {
																"type": "string",
																"description": "The ID of the user."
															},
															"name": {
																"oneOf": [
																	{
																		"type": "string"
																	},
																	{
																		"type": "null"
																	}
																],
																"description": "The name of the user."
															},
															"avatar_url": {
																"oneOf": [
																	{
																		"type": "string"
																	},
																	{
																		"type": "null"
																	}
																],
																"description": "The avatar URL of the user."
															}
														},
														"additionalProperties": false,
														"required": ["object", "id", "name", "avatar_url"]
													},
													{
														"oneOf": [
															{
																"type": "object",
																"properties": {
																	"type": {
																		"type": "string",
																		"const": "person",
																		"description": "Indicates this user is a person."
																	},
																	"membership_type": {
																		"type": "string",
																		"enum": [
																			"none",
																			"page_guest",
																			"restricted_member",
																			"member",
																			"membership_admin",
																			"owner"
																		],
																		"description": "The person's effective workspace membership type."
																	},
																	"person": {
																		"type": "object",
																		"properties": {
																			"email": {
																				"type": "string",
																				"description": "The email of the person."
																			}
																		},
																		"additionalProperties": false,
																		"description": "Details about the person, when the `type` of the user is `person`."
																	}
																},
																"required": [
																	"type",
																	"membership_type",
																	"person"
																],
																"title": "Person"
															},
															{
																"type": "object",
																"properties": {
																	"type": {
																		"type": "string",
																		"const": "bot",
																		"description": "Indicates this user is a bot."
																	},
																	"bot": {
																		"$ref": "#/components/schemas/emptyObject",
																		"description": "Details about the bot, when the `type` of the user is `bot`."
																	}
																},
																"required": ["type", "bot"],
																"title": "Bot"
															}
														]
													}
												]
											},
											"maxItems": 100,
											"description": "Workspace people and bots on this page."
										},
										"has_more": {
											"type": "boolean",
											"description": "Whether another page is available; equivalent to next_cursor presence."
										},
										"next_cursor": {
											"oneOf": [
												{
													"type": "string"
												},
												{
													"type": "null"
												}
											],
											"description": "Opaque continuation cursor for the next page."
										}
									},
									"additionalProperties": false,
									"required": [
										"object",
										"type",
										"results",
										"has_more",
										"next_cursor"
									]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError400"
								},
								"example": {
									"object": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError401"
								},
								"example": {
									"object": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError403"
								},
								"example": {
									"object": "error",
									"code": "restricted_resource",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError404"
								},
								"example": {
									"object": "error",
									"code": "object_not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"409": {
						"description": "The request conflicts with the current state of the resource.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError409"
								},
								"example": {
									"object": "error",
									"code": "conflict_error",
									"status": 409,
									"message": "The request conflicts with the current resource state."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError429"
								},
								"example": {
									"object": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError500"
								},
								"example": {
									"object": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					},
					"503": {
						"description": "A required service is temporarily unavailable.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError503"
								},
								"example": {
									"object": "error",
									"code": "service_unavailable",
									"status": 503,
									"message": "Service temporarily unavailable."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/users/credit_usage": {
			"get": {
				"summary": "Get credit usage for users in a space",
				"operationId": "list-user-credit-usage",
				"x-scopes": ["user:read"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					},
					{
						"name": "start_cursor",
						"in": "query",
						"schema": {
							"type": "string",
							"minLength": 1,
							"description": "Opaque continuation cursor from the previous page."
						}
					},
					{
						"name": "page_size",
						"in": "query",
						"schema": {
							"type": "integer",
							"minimum": 1,
							"maximum": 100,
							"description": "Number of people per page (1–100; default 100)."
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"object": {
											"type": "string",
											"const": "list",
											"description": "Always `list`"
										},
										"type": {
											"type": "string",
											"const": "user_credit_usage",
											"description": "Always `user_credit_usage`"
										},
										"results": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"object": {
														"type": "string",
														"const": "user_credit_usage",
														"description": "Always `user_credit_usage`"
													},
													"id": {
														"type": "string",
														"format": "uuid",
														"description": "User ID of the workspace member."
													},
													"credit_limit": {
														"oneOf": [
															{
																"type": "integer",
																"minimum": 0
															},
															{
																"type": "null"
															}
														],
														"description": "Effective credit limit on the member's Notion credits for the current billing period, or null when no limit applies. 0 when the member has no limit and can't use Notion credits until one is set."
													},
													"total_credits_used": {
														"type": "number",
														"minimum": 0,
														"description": "All-time Notion credits used by this person across every billing period, including agents they own that run on their credits (credit_source \"owner\"). Values of 1 or more are whole credits, and values below 1 have at most two significant figures. Both round down."
													},
													"metrics_period_start_ms": {
														"type": "number",
														"description": "Start of the current billing period (epoch ms, inclusive)."
													},
													"metrics_period_end_ms": {
														"type": "number",
														"description": "End of the current billing period (epoch ms, exclusive)."
													},
													"credits_used": {
														"type": "number",
														"minimum": 0,
														"description": "Notion credits used by this person in the current billing period, including agents they own that run on their credits (credit_source \"owner\"). Values of 1 or more are whole credits, and values below 1 have at most two significant figures. Both round down."
													}
												},
												"additionalProperties": false,
												"required": [
													"object",
													"id",
													"credit_limit",
													"total_credits_used",
													"metrics_period_start_ms",
													"metrics_period_end_ms",
													"credits_used"
												]
											},
											"maxItems": 100,
											"description": "Current workspace members on this page, including members with no usage, ordered by user ID."
										},
										"has_more": {
											"type": "boolean",
											"description": "Whether another page of people is available."
										},
										"next_cursor": {
											"oneOf": [
												{
													"type": "string"
												},
												{
													"type": "null"
												}
											],
											"description": "Opaque continuation cursor for the next page, or null when has_more is false."
										}
									},
									"additionalProperties": false,
									"required": [
										"object",
										"type",
										"results",
										"has_more",
										"next_cursor"
									]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError400"
								},
								"example": {
									"object": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError401"
								},
								"example": {
									"object": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError403"
								},
								"example": {
									"object": "error",
									"code": "restricted_resource",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError404"
								},
								"example": {
									"object": "error",
									"code": "object_not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"409": {
						"description": "The request conflicts with the current state of the resource.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError409"
								},
								"example": {
									"object": "error",
									"code": "conflict_error",
									"status": 409,
									"message": "The request conflicts with the current resource state."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError429"
								},
								"example": {
									"object": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError500"
								},
								"example": {
									"object": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					},
					"503": {
						"description": "A required service is temporarily unavailable.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError503"
								},
								"example": {
									"object": "error",
									"code": "service_unavailable",
									"status": 503,
									"message": "Service temporarily unavailable."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/users/{user_id}/credit_usage": {
			"get": {
				"summary": "Get credit usage for a user in a space",
				"operationId": "list-user-credit-usage-periods",
				"x-scopes": ["user:read"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "user_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid",
							"description": "User ID of the workspace member."
						}
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					},
					{
						"name": "start_cursor",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Opaque continuation cursor from the previous page."
						}
					},
					{
						"name": "page_size",
						"in": "query",
						"schema": {
							"type": "integer",
							"minimum": 1,
							"maximum": 100,
							"description": "Number of billing periods per page (1–100; default 100)."
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"object": {
											"type": "string",
											"const": "list",
											"description": "Always `list`"
										},
										"type": {
											"type": "string",
											"const": "user_credit_usage_period",
											"description": "Always `user_credit_usage_period`"
										},
										"results": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"metrics_period_start_ms": {
														"type": "number",
														"description": "Start of the billing period (epoch ms, inclusive)."
													},
													"metrics_period_end_ms": {
														"type": "number",
														"description": "End of the billing period (epoch ms, exclusive)."
													},
													"credits_used": {
														"type": "number",
														"minimum": 0,
														"description": "Notion credits used by this person in the period, including agents they own that run on their credits (credit_source \"owner\"). Values of 1 or more are whole credits, and values below 1 have at most two significant figures. Both round down."
													}
												},
												"additionalProperties": false,
												"required": [
													"metrics_period_start_ms",
													"metrics_period_end_ms",
													"credits_used"
												],
												"description": "Credits used by a person in one monthly billing period."
											},
											"maxItems": 100,
											"description": "This person's usage per monthly billing period, newest first."
										},
										"has_more": {
											"type": "boolean",
											"description": "Whether older billing periods are available."
										},
										"next_cursor": {
											"oneOf": [
												{
													"type": "string"
												},
												{
													"type": "null"
												}
											],
											"description": "Cursor for the next page of billing periods, or null when has_more is false."
										}
									},
									"additionalProperties": false,
									"required": [
										"object",
										"type",
										"results",
										"has_more",
										"next_cursor"
									]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError400"
								},
								"example": {
									"object": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError401"
								},
								"example": {
									"object": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError403"
								},
								"example": {
									"object": "error",
									"code": "restricted_resource",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError404"
								},
								"example": {
									"object": "error",
									"code": "object_not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"409": {
						"description": "The request conflicts with the current state of the resource.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError409"
								},
								"example": {
									"object": "error",
									"code": "conflict_error",
									"status": 409,
									"message": "The request conflicts with the current resource state."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError429"
								},
								"example": {
									"object": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError500"
								},
								"example": {
									"object": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					},
					"503": {
						"description": "A required service is temporarily unavailable.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError503"
								},
								"example": {
									"object": "error",
									"code": "service_unavailable",
									"status": 503,
									"message": "Service temporarily unavailable."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/groups/{group_id}/members": {
			"get": {
				"summary": "List group members",
				"operationId": "list-permission-group-members",
				"x-scopes": ["permission-group:read"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "group_id",
						"in": "path",
						"required": true,
						"schema": {
							"$ref": "#/components/schemas/idRequest",
							"description": "The ID of the group."
						}
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					},
					{
						"name": "page_size",
						"in": "query",
						"schema": {
							"type": "integer",
							"minimum": 1,
							"maximum": 100,
							"description": "Number of memberships to return (1–100; default 100)."
						}
					},
					{
						"name": "start_cursor",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Opaque continuation cursor from a previous page."
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"object": {
											"type": "string",
											"const": "list",
											"description": "Always `list`"
										},
										"type": {
											"type": "string",
											"const": "group_membership",
											"description": "Always `group_membership`"
										},
										"results": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"object": {
														"type": "string",
														"const": "group_membership",
														"description": "Always `group_membership`"
													},
													"group_id": {
														"type": "string",
														"description": "The ID of the group."
													},
													"member": {
														"type": "object",
														"properties": {
															"type": {
																"type": "string",
																"const": "user",
																"description": "Always `user`"
															},
															"user_id": {
																"type": "string",
																"description": "The ID of the user."
															}
														},
														"required": ["type", "user_id"],
														"description": "The direct user member."
													},
													"role": {
														"type": "string",
														"enum": ["owner", "member"],
														"description": "The user's role in the group."
													}
												},
												"required": ["object", "group_id", "member", "role"]
											},
											"maxItems": 100,
											"description": "The direct user memberships in the group."
										},
										"has_more": {
											"type": "boolean",
											"description": "Whether another page is available."
										},
										"next_cursor": {
											"oneOf": [
												{
													"type": "string"
												},
												{
													"type": "null"
												}
											],
											"description": "Cursor for the next page, or null on the last page."
										}
									},
									"required": [
										"object",
										"type",
										"results",
										"has_more",
										"next_cursor"
									]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError400"
								},
								"example": {
									"object": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError401"
								},
								"example": {
									"object": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError403"
								},
								"example": {
									"object": "error",
									"code": "restricted_resource",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError404"
								},
								"example": {
									"object": "error",
									"code": "object_not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"409": {
						"description": "The request conflicts with the current state of the resource.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError409"
								},
								"example": {
									"object": "error",
									"code": "conflict_error",
									"status": 409,
									"message": "The request conflicts with the current resource state."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError429"
								},
								"example": {
									"object": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError500"
								},
								"example": {
									"object": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					},
					"503": {
						"description": "A required service is temporarily unavailable.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError503"
								},
								"example": {
									"object": "error",
									"code": "service_unavailable",
									"status": 503,
									"message": "Service temporarily unavailable."
								}
							}
						}
					}
				}
			},
			"post": {
				"summary": "Add a group member",
				"operationId": "add-permission-group-member",
				"x-scopes": ["permission-group:write"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "group_id",
						"in": "path",
						"required": true,
						"schema": {
							"$ref": "#/components/schemas/idRequest",
							"description": "The ID of the group."
						}
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"member": {
										"type": "object",
										"properties": {
											"type": {
												"type": "string",
												"const": "user",
												"description": "Always `user`"
											},
											"user_id": {
												"$ref": "#/components/schemas/idRequest",
												"description": "The ID of the user."
											}
										},
										"required": ["type", "user_id"],
										"description": "The user to add as a direct member."
									},
									"role": {
										"type": "string",
										"enum": ["owner", "member"],
										"description": "The user's role in the group."
									}
								},
								"required": ["member", "role"]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"object": {
											"type": "string",
											"const": "group_membership",
											"description": "Always `group_membership`"
										},
										"group_id": {
											"type": "string",
											"description": "The ID of the group."
										},
										"member": {
											"type": "object",
											"properties": {
												"type": {
													"type": "string",
													"const": "user",
													"description": "Always `user`"
												},
												"user_id": {
													"type": "string",
													"description": "The ID of the user."
												}
											},
											"required": ["type", "user_id"],
											"description": "The direct user member."
										},
										"role": {
											"type": "string",
											"enum": ["owner", "member"],
											"description": "The user's role in the group."
										}
									},
									"required": ["object", "group_id", "member", "role"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError400"
								},
								"example": {
									"object": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError401"
								},
								"example": {
									"object": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError403"
								},
								"example": {
									"object": "error",
									"code": "restricted_resource",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError404"
								},
								"example": {
									"object": "error",
									"code": "object_not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"409": {
						"description": "The request conflicts with the current state of the resource.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError409"
								},
								"example": {
									"object": "error",
									"code": "conflict_error",
									"status": 409,
									"message": "The request conflicts with the current resource state."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError429"
								},
								"example": {
									"object": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError500"
								},
								"example": {
									"object": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					},
					"503": {
						"description": "A required service is temporarily unavailable.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError503"
								},
								"example": {
									"object": "error",
									"code": "service_unavailable",
									"status": 503,
									"message": "Service temporarily unavailable."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/groups/{group_id}/members/users/{user_id}": {
			"patch": {
				"summary": "Update a group member",
				"operationId": "update-permission-group-member",
				"x-scopes": ["permission-group:write"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "group_id",
						"in": "path",
						"required": true,
						"schema": {
							"$ref": "#/components/schemas/idRequest",
							"description": "The ID of the group."
						}
					},
					{
						"name": "user_id",
						"in": "path",
						"required": true,
						"schema": {
							"$ref": "#/components/schemas/idRequest",
							"description": "The ID of the user."
						}
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"role": {
										"type": "string",
										"enum": ["owner", "member"],
										"description": "The user's new role in the group."
									}
								},
								"required": ["role"]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"object": {
											"type": "string",
											"const": "group_membership",
											"description": "Always `group_membership`"
										},
										"group_id": {
											"type": "string",
											"description": "The ID of the group."
										},
										"member": {
											"type": "object",
											"properties": {
												"type": {
													"type": "string",
													"const": "user",
													"description": "Always `user`"
												},
												"user_id": {
													"type": "string",
													"description": "The ID of the user."
												}
											},
											"required": ["type", "user_id"],
											"description": "The direct user member."
										},
										"role": {
											"type": "string",
											"enum": ["owner", "member"],
											"description": "The user's role in the group."
										}
									},
									"required": ["object", "group_id", "member", "role"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError400"
								},
								"example": {
									"object": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError401"
								},
								"example": {
									"object": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError403"
								},
								"example": {
									"object": "error",
									"code": "restricted_resource",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError404"
								},
								"example": {
									"object": "error",
									"code": "object_not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"409": {
						"description": "The request conflicts with the current state of the resource.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError409"
								},
								"example": {
									"object": "error",
									"code": "conflict_error",
									"status": 409,
									"message": "The request conflicts with the current resource state."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError429"
								},
								"example": {
									"object": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError500"
								},
								"example": {
									"object": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					},
					"503": {
						"description": "A required service is temporarily unavailable.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError503"
								},
								"example": {
									"object": "error",
									"code": "service_unavailable",
									"status": 503,
									"message": "Service temporarily unavailable."
								}
							}
						}
					}
				}
			},
			"delete": {
				"summary": "Remove a group member",
				"operationId": "remove-permission-group-member",
				"x-scopes": ["permission-group:write"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "group_id",
						"in": "path",
						"required": true,
						"schema": {
							"$ref": "#/components/schemas/idRequest",
							"description": "The ID of the group."
						}
					},
					{
						"name": "user_id",
						"in": "path",
						"required": true,
						"schema": {
							"$ref": "#/components/schemas/idRequest",
							"description": "The ID of the user."
						}
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"object": {
											"type": "string",
											"const": "group_membership",
											"description": "Always `group_membership`"
										},
										"group_id": {
											"type": "string",
											"description": "The ID of the group."
										},
										"member": {
											"type": "object",
											"properties": {
												"type": {
													"type": "string",
													"const": "user",
													"description": "Always `user`"
												},
												"user_id": {
													"type": "string",
													"description": "The ID of the user."
												}
											},
											"required": ["type", "user_id"],
											"description": "The direct user member."
										},
										"role": {
											"type": "string",
											"enum": ["owner", "member"],
											"description": "The user's role in the group."
										}
									},
									"required": ["object", "group_id", "member", "role"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError400"
								},
								"example": {
									"object": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError401"
								},
								"example": {
									"object": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError403"
								},
								"example": {
									"object": "error",
									"code": "restricted_resource",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError404"
								},
								"example": {
									"object": "error",
									"code": "object_not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"409": {
						"description": "The request conflicts with the current state of the resource.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError409"
								},
								"example": {
									"object": "error",
									"code": "conflict_error",
									"status": 409,
									"message": "The request conflicts with the current resource state."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError429"
								},
								"example": {
									"object": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError500"
								},
								"example": {
									"object": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					},
					"503": {
						"description": "A required service is temporarily unavailable.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError503"
								},
								"example": {
									"object": "error",
									"code": "service_unavailable",
									"status": 503,
									"message": "Service temporarily unavailable."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/personal_access_tokens": {
			"get": {
				"summary": "List personal access tokens in a workspace",
				"operationId": "list-personal-access-tokens",
				"x-scopes": ["personal-access-token:read"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					},
					{
						"name": "start_cursor",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "The `next_cursor` returned by the previous page."
						}
					},
					{
						"name": "cursor",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Deprecated; use `start_cursor`.",
							"deprecated": true
						}
					},
					{
						"name": "page_size",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Number of results to return. Defaults to 100 and cannot exceed 100."
						}
					},
					{
						"name": "status",
						"in": "query",
						"schema": {
							"oneOf": [
								{
									"type": "array",
									"items": {
										"type": "string",
										"enum": ["active", "expired", "revoked"],
										"description": "One of: `active`, `expired`, `revoked`"
									}
								},
								{
									"type": "string",
									"const": "active",
									"description": "Always `active`"
								},
								{
									"type": "string",
									"const": "expired",
									"description": "Always `expired`"
								},
								{
									"type": "string",
									"const": "revoked",
									"description": "Always `revoked`"
								}
							],
							"description": "Token statuses to include. Use bracket encoding for multiple values."
						}
					},
					{
						"name": "creator_ids",
						"in": "query",
						"schema": {
							"oneOf": [
								{
									"type": "array",
									"items": {
										"type": "string",
										"format": "uuid"
									}
								},
								{
									"type": "string",
									"format": "uuid"
								}
							],
							"description": "IDs of members who created the tokens. Use bracket encoding for multiple values."
						}
					},
					{
						"name": "search",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Case-insensitive text to match against the token name."
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"results": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"id": {
														"type": "string",
														"format": "uuid"
													},
													"creator": {
														"type": "object",
														"properties": {
															"id": {
																"type": "string",
																"format": "uuid"
															},
															"name": {
																"type": "string",
																"description": "Member's name, when available."
															},
															"email": {
																"type": "string",
																"description": "Member's email address, when available."
															},
															"profile_photo_url": {
																"type": "string",
																"description": "URL of the member's profile photo, when available."
															}
														},
														"additionalProperties": false,
														"required": ["id"],
														"description": "Member who created the token."
													},
													"created_at": {
														"type": "number",
														"description": "Time the token was created, in epoch milliseconds."
													},
													"status": {
														"type": "string",
														"enum": ["active", "expired", "revoked"],
														"description": "Current token status."
													},
													"name": {
														"type": "string",
														"description": "Token name, when available."
													},
													"expires_at": {
														"type": "number",
														"description": "Time the token expires, in epoch milliseconds."
													},
													"last_used_at": {
														"type": "number",
														"description": "Most recent recorded time the token authenticated a request, in epoch milliseconds. Updated at most once per hour."
													},
													"revoked_at": {
														"type": "number",
														"description": "Time the token was revoked, in epoch milliseconds."
													},
													"revoked_by": {
														"type": "object",
														"properties": {
															"type": {
																"type": "string",
																"enum": ["bot", "organization_bot", "user"],
																"description": "Type of user or bot that revoked the token."
															},
															"id": {
																"type": "string",
																"format": "uuid"
															},
															"name": {
																"type": "string",
																"description": "Name of the user or bot, when available."
															},
															"email": {
																"type": "string",
																"description": "Email address of the user, when available."
															},
															"profile_photo_url": {
																"type": "string",
																"description": "URL of the user's or bot's profile photo, when available."
															}
														},
														"additionalProperties": false,
														"required": ["type", "id"],
														"description": "User or bot that revoked the token."
													}
												},
												"additionalProperties": false,
												"required": ["id", "creator", "created_at", "status"]
											},
											"description": "Personal access tokens in the workspace. Token values are never returned."
										},
										"has_more": {
											"type": "boolean",
											"description": "Whether another page is available."
										},
										"next_cursor": {
											"type": "string",
											"description": "Cursor for the next page. Present only when 'has_more' is true."
										}
									},
									"additionalProperties": false,
									"required": ["results", "has_more"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/personal_access_tokens/{bot_id}": {
			"delete": {
				"summary": "Revoke a personal access token in a workspace",
				"operationId": "revoke-personal-access-token",
				"x-scopes": ["personal-access-token:write-high-impact"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "bot_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {}
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/agents/creation_policy": {
			"patch": {
				"summary": "Update who can create agents in a space",
				"operationId": "update-agent-creation-policy",
				"x-scopes": ["workflows:write"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"policy": {
										"type": "string",
										"enum": [
											"all_workspace_members",
											"disabled",
											"workspace_owners_only"
										],
										"description": "One of: `all_workspace_members`, `disabled`, `workspace_owners_only`"
									},
									"disable_existing_agents": {
										"type": "boolean",
										"description": "When true, also disable all existing custom agents in the workspace. Only takes effect when policy is \"disabled\"."
									}
								},
								"required": ["policy"]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"agent_counts": {
											"type": "object",
											"properties": {
												"active": {
													"type": "number"
												},
												"deleted": {
													"type": "number"
												},
												"disabled": {
													"type": "number"
												}
											},
											"additionalProperties": false,
											"required": ["active", "deleted", "disabled"]
										},
										"current_policy": {
											"oneOf": [
												{
													"type": "string",
													"enum": [
														"all_workspace_members",
														"custom",
														"disabled",
														"workspace_owners_only"
													],
													"description": "One of: `all_workspace_members`, `custom`, `disabled`, `workspace_owners_only`"
												},
												{
													"type": "null"
												}
											],
											"description": "The policy now in effect, or null when no explicit policy has ever been set for the workspace (which behaves as the \"all_workspace_members\" default)."
										},
										"current_policy_description": {
											"type": "string"
										},
										"space_id": {
											"type": "string",
											"format": "uuid"
										},
										"space_name": {
											"type": "string"
										}
									},
									"additionalProperties": false,
									"required": [
										"agent_counts",
										"current_policy",
										"current_policy_description",
										"space_id",
										"space_name"
									]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/credit_limit": {
			"patch": {
				"summary": "Update the default agent credit limit for a workspace",
				"operationId": "update-workspace-credit-limit",
				"x-scopes": ["workflows:write"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"default_agent_credit_limit": {
										"oneOf": [
											{
												"type": "integer"
											},
											{
												"type": "null"
											}
										],
										"description": "Workspace-wide default agent credit limit, applied to agents going forward. Must be a non-negative whole number of credits; other values are rejected with a validation error. Use null to remove the workspace-wide default cap."
									}
								},
								"required": ["default_agent_credit_limit"]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"space_id": {
											"type": "string",
											"format": "uuid"
										},
										"default_agent_credit_limit": {
											"oneOf": [
												{
													"type": "integer"
												},
												{
													"type": "null"
												}
											],
											"description": "The workspace-wide default agent credit limit now in effect, or null when no default cap is set."
										}
									},
									"required": ["space_id", "default_agent_credit_limit"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/agents/{agent_id}/status": {
			"patch": {
				"summary": "Disable or re-enable an agent in a space",
				"operationId": "update-agent-status",
				"x-scopes": ["workflows:write"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "agent_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid",
							"description": "The ID of the custom agent (a UUID). The personal agent (Notion AI) is not supported."
						}
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"admin_status": {
										"type": "string",
										"enum": ["active", "disabled"],
										"description": "Set to \"active\" to re-enable an agent that was disabled through this API, or \"disabled\" to turn off a running agent."
									}
								},
								"required": ["admin_status"]
							},
							"example": {
								"admin_status": "disabled"
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"admin_status": {
											"type": "string",
											"enum": ["active", "disabled"],
											"description": "The administrative status you set (\"active\" or \"disabled\"). This is the admin-disable toggle only; it does not tell you whether the agent will actually run."
										},
										"run_status": {
											"type": "string",
											"enum": ["active", "paused"],
											"description": "Whether the agent will actually run right now, independent of the admin-disable toggle. It reflects the agent's current state, including usage-based pauses such as a credit limit or workspace credit limit. It is \"active\" only when the agent has no paused reason and will actually run, and \"paused\" whenever a paused_reason is present, whether admin-set or not. Refer to paused_reason for why the agent is paused."
										},
										"paused_reason": {
											"type": "string",
											"enum": [
												"run_limit",
												"credit_limit",
												"runaway_credit_usage",
												"workspace_credit_limit",
												"owner_allowance_limit",
												"failure_limit",
												"mark_session_failed_autopause",
												"disabled_from_workspace_settings",
												"disabled_from_workspace_settings_but_resumable",
												"disabled_from_api",
												"disabled_from_agent_settings",
												"disabled_due_to_lack_of_full_access_members",
												"disabled_due_to_lack_of_editors",
												"disabled_by_notion",
												"internal_error",
												"needs_review",
												"tool_unavailable"
											],
											"description": "The authoritative explanation for why an agent is paused (for example, \"disabled_from_workspace_settings\" or \"workspace_credit_limit\"). It is present only when run_status is \"paused\", and it is the field you must inspect to derive the agent's true state."
										}
									},
									"required": ["admin_status", "run_status"]
								},
								"example": {
									"admin_status": "disabled",
									"run_status": "paused",
									"paused_reason": "disabled_from_workspace_settings"
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/agents/{agent_id}": {
			"delete": {
				"summary": "Delete an agent in a space",
				"operationId": "delete-agent",
				"x-scopes": ["workflows:write"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "agent_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid",
							"description": "The ID of the custom agent (a UUID). The personal agent (Notion AI) is not supported."
						}
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {}
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			},
			"patch": {
				"summary": "Update an agent in a space",
				"operationId": "update-agent",
				"x-scopes": ["workflows:write"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "agent_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid",
							"description": "The agent to update."
						}
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"owner_user_id": {
										"type": "string",
										"format": "uuid",
										"description": "The new owner: a workspace member who is allowed to own custom agents. The owner gets full access to the agent. The editor credit limit is unchanged unless credit_limit_by_editor is also provided."
									},
									"credit_source": {
										"type": "string",
										"enum": ["owner", "workspace"],
										"description": "Whose credits the agent spends: its owner's (\"owner\") or the workspace's (\"workspace\"). \"owner\" requires the agent to have an owner after this request, either its current owner or owner_user_id in the same request."
									},
									"credit_limit_by_workspace_admin": {
										"oneOf": [
											{
												"type": "integer"
											},
											{
												"type": "null"
											}
										],
										"description": "The workspace admin's monthly credit limit for the agent, as a non-negative integer, or null to remove it. Editors can't set credit_limit_by_editor above it. Can't exceed the workspace credit limit, and can't be set when the agent spends its owner's credits (credit_source \"owner\" after this request). A limit at or below the agent's usage this billing period pauses it; raising or removing the limit resumes an agent paused by it."
									},
									"credit_limit_by_editor": {
										"oneOf": [
											{
												"type": "integer"
											},
											{
												"type": "null"
											}
										],
										"description": "The monthly credit limit agent editors set in the agent's settings, as a non-negative integer, or null to remove it. When the agent spends workspace credits, it can't exceed credit_limit_by_workspace_admin (after this request) or the workspace credit limit. A limit at or below the agent's usage this billing period pauses it."
									},
									"admin_status": {
										"type": "string",
										"enum": ["active", "disabled"],
										"description": "\"disabled\" turns the agent off; \"active\" turns back on an agent that was disabled by an admin or editor. Agents paused by Notion for another reason, such as a credit limit, can't be disabled or turned back on with this field. Applied after the other fields in the request, which can pause or resume the agent."
									}
								},
								"required": [],
								"additionalProperties": false
							},
							"example": {
								"credit_source": "workspace",
								"credit_limit_by_workspace_admin": 5000
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"alive": {
											"type": "boolean",
											"description": "Whether the agent is live (not soft-deleted). \"false\" for deleted agents, which are returned only when the \"deleted\" status filter is set."
										},
										"credit_source": {
											"type": "string",
											"enum": ["owner", "workspace"],
											"description": "Whose credits the agent spends: its owner's (\"owner\") or the workspace's (\"workspace\")."
										},
										"id": {
											"type": "string",
											"description": "The agent's unique identifier."
										},
										"owner_user_id": {
											"oneOf": [
												{
													"type": "string",
													"format": "uuid"
												},
												{
													"type": "null"
												}
											],
											"description": "User ID of the member who owns the agent and pays for it when credit_source is \"owner\"; null when the agent has no owner."
										},
										"space_id": {
											"type": "string",
											"format": "uuid"
										},
										"status": {
											"type": "string",
											"enum": [
												"active",
												"credit_limit",
												"deleted",
												"disabled_by_notion",
												"disabled_due_to_lack_of_editors",
												"disabled_due_to_lack_of_full_access_members",
												"disabled_from_agent_settings",
												"disabled_from_api",
												"disabled_from_workspace_settings",
												"disabled_from_workspace_settings_but_resumable",
												"failure_limit",
												"internal_error",
												"mark_session_failed_autopause",
												"needs_review",
												"owner_allowance_limit",
												"run_limit",
												"runaway_credit_usage",
												"tool_unavailable",
												"workspace_credit_limit"
											],
											"description": "The agent's current status: \"active\", \"deleted\", or a snake_case paused reason. Uses the same values as the status query filter."
										},
										"type": {
											"type": "string",
											"enum": ["custom", "database_autofill"],
											"description": "Custom agents vs database (autofill) agents."
										},
										"created_by_id": {
											"type": "string",
											"format": "uuid"
										},
										"created_by_table": {
											"type": "string",
											"enum": ["bot", "notion_user", "organization_bot"],
											"description": "The actor table of the agent's creator, such as \"notion_user\"."
										},
										"created_time": {
											"type": "number",
											"description": "Epoch ms when the agent was created."
										},
										"description": {
											"type": "string",
											"description": "The agent's description."
										},
										"icon": {
											"type": "string",
											"description": "The agent's icon."
										},
										"last_credit_usage_time": {
											"type": "number",
											"description": "Epoch ms of the agent's most recent premium-credit usage; omitted if the agent has never consumed credits."
										},
										"last_edited_by_id": {
											"type": "string",
											"format": "uuid"
										},
										"last_edited_by_table": {
											"type": "string",
											"enum": ["bot", "notion_user", "organization_bot"],
											"description": "The actor table of the agent's last editor, such as \"notion_user\"."
										},
										"last_edited_time": {
											"type": "number",
											"description": "Epoch ms when the agent was last edited."
										},
										"last_run_time": {
											"type": "number",
											"description": "Epoch ms of the agent's most recent run; omitted if the agent has never run."
										},
										"model": {
											"type": "string",
											"description": "Human-readable model name, such as \"Claude 4 Sonnet\". Omitted when the agent is set to automatically choose a model, or when no display name is available."
										},
										"modules": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"id": {
														"type": "string"
													},
													"type": {
														"type": "string"
													},
													"name": {
														"type": "string"
													},
													"resources": {
														"type": "array",
														"items": {
															"type": "object",
															"properties": {
																"actions": {
																	"type": "array",
																	"items": {
																		"type": "string"
																	},
																	"description": "Action verbs granted on these resources (read/write/search/editor/...)."
																},
																"ids": {
																	"type": "array",
																	"items": {
																		"type": "string"
																	},
																	"description": "Opaque resource identifiers the agent can act on: Slack channel/user URIs, Notion page/collection ids, GitHub repos, Drive file ids, MCP resource URIs, or \"*\" for workspace-wide access."
																},
																"kind": {
																	"type": "string",
																	"description": "Resource discriminator when the module distinguishes kinds (Notion: \"pageOrCollectionViewBlock\" | \"agent\" | \"workspacePublic\" | \"databaseProperty\"; search: \"web\" | \"helpdocs\"; MCP: \"tool\" | \"resource\"). Omitted when the module has a single implicit resource kind."
																}
															},
															"additionalProperties": false,
															"description": "A resource, or set of resources, that a module grants the agent access to. This includes the resource kind when available, resource identifiers, and granted actions."
														},
														"description": "Per-resource access this module grants the agent, such as channels, pages, repositories, files, or MCP resources, and the actions allowed on each."
													},
													"scopes": {
														"type": "array",
														"items": {
															"type": "string"
														},
														"description": "Distinct capability scopes granted to the module — the action verbs from its permission entries (e.g. Slack \"read\"/\"write\", GitHub \"search\", Notion \"reader\"/\"editor\"), aggregated across all resources for a quick overview."
													},
													"version": {
														"type": "string",
														"description": "Module version, for change tracking."
													}
												},
												"additionalProperties": false,
												"required": ["id", "type"],
												"description": "Summary of a module attached to an agent (which integration + its reach)."
											},
											"description": "The capabilities and tools the agent is allowed to use — both inside Notion and in connected apps such as Slack, the web, or MCP servers. At most 250 module summaries are returned."
										},
										"moved_to_trash_time": {
											"type": "number",
											"description": "Epoch ms when the agent was deleted; only present for deleted agents."
										},
										"name": {
											"type": "string",
											"description": "The agent's name."
										},
										"parent_id": {
											"type": "string",
											"format": "uuid"
										},
										"parent_table": {
											"type": "string",
											"enum": ["block", "space"],
											"description": "The table the agent is parented to: custom agents belong to the workspace (\"space\"); database (autofill) agents belong to their database's block (\"block\")."
										},
										"permissions": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"principal": {
														"oneOf": [
															{
																"type": "object",
																"properties": {
																	"group_id": {
																		"type": "string",
																		"format": "uuid"
																	},
																	"type": {
																		"type": "string",
																		"const": "group",
																		"description": "Always `group`"
																	}
																},
																"additionalProperties": false,
																"required": ["group_id", "type"]
															},
															{
																"type": "object",
																"properties": {
																	"type": {
																		"type": "string",
																		"const": "user",
																		"description": "Always `user`"
																	},
																	"user_id": {
																		"type": "string",
																		"format": "uuid"
																	}
																},
																"additionalProperties": false,
																"required": ["type", "user_id"]
															},
															{
																"type": "object",
																"properties": {
																	"type": {
																		"type": "string",
																		"const": "workspace",
																		"description": "Always `workspace`"
																	}
																},
																"additionalProperties": false,
																"required": ["type"]
															}
														],
														"description": "A recipient of a permission grant. \"workspace\" maps to a space-wide permission granting all workspace members the given role; guests are never covered by it."
													},
													"resolved_role": {
														"type": "string",
														"enum": [
															"comment_only",
															"edit",
															"full_access",
															"view_and_interact"
														],
														"description": "The effective role for this principal, including other grants that reach them. A comment-only grant may remain comment-only when no stronger grant applies."
													},
													"role": {
														"type": "string",
														"enum": [
															"comment_only",
															"edit",
															"full_access",
															"view_and_interact"
														],
														"description": "The role stored on this principal's agent permission item."
													}
												},
												"additionalProperties": false,
												"required": ["principal", "resolved_role", "role"],
												"description": "A principal with its stored and workspace-resolved roles."
											},
											"description": "Who the agent is shared with: each principal's stored and resolved roles, workspace grant first, at most 250 entries. Omitted for database (autofill) agents, whose sharing state is not exposed."
										}
									},
									"additionalProperties": false,
									"required": [
										"alive",
										"credit_source",
										"id",
										"owner_user_id",
										"space_id",
										"status",
										"type"
									]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError400"
								},
								"example": {
									"object": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError401"
								},
								"example": {
									"object": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError403"
								},
								"example": {
									"object": "error",
									"code": "restricted_resource",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError404"
								},
								"example": {
									"object": "error",
									"code": "object_not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"409": {
						"description": "The request conflicts with the current state of the resource.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError409"
								},
								"example": {
									"object": "error",
									"code": "conflict_error",
									"status": 409,
									"message": "The request conflicts with the current resource state."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError429"
								},
								"example": {
									"object": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError500"
								},
								"example": {
									"object": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					},
					"503": {
						"description": "A required service is temporarily unavailable.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiPublicError503"
								},
								"example": {
									"object": "error",
									"code": "service_unavailable",
									"status": 503,
									"message": "Service temporarily unavailable."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/agents": {
			"get": {
				"summary": "Get agents in a space",
				"operationId": "get-workflows-metadata-for-space",
				"x-scopes": ["workflows:read"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					},
					{
						"name": "name",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Case-insensitive substring match against the agent name or description. Every other string filter uses exact matching against its target field values."
						}
					},
					{
						"name": "created_by_ids",
						"in": "query",
						"schema": {
							"type": "array",
							"items": {
								"type": "string",
								"format": "uuid"
							},
							"description": "User IDs of agent creators to filter by."
						}
					},
					{
						"name": "created_time_from",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Inclusive lower bound on created_time, as epoch-millisecond digits. Requests with non-numeric values return a validation error."
						}
					},
					{
						"name": "created_time_to",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Inclusive upper bound on created_time, as epoch-millisecond digits. Requests with non-numeric values return a validation error."
						}
					},
					{
						"name": "last_edited_time_from",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Inclusive lower bound on last_edited_time, as epoch-millisecond digits. Requests with non-numeric values return a validation error."
						}
					},
					{
						"name": "last_edited_time_to",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Inclusive upper bound on last_edited_time, as epoch-millisecond digits. Requests with non-numeric values return a validation error."
						}
					},
					{
						"name": "credit_usage_time_from",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Epoch ms, inclusive. When either bound is set, an agent is returned only if its latest credit usage is inside the [from, to] window; agents with no in-window usage are excluded entirely, and last_credit_usage_time reflects the most recent credit usage of the agent."
						}
					},
					{
						"name": "credit_usage_time_to",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Epoch ms, inclusive. See credit_usage_time_from for the window semantics."
						}
					},
					{
						"name": "status",
						"in": "query",
						"schema": {
							"type": "array",
							"items": {
								"type": "string",
								"enum": [
									"active",
									"credit_limit",
									"deleted",
									"disabled",
									"disabled_by_notion",
									"disabled_due_to_lack_of_editors",
									"disabled_due_to_lack_of_full_access_members",
									"disabled_from_agent_settings",
									"disabled_from_api",
									"disabled_from_workspace_settings",
									"disabled_from_workspace_settings_but_resumable",
									"failure_limit",
									"internal_error",
									"mark_session_failed_autopause",
									"needs_review",
									"run_limit",
									"runaway_credit_usage",
									"tool_unavailable",
									"workspace_credit_limit"
								],
								"description": "One of: `active`, `credit_limit`, `deleted`, `disabled`, `disabled_by_notion`, `disabled_due_to_lack_of_editors`, `disabled_due_to_lack_of_full_access_members`, `disabled_from_agent_settings`, `disabled_from_api`, `disabled_from_workspace_settings`, `disabled_from_workspace_settings_but_resumable`, `failure_limit`, `internal_error`, `mark_session_failed_autopause`, `needs_review`, `run_limit`, `runaway_credit_usage`, `tool_unavailable`, `workspace_credit_limit`"
							},
							"description": "Status filter. Accepts every response status value, plus the \"disabled\" convenience bucket for admin-disabled agents."
						}
					},
					{
						"name": "integration_types",
						"in": "query",
						"schema": {
							"type": "array",
							"items": {
								"type": "string"
							},
							"description": "Integration types to filter by, such as \"slack\", \"github\", or \"mcpServer\"."
						}
					},
					{
						"name": "mcp_server_names",
						"in": "query",
						"schema": {
							"type": "array",
							"items": {
								"type": "string"
							},
							"description": "MCP server names to filter by."
						}
					},
					{
						"name": "models",
						"in": "query",
						"schema": {
							"type": "array",
							"items": {
								"type": "string"
							},
							"description": "Agent models to filter by. Accepts model display names (such as \"Claude 4 Sonnet\") as shown in the response model field."
						}
					},
					{
						"name": "shared_with_user_ids",
						"in": "query",
						"schema": {
							"type": "array",
							"items": {
								"type": "string",
								"format": "uuid"
							},
							"description": "Filter to agents shared with any of these user IDs. Matches custom agents only: database (autofill) agents are excluded whenever this filter is set, since their sharing state is not exposed."
						}
					},
					{
						"name": "shared_with_group_ids",
						"in": "query",
						"schema": {
							"type": "array",
							"items": {
								"type": "string",
								"format": "uuid"
							},
							"description": "Filter to agents shared with any of these group IDs. Matches custom agents only: database (autofill) agents are excluded whenever this filter is set, since their sharing state is not exposed."
						}
					},
					{
						"name": "cursor",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Pagination cursor returned from a previous response's next_cursor."
						}
					},
					{
						"name": "page_size",
						"in": "query",
						"schema": {
							"type": "integer",
							"minimum": 1,
							"maximum": 100,
							"description": "Number of agents per page. Defaults to 25, maximum 100."
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"has_more": {
											"type": "boolean"
										},
										"results": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"alive": {
														"type": "boolean",
														"description": "Whether the agent is live (not soft-deleted). \"false\" for deleted agents, which are returned only when the \"deleted\" status filter is set."
													},
													"credit_source": {
														"type": "string",
														"enum": ["owner", "workspace"],
														"description": "Whose credits the agent spends: its owner's (\"owner\") or the workspace's (\"workspace\")."
													},
													"id": {
														"type": "string",
														"description": "The agent's unique identifier."
													},
													"owner_user_id": {
														"oneOf": [
															{
																"type": "string",
																"format": "uuid"
															},
															{
																"type": "null"
															}
														],
														"description": "User ID of the member who owns the agent and pays for it when credit_source is \"owner\"; null when the agent has no owner."
													},
													"space_id": {
														"type": "string",
														"format": "uuid"
													},
													"status": {
														"type": "string",
														"enum": [
															"active",
															"credit_limit",
															"deleted",
															"disabled_by_notion",
															"disabled_due_to_lack_of_editors",
															"disabled_due_to_lack_of_full_access_members",
															"disabled_from_agent_settings",
															"disabled_from_api",
															"disabled_from_workspace_settings",
															"disabled_from_workspace_settings_but_resumable",
															"failure_limit",
															"internal_error",
															"mark_session_failed_autopause",
															"needs_review",
															"owner_allowance_limit",
															"run_limit",
															"runaway_credit_usage",
															"tool_unavailable",
															"workspace_credit_limit"
														],
														"description": "The agent's current status: \"active\", \"deleted\", or a snake_case paused reason. Uses the same values as the status query filter."
													},
													"type": {
														"type": "string",
														"enum": ["custom", "database_autofill"],
														"description": "Custom agents vs database (autofill) agents."
													},
													"created_by_id": {
														"type": "string",
														"format": "uuid"
													},
													"created_by_table": {
														"type": "string",
														"enum": ["bot", "notion_user", "organization_bot"],
														"description": "The actor table of the agent's creator, such as \"notion_user\"."
													},
													"created_time": {
														"type": "number",
														"description": "Epoch ms when the agent was created."
													},
													"description": {
														"type": "string",
														"description": "The agent's description."
													},
													"icon": {
														"type": "string",
														"description": "The agent's icon."
													},
													"last_credit_usage_time": {
														"type": "number",
														"description": "Epoch ms of the agent's most recent premium-credit usage; omitted if the agent has never consumed credits."
													},
													"last_edited_by_id": {
														"type": "string",
														"format": "uuid"
													},
													"last_edited_by_table": {
														"type": "string",
														"enum": ["bot", "notion_user", "organization_bot"],
														"description": "The actor table of the agent's last editor, such as \"notion_user\"."
													},
													"last_edited_time": {
														"type": "number",
														"description": "Epoch ms when the agent was last edited."
													},
													"last_run_time": {
														"type": "number",
														"description": "Epoch ms of the agent's most recent run; omitted if the agent has never run."
													},
													"model": {
														"type": "string",
														"description": "Human-readable model name, such as \"Claude 4 Sonnet\". Omitted when the agent is set to automatically choose a model, or when no display name is available."
													},
													"modules": {
														"type": "array",
														"items": {
															"type": "object",
															"properties": {
																"id": {
																	"type": "string"
																},
																"type": {
																	"type": "string"
																},
																"name": {
																	"type": "string"
																},
																"resources": {
																	"type": "array",
																	"items": {
																		"type": "object",
																		"properties": {
																			"actions": {
																				"type": "array",
																				"items": {
																					"type": "string"
																				},
																				"description": "Action verbs granted on these resources (read/write/search/editor/...)."
																			},
																			"ids": {
																				"type": "array",
																				"items": {
																					"type": "string"
																				},
																				"description": "Opaque resource identifiers the agent can act on: Slack channel/user URIs, Notion page/collection ids, GitHub repos, Drive file ids, MCP resource URIs, or \"*\" for workspace-wide access."
																			},
																			"kind": {
																				"type": "string",
																				"description": "Resource discriminator when the module distinguishes kinds (Notion: \"pageOrCollectionViewBlock\" | \"agent\" | \"workspacePublic\" | \"databaseProperty\"; search: \"web\" | \"helpdocs\"; MCP: \"tool\" | \"resource\"). Omitted when the module has a single implicit resource kind."
																			}
																		},
																		"additionalProperties": false,
																		"description": "A resource, or set of resources, that a module grants the agent access to. This includes the resource kind when available, resource identifiers, and granted actions."
																	},
																	"description": "Per-resource access this module grants the agent, such as channels, pages, repositories, files, or MCP resources, and the actions allowed on each."
																},
																"scopes": {
																	"type": "array",
																	"items": {
																		"type": "string"
																	},
																	"description": "Distinct capability scopes granted to the module — the action verbs from its permission entries (e.g. Slack \"read\"/\"write\", GitHub \"search\", Notion \"reader\"/\"editor\"), aggregated across all resources for a quick overview."
																},
																"version": {
																	"type": "string",
																	"description": "Module version, for change tracking."
																}
															},
															"additionalProperties": false,
															"required": ["id", "type"],
															"description": "Summary of a module attached to an agent (which integration + its reach)."
														},
														"description": "The capabilities and tools the agent is allowed to use — both inside Notion and in connected apps such as Slack, the web, or MCP servers. At most 250 module summaries are returned."
													},
													"moved_to_trash_time": {
														"type": "number",
														"description": "Epoch ms when the agent was deleted; only present for deleted agents."
													},
													"name": {
														"type": "string",
														"description": "The agent's name."
													},
													"parent_id": {
														"type": "string",
														"format": "uuid"
													},
													"parent_table": {
														"type": "string",
														"enum": ["block", "space"],
														"description": "The table the agent is parented to: custom agents belong to the workspace (\"space\"); database (autofill) agents belong to their database's block (\"block\")."
													},
													"permissions": {
														"type": "array",
														"items": {
															"type": "object",
															"properties": {
																"principal": {
																	"oneOf": [
																		{
																			"type": "object",
																			"properties": {
																				"group_id": {
																					"type": "string",
																					"format": "uuid"
																				},
																				"type": {
																					"type": "string",
																					"const": "group",
																					"description": "Always `group`"
																				}
																			},
																			"additionalProperties": false,
																			"required": ["group_id", "type"]
																		},
																		{
																			"type": "object",
																			"properties": {
																				"type": {
																					"type": "string",
																					"const": "user",
																					"description": "Always `user`"
																				},
																				"user_id": {
																					"type": "string",
																					"format": "uuid"
																				}
																			},
																			"additionalProperties": false,
																			"required": ["type", "user_id"]
																		},
																		{
																			"type": "object",
																			"properties": {
																				"type": {
																					"type": "string",
																					"const": "workspace",
																					"description": "Always `workspace`"
																				}
																			},
																			"additionalProperties": false,
																			"required": ["type"]
																		}
																	],
																	"description": "A recipient of a permission grant. \"workspace\" maps to a space-wide permission granting all workspace members the given role; guests are never covered by it."
																},
																"resolved_role": {
																	"type": "string",
																	"enum": [
																		"comment_only",
																		"edit",
																		"full_access",
																		"view_and_interact"
																	],
																	"description": "The effective role for this principal, including other grants that reach them. A comment-only grant may remain comment-only when no stronger grant applies."
																},
																"role": {
																	"type": "string",
																	"enum": [
																		"comment_only",
																		"edit",
																		"full_access",
																		"view_and_interact"
																	],
																	"description": "The role stored on this principal's agent permission item."
																}
															},
															"additionalProperties": false,
															"required": [
																"principal",
																"resolved_role",
																"role"
															],
															"description": "A principal with its stored and workspace-resolved roles."
														},
														"description": "Who the agent is shared with: each principal's stored and resolved roles, workspace grant first, at most 250 entries. Omitted for database (autofill) agents, whose sharing state is not exposed."
													}
												},
												"additionalProperties": false,
												"required": [
													"alive",
													"credit_source",
													"id",
													"owner_user_id",
													"space_id",
													"status",
													"type"
												]
											},
											"description": "The page of agents matching the filters, up to 100. Permanently deleted tombstones are excluded."
										},
										"next_cursor": {
											"type": "string"
										}
									},
									"additionalProperties": false,
									"required": ["has_more", "results"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/agents/{agent_id}/credit_usage": {
			"get": {
				"summary": "Get credit usage for an agent in a space",
				"operationId": "get-agent-credit-usage",
				"x-scopes": ["workflows:read"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "agent_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid",
							"description": "The ID of a custom agent or database Autofill agent."
						}
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					},
					{
						"name": "start_cursor",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Pagination cursor returned from a previous response's next_cursor; paginates credit_per_billing_period_list (newest period first)."
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"credit_per_billing_period_list": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"credits_used": {
														"type": "number",
														"description": "Premium AI credits consumed by the agent in this period. Values of 1 or more are whole credits, and values below 1 have at most two significant figures. Both round down."
													},
													"metrics_period_end_ms": {
														"type": "number",
														"description": "End of the billing period (epoch ms, exclusive)."
													},
													"metrics_period_start_ms": {
														"type": "number",
														"description": "Start of the billing period (epoch ms, inclusive)."
													}
												},
												"additionalProperties": false,
												"required": [
													"credits_used",
													"metrics_period_end_ms",
													"metrics_period_start_ms"
												],
												"description": "Premium AI credits consumed by an agent in one monthly billing period."
											}
										},
										"credit_source": {
											"type": "string",
											"enum": ["owner", "workspace"],
											"description": "Whose credits the agent spends: its owner's (\"owner\") or the workspace's (\"workspace\")."
										},
										"has_more": {
											"type": "boolean",
											"description": "Whether more billing periods are available."
										},
										"id": {
											"type": "string",
											"format": "uuid"
										},
										"object": {
											"type": "string",
											"const": "agent_credit_usage",
											"description": "Always `agent_credit_usage`"
										},
										"owner_user_id": {
											"oneOf": [
												{
													"type": "string",
													"format": "uuid"
												},
												{
													"type": "null"
												}
											],
											"description": "User ID of the member who owns the agent and pays for it when credit_source is \"owner\"; null when the agent has no owner."
										},
										"runs_completed": {
											"type": "number",
											"description": "All-time count of finished (success or failure) runs for this agent."
										},
										"status": {
											"type": "string",
											"enum": [
												"active",
												"credit_limit",
												"deleted",
												"disabled_by_notion",
												"disabled_due_to_lack_of_editors",
												"disabled_due_to_lack_of_full_access_members",
												"disabled_from_agent_settings",
												"disabled_from_api",
												"disabled_from_workspace_settings",
												"disabled_from_workspace_settings_but_resumable",
												"failure_limit",
												"internal_error",
												"mark_session_failed_autopause",
												"needs_review",
												"owner_allowance_limit",
												"run_limit",
												"runaway_credit_usage",
												"tool_unavailable",
												"workspace_credit_limit"
											],
											"description": "Agent status; same values as the list-agents endpoint's status field."
										},
										"total_credits_used": {
											"type": "number",
											"description": "All-time premium AI credits consumed by this agent across every period. Values of 1 or more are whole credits, and values below 1 have at most two significant figures. Both round down."
										},
										"type": {
											"type": "string",
											"enum": ["custom", "database_autofill"],
											"description": "Custom agents vs database (autofill) agents."
										},
										"created_by_id": {
											"type": "string",
											"format": "uuid"
										},
										"credit_limit": {
											"type": "integer",
											"description": "Credit limit enforced on the agent for its credit source, if any. Owner-funded agents only honor the limit set by the agent's editors."
										},
										"last_credit_usage_time": {
											"type": "number",
											"description": "Epoch ms of the agent's most recent premium-credit usage; omitted if the agent has never consumed credits."
										},
										"name": {
											"type": "string"
										},
										"next_cursor": {
											"type": "string",
											"description": "Cursor to fetch the next page of credit_per_billing_period_list; omitted when has_more is false."
										}
									},
									"additionalProperties": false,
									"required": [
										"credit_per_billing_period_list",
										"credit_source",
										"has_more",
										"id",
										"object",
										"owner_user_id",
										"runs_completed",
										"status",
										"total_credits_used",
										"type"
									]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/agents/{agent_id}/permissions": {
			"get": {
				"summary": "Get a custom agent's sharing permissions",
				"operationId": "get-agent-permissions",
				"x-scopes": ["workflows:read"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "agent_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid",
							"description": "The custom agent whose permissions to return."
						}
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					},
					{
						"name": "cursor",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Opaque pagination cursor from a prior response's next_cursor."
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"permissions": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"principal": {
														"oneOf": [
															{
																"type": "object",
																"properties": {
																	"group_id": {
																		"type": "string",
																		"format": "uuid"
																	},
																	"type": {
																		"type": "string",
																		"const": "group",
																		"description": "Always `group`"
																	}
																},
																"additionalProperties": false,
																"required": ["group_id", "type"]
															},
															{
																"type": "object",
																"properties": {
																	"type": {
																		"type": "string",
																		"const": "user",
																		"description": "Always `user`"
																	},
																	"user_id": {
																		"type": "string",
																		"format": "uuid"
																	}
																},
																"additionalProperties": false,
																"required": ["type", "user_id"]
															},
															{
																"type": "object",
																"properties": {
																	"type": {
																		"type": "string",
																		"const": "workspace",
																		"description": "Always `workspace`"
																	}
																},
																"additionalProperties": false,
																"required": ["type"]
															}
														],
														"description": "A recipient of a permission grant. \"workspace\" maps to a space-wide permission granting all workspace members the given role; guests are never covered by it."
													},
													"resolved_role": {
														"type": "string",
														"enum": [
															"comment_only",
															"edit",
															"full_access",
															"view_and_interact"
														],
														"description": "The effective role for this principal, including other grants that reach them. A comment-only grant may remain comment-only when no stronger grant applies."
													},
													"role": {
														"type": "string",
														"enum": [
															"comment_only",
															"edit",
															"full_access",
															"view_and_interact"
														],
														"description": "The role stored on this principal's agent permission item."
													}
												},
												"additionalProperties": false,
												"required": ["principal", "resolved_role", "role"],
												"description": "A principal with its stored and workspace-resolved roles."
											},
											"description": "The page of permission entries, up to 250 per request. The workspace-wide grant always sorts first, then groups, then users."
										},
										"next_cursor": {
											"type": "string",
											"description": "Cursor to pass as cursor to fetch the next page; omitted on the last."
										}
									},
									"additionalProperties": false,
									"required": ["permissions"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			},
			"patch": {
				"summary": "Update a custom agent's sharing permissions",
				"operationId": "update-agent-permissions",
				"x-scopes": ["workflows:write"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "agent_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid",
							"description": "The custom agent whose permissions to update."
						}
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"set": {
										"type": "array",
										"items": {
											"type": "object",
											"properties": {
												"principal": {
													"oneOf": [
														{
															"type": "object",
															"properties": {
																"group_id": {
																	"type": "string",
																	"format": "uuid"
																},
																"type": {
																	"type": "string",
																	"const": "group",
																	"description": "Always `group`"
																}
															},
															"additionalProperties": false,
															"required": ["group_id", "type"]
														},
														{
															"type": "object",
															"properties": {
																"type": {
																	"type": "string",
																	"const": "user",
																	"description": "Always `user`"
																},
																"user_id": {
																	"type": "string",
																	"format": "uuid"
																}
															},
															"additionalProperties": false,
															"required": ["type", "user_id"]
														},
														{
															"type": "object",
															"properties": {
																"type": {
																	"type": "string",
																	"const": "workspace",
																	"description": "Always `workspace`"
																}
															},
															"additionalProperties": false,
															"required": ["type"]
														}
													],
													"description": "A recipient of a permission grant. \"workspace\" maps to a space-wide permission granting all workspace members the given role; guests are never covered by it."
												},
												"role": {
													"type": "string",
													"enum": ["edit", "full_access", "view_and_interact"],
													"description": "One of: `edit`, `full_access`, `view_and_interact`"
												}
											},
											"additionalProperties": false,
											"required": ["principal", "role"],
											"description": "A single upsert: grant principal the given role (creating or updating it)."
										},
										"description": "Principals to grant permissions to, or update the level for."
									},
									"remove": {
										"type": "array",
										"items": {
											"oneOf": [
												{
													"type": "object",
													"properties": {
														"group_id": {
															"type": "string",
															"format": "uuid"
														},
														"type": {
															"type": "string",
															"const": "group",
															"description": "Always `group`"
														}
													},
													"additionalProperties": false,
													"required": ["group_id", "type"]
												},
												{
													"type": "object",
													"properties": {
														"type": {
															"type": "string",
															"const": "user",
															"description": "Always `user`"
														},
														"user_id": {
															"type": "string",
															"format": "uuid"
														}
													},
													"additionalProperties": false,
													"required": ["type", "user_id"]
												},
												{
													"type": "object",
													"properties": {
														"type": {
															"type": "string",
															"const": "workspace",
															"description": "Always `workspace`"
														}
													},
													"additionalProperties": false,
													"required": ["type"]
												}
											],
											"description": "A recipient of a permission grant. \"workspace\" maps to a space-wide permission granting all workspace members the given role; guests are never covered by it."
										},
										"description": "Principals to revoke permissions for."
									}
								},
								"required": [],
								"additionalProperties": false
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"permissions": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"principal": {
														"oneOf": [
															{
																"type": "object",
																"properties": {
																	"group_id": {
																		"type": "string",
																		"format": "uuid"
																	},
																	"type": {
																		"type": "string",
																		"const": "group",
																		"description": "Always `group`"
																	}
																},
																"additionalProperties": false,
																"required": ["group_id", "type"]
															},
															{
																"type": "object",
																"properties": {
																	"type": {
																		"type": "string",
																		"const": "user",
																		"description": "Always `user`"
																	},
																	"user_id": {
																		"type": "string",
																		"format": "uuid"
																	}
																},
																"additionalProperties": false,
																"required": ["type", "user_id"]
															},
															{
																"type": "object",
																"properties": {
																	"type": {
																		"type": "string",
																		"const": "workspace",
																		"description": "Always `workspace`"
																	}
																},
																"additionalProperties": false,
																"required": ["type"]
															}
														],
														"description": "A recipient of a permission grant. \"workspace\" maps to a space-wide permission granting all workspace members the given role; guests are never covered by it."
													},
													"resolved_role": {
														"type": "string",
														"enum": [
															"comment_only",
															"edit",
															"full_access",
															"view_and_interact"
														],
														"description": "The effective role for this principal, including other grants that reach them. A comment-only grant may remain comment-only when no stronger grant applies."
													},
													"role": {
														"type": "string",
														"enum": [
															"comment_only",
															"edit",
															"full_access",
															"view_and_interact"
														],
														"description": "The role stored on this principal's agent permission item."
													}
												},
												"additionalProperties": false,
												"required": ["principal", "resolved_role", "role"],
												"description": "A principal with its stored and workspace-resolved roles."
											},
											"description": "The updated permission list, in the same shape as the read endpoint. This is a pre-commit projection truncated at 250 entries with no cursor; treat the paginated read endpoint as the source of truth."
										}
									},
									"additionalProperties": false,
									"required": ["permissions"]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/agents/credit_usage": {
			"get": {
				"summary": "Get credit usage for agents in a space",
				"operationId": "get-agents-credit-usage",
				"x-scopes": ["workflows:read"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					},
					{
						"name": "start_cursor",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "next_cursor from a previous response, to fetch the next page of agents. Nested cursors continue one agent's billing periods through the single-agent endpoint."
						}
					},
					{
						"name": "cursor",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Deprecated alias for start_cursor. If both are set, they must match."
						}
					},
					{
						"name": "page_size",
						"in": "query",
						"schema": {
							"type": "integer",
							"minimum": 1,
							"maximum": 100,
							"description": "Number of agents per page. Defaults to 100, maximum 100."
						}
					},
					{
						"name": "include_deleted",
						"in": "query",
						"schema": {
							"type": "string",
							"enum": ["false", "true"],
							"description": "Set to \"true\" to include soft-deleted and permanently deleted agents with retained credit usage; included deleted agents have status \"deleted\". Omit this parameter or set it to \"false\" to return only live agents."
						}
					},
					{
						"name": "credit_usage_time_from",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Epoch ms, inclusive. When either bound is set, an agent is returned only if its latest credit usage is inside the [from, to] window; agents with no in-window usage are excluded entirely, and last_credit_usage_time on each result reflects the most recent credit usage within the window."
						}
					},
					{
						"name": "credit_usage_time_to",
						"in": "query",
						"schema": {
							"type": "string",
							"description": "Epoch ms, inclusive. See credit_usage_time_from for the window semantics."
						}
					}
				],
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"object": {
											"type": "string",
											"const": "list",
											"description": "Always `list`"
										},
										"type": {
											"type": "string",
											"const": "agent_credit_usage",
											"description": "Always `agent_credit_usage`"
										},
										"has_more": {
											"type": "boolean",
											"description": "Whether more agents are available."
										},
										"results": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"credit_per_billing_period_list": {
														"type": "array",
														"items": {
															"type": "object",
															"properties": {
																"credits_used": {
																	"type": "number",
																	"description": "Premium AI credits consumed by the agent in this period. Values of 1 or more are whole credits, and values below 1 have at most two significant figures. Both round down."
																},
																"metrics_period_end_ms": {
																	"type": "number",
																	"description": "End of the billing period (epoch ms, exclusive)."
																},
																"metrics_period_start_ms": {
																	"type": "number",
																	"description": "Start of the billing period (epoch ms, inclusive)."
																}
															},
															"additionalProperties": false,
															"required": [
																"credits_used",
																"metrics_period_end_ms",
																"metrics_period_start_ms"
															],
															"description": "Premium AI credits consumed by an agent in one monthly billing period."
														}
													},
													"credit_source": {
														"type": "string",
														"enum": ["owner", "workspace"],
														"description": "Whose credits the agent spends: its owner's (\"owner\") or the workspace's (\"workspace\")."
													},
													"has_more": {
														"type": "boolean",
														"description": "Whether more billing periods are available."
													},
													"id": {
														"type": "string",
														"format": "uuid"
													},
													"object": {
														"type": "string",
														"const": "agent_credit_usage",
														"description": "Always `agent_credit_usage`"
													},
													"owner_user_id": {
														"oneOf": [
															{
																"type": "string",
																"format": "uuid"
															},
															{
																"type": "null"
															}
														],
														"description": "User ID of the member who owns the agent and pays for it when credit_source is \"owner\"; null when the agent has no owner."
													},
													"runs_completed": {
														"type": "number",
														"description": "All-time count of finished (success or failure) runs for this agent."
													},
													"status": {
														"type": "string",
														"enum": [
															"active",
															"credit_limit",
															"deleted",
															"disabled_by_notion",
															"disabled_due_to_lack_of_editors",
															"disabled_due_to_lack_of_full_access_members",
															"disabled_from_agent_settings",
															"disabled_from_api",
															"disabled_from_workspace_settings",
															"disabled_from_workspace_settings_but_resumable",
															"failure_limit",
															"internal_error",
															"mark_session_failed_autopause",
															"needs_review",
															"owner_allowance_limit",
															"run_limit",
															"runaway_credit_usage",
															"tool_unavailable",
															"workspace_credit_limit"
														],
														"description": "Agent status; same values as the list-agents endpoint's status field."
													},
													"total_credits_used": {
														"type": "number",
														"description": "All-time premium AI credits consumed by this agent across every period. Values of 1 or more are whole credits, and values below 1 have at most two significant figures. Both round down."
													},
													"type": {
														"type": "string",
														"enum": ["custom", "database_autofill"],
														"description": "Custom agents vs database (autofill) agents."
													},
													"created_by_id": {
														"type": "string",
														"format": "uuid"
													},
													"credit_limit": {
														"type": "integer",
														"description": "Credit limit enforced on the agent for its credit source, if any. Owner-funded agents only honor the limit set by the agent's editors."
													},
													"last_credit_usage_time": {
														"type": "number",
														"description": "Epoch ms of the agent's most recent premium-credit usage; omitted if the agent has never consumed credits."
													},
													"name": {
														"type": "string"
													},
													"next_cursor": {
														"type": "string",
														"description": "Cursor to fetch the next page of credit_per_billing_period_list; omitted when has_more is false."
													}
												},
												"additionalProperties": false,
												"required": [
													"credit_per_billing_period_list",
													"credit_source",
													"has_more",
													"id",
													"object",
													"owner_user_id",
													"runs_completed",
													"status",
													"total_credits_used",
													"type"
												]
											},
											"description": "The page of agents with their credit usage, up to 100 agents per request. Every agent starts at its most recent billing period; a nested result's next_cursor paginates that agent's billing periods through the single-agent credit-usage endpoint."
										},
										"next_cursor": {
											"oneOf": [
												{
													"type": "string"
												},
												{
													"type": "null"
												}
											],
											"description": "Cursor to pass as start_cursor on the next request to fetch the next page of agents; null when has_more is false."
										}
									},
									"additionalProperties": false,
									"required": [
										"object",
										"type",
										"has_more",
										"results",
										"next_cursor"
									]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		},
		"/v1/spaces/{space_id}/agents/{agent_id}/credit_limit": {
			"put": {
				"summary": "Update credit limit for an agent in a space",
				"operationId": "update-agent-credit-limit",
				"x-scopes": ["workflows:write"],
				"tags": ["Admin API"],
				"parameters": [
					{
						"$ref": "#/components/parameters/notionVersion"
					},
					{
						"name": "agent_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid",
							"description": "The ID of the custom agent (a UUID). The personal agent (Notion AI) is not supported."
						}
					},
					{
						"name": "space_id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"format": "uuid"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"credit_limit": {
										"oneOf": [
											{
												"type": "integer"
											},
											{
												"type": "null"
											}
										],
										"description": "The per-agent credit limit as a non-negative integer, or null to clear the limit."
									}
								},
								"required": ["credit_limit"]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"credit_limit_by_workspace_admin": {
											"oneOf": [
												{
													"type": "integer"
												},
												{
													"type": "null"
												}
											],
											"description": "The workspace admin credit limit after the change, or `null` if no workspace admin limit applies."
										},
										"enforced_credit_limit": {
											"oneOf": [
												{
													"type": "integer"
												},
												{
													"type": "null"
												}
											],
											"description": "The credit limit that applies to the agent after the change. This is the lower of the workspace admin limit and the limit set by the agent creator. The workspace default applies if neither limit is set. `null` means no limit applies."
										},
										"current_credit_usage": {
											"oneOf": [
												{
													"type": "number"
												},
												{
													"type": "null"
												}
											],
											"description": "The agent's credit usage in the current billing period, or `null` if the billing period is unknown. Values of 1 or more are whole credits, and values below 1 have at most two significant figures. Both round down."
										},
										"did_clear_paused_state": {
											"type": "boolean",
											"description": "Whether this change resumed the agent after a credit-limit or runaway-credit-usage pause."
										},
										"is_active": {
											"type": "boolean",
											"description": "Whether the agent is active after the change. `false` can mean this change paused the agent or that the agent was already paused for another reason."
										}
									},
									"additionalProperties": false,
									"required": [
										"credit_limit_by_workspace_admin",
										"enforced_credit_limit",
										"current_credit_usage",
										"did_clear_paused_state",
										"is_active"
									]
								}
							}
						}
					},
					"400": {
						"description": "The request body, path parameters, or query parameters are invalid.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError400"
								},
								"example": {
									"type": "error",
									"code": "validation_error",
									"status": 400,
									"message": "The request body is invalid."
								}
							}
						}
					},
					"401": {
						"description": "The request is missing a valid bearer token.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError401"
								},
								"example": {
									"type": "error",
									"code": "unauthorized",
									"status": 401,
									"message": "Unauthorized."
								}
							}
						}
					},
					"403": {
						"description": "The authenticated bot does not have access to the requested resource or scope.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError403"
								},
								"example": {
									"type": "error",
									"code": "forbidden",
									"status": 403,
									"message": "Forbidden."
								}
							}
						}
					},
					"404": {
						"description": "The requested resource could not be found.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError404"
								},
								"example": {
									"type": "error",
									"code": "not_found",
									"status": 404,
									"message": "Not found."
								}
							}
						}
					},
					"429": {
						"description": "The request was rate limited.",
						"headers": {
							"retry-after": {
								"description": "Seconds to wait before retrying the request.",
								"schema": {
									"type": "string"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError429"
								},
								"example": {
									"type": "error",
									"code": "rate_limited",
									"status": 429,
									"message": "Rate limited."
								}
							}
						}
					},
					"500": {
						"description": "An unexpected server error occurred.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/adminApiError500"
								},
								"example": {
									"type": "error",
									"code": "internal_server_error",
									"status": 500,
									"message": "An unexpected error occurred."
								}
							}
						}
					}
				}
			}
		}
	}
}
