← All operations
GET/api/v1/admin/credits

Credits_GetAdminCreditOverview

Authentication
required-admin
Cache policy
none
Success and errors
200, 400, 401, 402, 403, 404, 409, 422, 500, 503
Stability
v1 stable contract

OpenAPI operation

{
  "operationId": "Credits_GetAdminCreditOverview",
  "summary": "Inspect platform credit liabilities and reconciliation",
  "tags": [
    "Credits"
  ],
  "parameters": [
    {
      "name": "workspaceCursor",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string",
        "minLength": 1,
        "maxLength": 4096
      }
    },
    {
      "name": "providerCursor",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string",
        "minLength": 1,
        "maxLength": 4096
      }
    }
  ],
  "security": [
    {
      "cookieAuth": []
    }
  ],
  "responses": {
    "200": {
      "description": "Success",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "data",
              "meta"
            ],
            "properties": {
              "data": {
                "type": "object",
                "properties": {
                  "totals": {
                    "type": "object",
                    "properties": {
                      "availableUnits": {
                        "type": "string"
                      },
                      "reservedUnits": {
                        "type": "string"
                      },
                      "receivableUnits": {
                        "type": "string"
                      },
                      "creditedDepositUnits": {
                        "type": "string"
                      },
                      "chargedUsageUnits": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "availableUnits",
                      "reservedUnits",
                      "receivableUnits",
                      "creditedDepositUnits",
                      "chargedUsageUnits"
                    ],
                    "additionalProperties": false
                  },
                  "workspaces": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "workspacePublicId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "workspaceName": {
                          "type": "string"
                        },
                        "walletPublicId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "availableUnits": {
                          "type": "string"
                        },
                        "reservedUnits": {
                          "type": "string"
                        },
                        "receivableUnits": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "workspacePublicId",
                        "workspaceName",
                        "walletPublicId",
                        "availableUnits",
                        "reservedUnits",
                        "receivableUnits"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "providerBalances": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "providerAccountKey": {
                          "type": "string"
                        },
                        "purchasedUnits": {
                          "type": "string"
                        },
                        "usedUnits": {
                          "type": "string"
                        },
                        "remainingUnits": {
                          "type": "string"
                        },
                        "observedAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                        }
                      },
                      "required": [
                        "provider",
                        "providerAccountKey",
                        "purchasedUnits",
                        "usedUnits",
                        "remainingUnits",
                        "observedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "workspaceNextCursor": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "providerNextCursor": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reconciliation": {
                    "type": "object",
                    "properties": {
                      "pendingUsage": {
                        "type": "string",
                        "pattern": "^[0-9]+$"
                      },
                      "disputedInvoices": {
                        "type": "string",
                        "pattern": "^[0-9]+$"
                      },
                      "pendingDeposits": {
                        "type": "string",
                        "pattern": "^[0-9]+$"
                      }
                    },
                    "required": [
                      "pendingUsage",
                      "disputedInvoices",
                      "pendingDeposits"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "totals",
                  "workspaces",
                  "providerBalances",
                  "workspaceNextCursor",
                  "providerNextCursor",
                  "reconciliation"
                ],
                "additionalProperties": false
              },
              "meta": {
                "type": "object",
                "additionalProperties": true,
                "required": [
                  "requestId",
                  "schemaVersion",
                  "buildVersion",
                  "generatedAt",
                  "freshness"
                ],
                "properties": {
                  "requestId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "schemaVersion": {
                    "type": "string"
                  },
                  "buildVersion": {
                    "type": "string"
                  },
                  "generatedAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "freshness": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "projectedAt",
                      "sourceWatermark"
                    ],
                    "properties": {
                      "projectedAt": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "date-time"
                      },
                      "sourceWatermark": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "400": {
      "description": "invalid request",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      }
    },
    "401": {
      "description": "unauthenticated",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      }
    },
    "402": {
      "description": "insufficient credits",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      }
    },
    "403": {
      "description": "forbidden",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      }
    },
    "404": {
      "description": "not found",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      }
    },
    "409": {
      "description": "conflict",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      }
    },
    "422": {
      "description": "configuration missing",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      }
    },
    "500": {
      "description": "internal error",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      }
    },
    "503": {
      "description": "dependency unavailable",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      }
    }
  },
  "x-auth-mode": "required-admin",
  "x-cache-policy": "none",
  "x-required-scopes": [],
  "x-rate-cost": 1,
  "x-stability": "STABLE"
}