openapi: 3.2.0 info: description: 'The Grafana backend exposes an HTTP API, the same API is used by the frontend to do everything from saving dashboards, creating users and updating data sources.' title: Grafana HTTP API. Quota API contact: name: Grafana Labs url: https://grafana.com email: hello@grafana.com version: 0.0.1 servers: - url: /api security: - basic: [] - api_key: [] tags: - name: Quota paths: /admin/users/{user_id}/quotas: get: description: If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.quotas:list` and scope `global.users:1` (userIDScope). tags: - Quota summary: Fetch user quota operationId: getUserQuota parameters: - name: user_id in: path required: true schema: type: integer format: int64 responses: '200': $ref: '#/components/responses/getQuotaResponse' '401': $ref: '#/components/responses/unauthorisedError' '403': $ref: '#/components/responses/forbiddenError' '404': $ref: '#/components/responses/notFoundError' '500': $ref: '#/components/responses/internalServerError' security: - basic: [] /admin/users/{user_id}/quotas/{quota_target}: put: description: If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.quotas:update` and scope `global.users:1` (userIDScope). tags: - Quota summary: Update user quota operationId: updateUserQuota parameters: - name: quota_target in: path required: true schema: type: string - name: user_id in: path required: true schema: type: integer format: int64 responses: '200': $ref: '#/components/responses/okResponse' '401': $ref: '#/components/responses/unauthorisedError' '403': $ref: '#/components/responses/forbiddenError' '404': $ref: '#/components/responses/notFoundError' '500': $ref: '#/components/responses/internalServerError' security: - basic: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateQuotaCmd' required: true /org/quotas: get: description: If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `orgs.quotas:read` and scope `org:id:1` (orgIDScope). tags: - Quota summary: Fetch Organization quota operationId: getCurrentOrgQuota responses: '200': $ref: '#/components/responses/getQuotaResponse' '401': $ref: '#/components/responses/unauthorisedError' '403': $ref: '#/components/responses/forbiddenError' '404': $ref: '#/components/responses/notFoundError' '500': $ref: '#/components/responses/internalServerError' /orgs/{org_id}/quotas: get: description: If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `orgs.quotas:read` and scope `org:id:1` (orgIDScope). tags: - Quota summary: Fetch Organization quota operationId: getOrgQuota parameters: - name: org_id in: path required: true schema: type: integer format: int64 responses: '200': $ref: '#/components/responses/getQuotaResponse' '401': $ref: '#/components/responses/unauthorisedError' '403': $ref: '#/components/responses/forbiddenError' '404': $ref: '#/components/responses/notFoundError' '500': $ref: '#/components/responses/internalServerError' /orgs/{org_id}/quotas/{quota_target}: put: description: If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `orgs.quotas:write` and scope `org:id:1` (orgIDScope). tags: - Quota summary: Update user quota operationId: updateOrgQuota parameters: - name: quota_target in: path required: true schema: type: string - name: org_id in: path required: true schema: type: integer format: int64 responses: '200': $ref: '#/components/responses/okResponse' '401': $ref: '#/components/responses/unauthorisedError' '403': $ref: '#/components/responses/forbiddenError' '404': $ref: '#/components/responses/notFoundError' '500': $ref: '#/components/responses/internalServerError' security: - basic: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateQuotaCmd' required: true /user/quotas: get: tags: - Quota summary: Fetch user quota operationId: getUserQuotas responses: '200': $ref: '#/components/responses/getQuotaResponse' '401': $ref: '#/components/responses/unauthorisedError' '403': $ref: '#/components/responses/forbiddenError' '404': $ref: '#/components/responses/notFoundError' '500': $ref: '#/components/responses/internalServerError' components: responses: getQuotaResponse: description: (empty) content: application/json: schema: type: array items: $ref: '#/components/schemas/QuotaDTO' unauthorisedError: description: UnauthorizedError is returned when the request is not authenticated. content: application/json: schema: $ref: '#/components/schemas/ErrorResponseBody' internalServerError: description: InternalServerError is a general error indicating something went wrong internally. content: application/json: schema: $ref: '#/components/schemas/ErrorResponseBody' notFoundError: description: NotFoundError is returned when the requested resource was not found. content: application/json: schema: $ref: '#/components/schemas/ErrorResponseBody' okResponse: description: An OKResponse is returned if the request was successful. content: application/json: schema: $ref: '#/components/schemas/SuccessResponseBody' forbiddenError: description: ForbiddenError is returned if the user/token has insufficient permissions to access the requested resource. content: application/json: schema: $ref: '#/components/schemas/ErrorResponseBody' schemas: UpdateQuotaCmd: type: object properties: limit: type: integer format: int64 target: type: string ErrorResponseBody: type: object required: - message properties: error: description: Error An optional detailed description of the actual error. Only included if running in developer mode. type: string message: description: a human readable version of the error type: string status: description: 'Status An optional status to denote the cause of the error. For example, a 412 Precondition Failed error may include additional information of why that error happened.' type: string QuotaDTO: type: object properties: limit: type: integer format: int64 org_id: type: integer format: int64 target: type: string used: type: integer format: int64 user_id: type: integer format: int64 SuccessResponseBody: type: object properties: message: type: string securitySchemes: api_key: type: apiKey name: Authorization in: header basic: type: http scheme: basic