Get workspace settings
/v1/settings/workspaceNeeds Configuration: read on the whole workspace.
Example
import { createClient } from '@nightmail/sdk/client';
import { getWorkspaceSettings } from '@nightmail/sdk';
const client = createClient({
baseUrl: 'https://nightmail.dev',
auth: scheme => scheme.scheme === 'bearer'
? process.env.NIGHTMAIL_API_KEY
: undefined,
});
const result = await getWorkspaceSettings({
client,
throwOnError: true,
});
console.log(result.data);curl --request GET \
--url 'https://nightmail.dev/v1/settings/workspace' \
--header "Authorization: Bearer $NIGHTMAIL_API_KEY"Responses
200Success
WorkspaceSettingsnamerequiredstringpostalAddressrequiredstring or nullThe postal address every campaign footer and marketing send shows under Unsubscribe; null until one is set. Campaigns can't be sent or scheduled without it.
requiredNoticesrequiredbooleanWhether campaigns in this workspace may be required notices (requiredNotice), which also reach people who unsubscribed from marketing. Only an operator turns this on.
focusrequiredarray or nullWhat the workspace is here for, the first leading: marketing emails, a newsletter, developer (transactional) emails, agent inboxes or a personal inbox. The dashboard tailors its first steps and Overview to it. Null until chosen; empty when skipped.
400, 401, 403, 404, 409, 413, 422, 429, 500, 503Request failed; use error.code and requestId to diagnose.
ApiErrorerrorrequiredobjecterror.coderequiredstringerror.messagerequiredstringerror.requestIdrequiredstringerror.fieldstringerror.retryablerequiredbooleanerror.resetAtstringNext capacity change for a Hosted rolling send limit.
error.detailsobject[]Every problem found, when there is more than one part, such as rule diagnostics with rule, line, column, message and hint, or a measurement, such as CONTENT_TOO_LARGE_TO_SCREEN with screenedBytes and limitBytes (and index in a batch).
error.requiredobjectOn a 403 permission refusal: what the request needs that this credential lacks. The Nightmail-Required-Permission header says the same.