diff --git a/docs/docs/apis/proto/admin.md b/docs/docs/apis/proto/admin.md
index d45220f559..b8910f9cae 100644
--- a/docs/docs/apis/proto/admin.md
+++ b/docs/docs/apis/proto/admin.md
@@ -2403,12 +2403,13 @@ This is an empty response
### IsOrgUniqueRequest
if name or domain is already in use, org is not unique
+at least one argument has to be provided
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
-| name | string | - | string.min_len: 1
string.max_len: 200
|
-| domain | string | - | string.min_len: 1
string.max_len: 200
|
+| name | string | - | string.max_len: 200
|
+| domain | string | - | string.max_len: 200
|
diff --git a/internal/query/org.go b/internal/query/org.go
index 97225e86bb..43f485c0c4 100644
--- a/internal/query/org.go
+++ b/internal/query/org.go
@@ -115,6 +115,9 @@ func (q *Queries) OrgByDomainGlobal(ctx context.Context, domain string) (*Org, e
}
func (q *Queries) IsOrgUnique(ctx context.Context, name, domain string) (isUnique bool, err error) {
+ if name == "" && domain == "" {
+ return false, errors.ThrowInvalidArgument(nil, "QUERY-DGqfd", "Errors.Query.InvalidRequest")
+ }
query, scan := prepareOrgUniqueQuery()
stmt, args, err := query.Where(
sq.And{
diff --git a/proto/zitadel/admin.proto b/proto/zitadel/admin.proto
index a15ca56dee..57165fa4ab 100644
--- a/proto/zitadel/admin.proto
+++ b/proto/zitadel/admin.proto
@@ -2725,6 +2725,7 @@ message UpdateOIDCSettingsResponse {
}
// if name or domain is already in use, org is not unique
+// at least one argument has to be provided
message IsOrgUniqueRequest {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema: {
@@ -2734,18 +2735,16 @@ message IsOrgUniqueRequest {
};
string name = 1 [
- (validate.rules).string = {min_len: 1, max_len: 200},
+ (validate.rules).string = {max_len: 200},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
example: "\"CAOS AG\"";
- min_length: 1;
max_length: 200;
}
];
string domain = 2 [
- (validate.rules).string = {min_len: 1, max_len: 200},
+ (validate.rules).string = {max_len: 200},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
example: "\"caos.ch\"";
- min_length: 1;
max_length: 200;
}
];