(organizations())
An organization serves as a separate entity within your Novu account. Each organization you create has its own separate integration store, workflows, subscribers, and API keys. This separation of resources allows you to manage multi-tenant environments and separate domains within a single account.
https://docs.novu.co/platform/organizations
- create - Create an organization
- list - Fetch all organizations
- rename - Rename organization name
- retrieve - Fetch current organization details
Create an organization
package hello.world;
import co.novu.co.novu.sdk.Novu;
import co.novu.co.novu.sdk.models.components.*;
import co.novu.co.novu.sdk.models.components.Security;
import co.novu.co.novu.sdk.models.operations.*;
import co.novu.co.novu.sdk.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Novu sdk = Novu.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build();
CreateOrganizationDto req = CreateOrganizationDto.builder()
.name("<value>")
.build();
OrganizationControllerCreateOrganizationResponse res = sdk.organizations().create()
.request(req)
.call();
if (res.organizationResponseDto().isPresent()) {
// handle response
}
} catch (co.novu.co.novu.sdk.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
co.novu.co.novu.sdk.models.components.CreateOrganizationDto | ✔️ | The request object to use for the request. |
Error Object | Status Code | Content Type |
---|---|---|
models/errors/SDKError | 4xx-5xx | / |
Fetch all organizations
package hello.world;
import co.novu.co.novu.sdk.Novu;
import co.novu.co.novu.sdk.models.components.*;
import co.novu.co.novu.sdk.models.components.Security;
import co.novu.co.novu.sdk.models.operations.*;
import co.novu.co.novu.sdk.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Novu sdk = Novu.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build();
OrganizationControllerListOrganizationsResponse res = sdk.organizations().list()
.call();
if (res.organizationResponseDtos().isPresent()) {
// handle response
}
} catch (co.novu.co.novu.sdk.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Error Object | Status Code | Content Type |
---|---|---|
models/errors/SDKError | 4xx-5xx | / |
Rename organization name
package hello.world;
import co.novu.co.novu.sdk.Novu;
import co.novu.co.novu.sdk.models.components.*;
import co.novu.co.novu.sdk.models.components.Security;
import co.novu.co.novu.sdk.models.operations.*;
import co.novu.co.novu.sdk.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Novu sdk = Novu.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build();
RenameOrganizationDto req = RenameOrganizationDto.builder()
.name("<value>")
.build();
OrganizationControllerRenameResponse res = sdk.organizations().rename()
.request(req)
.call();
if (res.renameOrganizationDto().isPresent()) {
// handle response
}
} catch (co.novu.co.novu.sdk.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
co.novu.co.novu.sdk.models.components.RenameOrganizationDto | ✔️ | The request object to use for the request. |
Optional<? extends co.novu.co.novu.sdk.models.operations.OrganizationControllerRenameResponse>
Error Object | Status Code | Content Type |
---|---|---|
models/errors/SDKError | 4xx-5xx | / |
Fetch current organization details
package hello.world;
import co.novu.co.novu.sdk.Novu;
import co.novu.co.novu.sdk.models.components.*;
import co.novu.co.novu.sdk.models.components.Security;
import co.novu.co.novu.sdk.models.operations.*;
import co.novu.co.novu.sdk.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Novu sdk = Novu.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build();
OrganizationControllerGetSelfOrganizationDataResponse res = sdk.organizations().retrieve()
.call();
if (res.organizationResponseDto().isPresent()) {
// handle response
}
} catch (co.novu.co.novu.sdk.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Error Object | Status Code | Content Type |
---|---|---|
models/errors/SDKError | 4xx-5xx | / |