Skip to main content

Class: OrgApi

Defined in: packages/sdk/src/api/org.ts:82

Extends

Constructors

Constructor

new OrgApi(apiKey, baseUrl, customFetch?): OrgApi

Defined in: packages/sdk/src/api/base.ts:184

Parameters

apiKey

string | undefined

baseUrl

string

customFetch?

{(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Returns

OrgApi

Inherited from

BaseApiClient.constructor

Methods

activateA2PNumber()

activateA2PNumber(orgUuid, providerPhoneUuid, brandUuid): Promise<ActivateA2PNumberResponse>

Defined in: packages/sdk/src/api/org.ts:759

Activate SMS on a workspace-assigned number: attach it to the given brand's Messaging Service (A2P 10DLC). Preconditions (412 otherwise): campaign VERIFIED, brand has a Messaging Service, phone assigned to a workspace with a Twilio SID.

Parameters

orgUuid

string

providerPhoneUuid

string

brandUuid

string

Returns

Promise<ActivateA2PNumberResponse>


approveA2PMessages()

approveA2PMessages(orgUuid, brandUuid, sampleMessages): Promise<{ status: string; }>

Defined in: packages/sdk/src/api/org.ts:742

Approve sample messages for one brand's A2P campaign. Signals the brand's registration workflow to create the TCR campaign.

Parameters

orgUuid

string

brandUuid

string

sampleMessages

string[]

Returns

Promise<{ status: string; }>


assignPhoneToWorkspace()

assignPhoneToWorkspace(orgUuid, providerPhoneUuid, workspaceUuid): Promise<ProviderPhoneNumber>

Defined in: packages/sdk/src/api/org.ts:433

Assign a phone number to a workspace.

Parameters

orgUuid

string

providerPhoneUuid

string

workspaceUuid

string

Returns

Promise<ProviderPhoneNumber>


cancelBusinessProfile()

cancelBusinessProfile(orgUuid, legalEntityUuid?): Promise<BusinessProfileCancelResponse>

Defined in: packages/sdk/src/api/org.ts:830

Cancel an in-flight Twilio review. Resets the cached profile state to draft so the user can edit and resubmit.

Parameters

orgUuid

string

legalEntityUuid?

string | null

Returns

Promise<BusinessProfileCancelResponse>


checkAccountMembership()

checkAccountMembership(orgUuid, accountUuid): Promise<{ isMember: boolean; }>

Defined in: packages/sdk/src/api/org.ts:211

Check if an account is already a member of an organization.

Parameters

orgUuid

string

accountUuid

string

Returns

Promise<{ isMember: boolean; }>


createLegalEntity()

createLegalEntity(orgUuid, data): Promise<LegalEntitySummary>

Defined in: packages/sdk/src/api/org.ts:850

Create a legal entity. Its business profile is edited via the entity-scoped business-profile methods.

Parameters

orgUuid

string

data

CreateLegalEntityRequest

Returns

Promise<LegalEntitySummary>


createOrganizationInvitation()

createOrganizationInvitation(orgIdOrUuid, data): Promise<InvitationResponse>

Defined in: packages/sdk/src/api/org.ts:269

Create a new invitation to join the organization.

Parameters

orgIdOrUuid

string | number

data

CreateOrganizationInvitationFormData

Returns

Promise<InvitationResponse>


createOrganizationWorkspace()

createOrganizationWorkspace(orgIdOrUuid, data): Promise<OrgWorkspace>

Defined in: packages/sdk/src/api/org.ts:395

Create a workspace in an organization.

Parameters

orgIdOrUuid

string | number

data

OrgCreateWorkspaceFormData

Returns

Promise<OrgWorkspace>


deleteOrganizationInvitation()

deleteOrganizationInvitation(orgIdOrUuid, invitationId): Promise<void>

Defined in: packages/sdk/src/api/org.ts:306

Delete (cancel) an organization invitation.

Parameters

orgIdOrUuid

string | number

invitationId

number

Returns

Promise<void>


deleteOrgDomain()

deleteOrgDomain(orgIdOrUuid, domainUuid): Promise<void>

Defined in: packages/sdk/src/api/org.ts:572

Delete a registered organization domain.

Parameters

orgIdOrUuid

string | number

domainUuid

string

Returns

Promise<void>


deleteOrgSsoConfig()

deleteOrgSsoConfig(orgIdOrUuid): Promise<{ message: string; status: string; }>

Defined in: packages/sdk/src/api/org.ts:144

Remove this organization's SSO configuration. Requires org:admin.

Parameters

orgIdOrUuid

string | number

Returns

Promise<{ message: string; status: string; }>


deletePhoneNumber()

deletePhoneNumber(orgUuid, providerPhoneUuid): Promise<void>

Defined in: packages/sdk/src/api/org.ts:521

Delete a phone number from the org (releases from Twilio).

Parameters

orgUuid

string

providerPhoneUuid

string

Returns

Promise<void>


disableOrgDomainEmail()

disableOrgDomainEmail(orgIdOrUuid, domainUuid, confirm?): Promise<EmailDisableResponse>

Defined in: packages/sdk/src/api/org.ts:616

Disable email support for an org domain.

Parameters

orgIdOrUuid

string | number

domainUuid

string

confirm?

boolean = false

Returns

Promise<EmailDisableResponse>


disableOrgDomainSite()

disableOrgDomainSite(orgIdOrUuid, domainUuid, confirm?): Promise<SiteDisableResponse>

Defined in: packages/sdk/src/api/org.ts:687

Disable custom site routing for an org domain.

Parameters

orgIdOrUuid

string | number

domainUuid

string

confirm?

boolean = false

Returns

Promise<SiteDisableResponse>


enableOrgDomainEmail()

enableOrgDomainEmail(orgIdOrUuid, domainUuid): Promise<EmailDomainConfig>

Defined in: packages/sdk/src/api/org.ts:579

Enable email DNS provisioning for a verified org domain.

Parameters

orgIdOrUuid

string | number

domainUuid

string

Returns

Promise<EmailDomainConfig>


enableOrgDomainSite()

enableOrgDomainSite(orgIdOrUuid, domainUuid): Promise<SiteDomainConfig>

Defined in: packages/sdk/src/api/org.ts:637

Enable custom site routing for a verified org domain.

Parameters

orgIdOrUuid

string | number

domainUuid

string

Returns

Promise<SiteDomainConfig>


getA2PBrand()

getA2PBrand(orgUuid, brandUuid): Promise<OrgA2PBrandDetail>

Defined in: packages/sdk/src/api/org.ts:916

Brand detail with live registration-workflow state (workflowStatus, pendingSampleMessages) for the sample-approval step.

Parameters

orgUuid

string

brandUuid

string

Returns

Promise<OrgA2PBrandDetail>


getA2PBrandEnrollmentUrl()

getA2PBrandEnrollmentUrl(orgUuid, brandUuid): Promise<A2PBrandEnrollmentUrlResponse>

Defined in: packages/sdk/src/api/org.ts:1043

The brand's enrollment-form template URL (carries ?brand=…, no credential). url is null until a Site is linked. Do not append a patient identifier to this URL — use mintA2PBrandEnrollmentLink to get a patient-ready link instead.

Parameters

orgUuid

string

brandUuid

string

Returns

Promise<A2PBrandEnrollmentUrlResponse>


getA2PBrandUseCases()

getA2PBrandUseCases(orgUuid, brandUuid): Promise<OrgA2PBrandUseCasesResponse>

Defined in: packages/sdk/src/api/org.ts:933

Live per-brand campaign use-case eligibility. Approved brands only — a brand still under TCR review comes back as a structured 412 the picker renders as the supported-list fallback, not an error.

Parameters

orgUuid

string

brandUuid

string

Returns

Promise<OrgA2PBrandUseCasesResponse>


getA2PCampaignConfig()

getA2PCampaignConfig(orgUuid, brandUuid): Promise<A2PCampaignConfigResponse>

Defined in: packages/sdk/src/api/org.ts:947

Fetch a brand's resolved A2P campaign config. The response carries both the raw overrides and the resolved payload (defaults + overrides) the editor previews — including the canonical SMS consent text.

Parameters

orgUuid

string

brandUuid

string

Returns

Promise<A2PCampaignConfigResponse>


getA2PStatus()

getA2PStatus(orgUuid): Promise<OrgA2PStatus>

Defined in: packages/sdk/src/api/org.ts:712

Get the org's A2P brand registration status.

Parameters

orgUuid

string

Returns

Promise<OrgA2PStatus>


getActingMember()

getActingMember(): string | undefined

Defined in: packages/sdk/src/api/base.ts:237

Get the current acting member UUID.

Returns

string | undefined

Inherited from

BaseApiClient.getActingMember


getBusinessProfile()

getBusinessProfile(orgUuid, legalEntityUuid?): Promise<BusinessProfile>

Defined in: packages/sdk/src/api/org.ts:787

Live fetch of the org's Twilio Customer Profile + related entities.

Response carries both the lifecycle status and the compliance evaluationStatus. Twilio models lifecycle and evaluation as two separate enums on two separate resources, so the Submit-button gate is evaluationStatus === 'compliant' — never status === 'compliant', which is impossible (lifecycle status is one of draft / pending-review / in-review / twilio-approved / twilio-rejected).

Parameters

orgUuid

string

legalEntityUuid?

string | null

Returns

Promise<BusinessProfile>


getCurrentOrgMember()

getCurrentOrgMember(orgIdOrUuid): Promise<CurrentOrgMember>

Defined in: packages/sdk/src/api/org.ts:101

Get the current user's membership in an organization. Returns the user's org membership details including their role and scopes.

Parameters

orgIdOrUuid

string | number

Returns

Promise<CurrentOrgMember>


getLegalEntity()

getLegalEntity(orgUuid, legalEntityUuid): Promise<LegalEntitySummary>

Defined in: packages/sdk/src/api/org.ts:860

Parameters

orgUuid

string

legalEntityUuid

string

Returns

Promise<LegalEntitySummary>


getOrganization()

getOrganization(idOrUuid): Promise<OrganizationResponse>

Defined in: packages/sdk/src/api/org.ts:93

Get organization by ID or UUID. Returns different response based on user's role:

  • Admins/Owners: AdminOrganization with full details
  • Members: MemberOrgView with basic info and workspace list

Use viewType field to determine the response type:

  • 'admin': AdminOrganization
  • 'member': MemberOrgView

Parameters

idOrUuid

string | number

Returns

Promise<OrganizationResponse>


getOrganizationInvitation()

getOrganizationInvitation(orgIdOrUuid, invitationId): Promise<InvitationResponse>

Defined in: packages/sdk/src/api/org.ts:282

Get a specific organization invitation.

Parameters

orgIdOrUuid

string | number

invitationId

number

Returns

Promise<InvitationResponse>


getOrganizationMembers()

getOrganizationMembers(orgIdOrUuid, options?): Promise<OrgMemberListResponse>

Defined in: packages/sdk/src/api/org.ts:192

List members of an organization.

Parameters

orgIdOrUuid

string | number

options?
page?

number

pageSize?

number

string

Returns

Promise<OrgMemberListResponse>


getOrganizationWorkspace()

getOrganizationWorkspace(orgIdOrUuid, workspaceUuid): Promise<OrgWorkspace>

Defined in: packages/sdk/src/api/org.ts:362

Get a single workspace in an organization.

Parameters

orgIdOrUuid

string | number

workspaceUuid

string

Returns

Promise<OrgWorkspace>


getOrganizationWorkspaces()

getOrganizationWorkspaces(orgIdOrUuid, options?): Promise<PaginatedResponse<OrgWorkspace>>

Defined in: packages/sdk/src/api/org.ts:337

List workspaces in an organization with pagination.

Parameters

orgIdOrUuid

string | number

options?
page?

number

pageSize?

number

search?

string

sortBy?

WorkspaceSortField

sortOrder?

SortOrder

Returns

Promise<PaginatedResponse<OrgWorkspace>>


getOrganizationWorkspaceStats()

getOrganizationWorkspaceStats(orgIdOrUuid, workspaceUuid): Promise<OrgWorkspaceStatsResponse>

Defined in: packages/sdk/src/api/org.ts:385

Workspace-schema aggregates for one card, plus the caller's own member role. Separate from the list because it opens a session against the workspace's own schema — each card fetches its own.

Parameters

orgIdOrUuid

string | number

workspaceUuid

string

Returns

Promise<OrgWorkspaceStatsResponse>


getOrganizationWorkspaceSummaries()

getOrganizationWorkspaceSummaries(orgIdOrUuid): Promise<OrgWorkspaceSummaryResponse[]>

Defined in: packages/sdk/src/api/org.ts:374

Workspace cards for the organization page: identity plus the GLB-side counts. Any org member may call it — members get the workspaces they belong to, org:read holders get all of them.

Parameters

orgIdOrUuid

string | number

Returns

Promise<OrgWorkspaceSummaryResponse[]>


getOrgBillingCustomer()

getOrgBillingCustomer(orgIdOrUuid): Promise<{ customerName: string | null; customerUuid: string | null; hasAccess: boolean; subscriptionId: number | null; }>

Defined in: packages/sdk/src/api/org.ts:159

Get the billing customer and this organization's billable subscription.

subscriptionId is the org-scoped row — never pick the customer's newest subscription from the list endpoint. One customer can bill many organizations.

Parameters

orgIdOrUuid

string | number

Returns

Promise<{ customerName: string | null; customerUuid: string | null; hasAccess: boolean; subscriptionId: number | null; }>


getOrgDomain()

getOrgDomain(orgIdOrUuid, domainUuid): Promise<OrgDomain>

Defined in: packages/sdk/src/api/org.ts:552

Get a registered organization domain by UUID.

Parameters

orgIdOrUuid

string | number

domainUuid

string

Returns

Promise<OrgDomain>


getOrgDomainEmail()

getOrgDomainEmail(orgIdOrUuid, domainUuid): Promise<EmailDomainConfigGetResponse>

Defined in: packages/sdk/src/api/org.ts:591

Get email DNS provisioning and verification status for an org domain.

Parameters

orgIdOrUuid

string | number

domainUuid

string

Returns

Promise<EmailDomainConfigGetResponse>


getOrgDomainSite()

getOrgDomainSite(orgIdOrUuid, domainUuid): Promise<SiteDomainConfigGetResponse>

Defined in: packages/sdk/src/api/org.ts:649

Get site CNAME provisioning and verification status for an org domain.

Parameters

orgIdOrUuid

string | number

domainUuid

string

Returns

Promise<SiteDomainConfigGetResponse>


getOrgSsoConfig()

getOrgSsoConfig(orgIdOrUuid): Promise<OrgSsoConfig>

Defined in: packages/sdk/src/api/org.ts:128

Read this organization's SSO configuration.

Org-scoped (org:admin), unlike the SSO fields on the superuser admin organization update — an org admin owns their own identity provider.

Parameters

orgIdOrUuid

string | number

Returns

Promise<OrgSsoConfig>


getOrgWorkspaceUsage()

getOrgWorkspaceUsage(orgIdOrUuid): Promise<OrgWorkspaceUsageResponse>

Defined in: packages/sdk/src/api/org.ts:185

Per-workspace usage for this organization's current credit window.

Requires a billing role on the organization's billing customer — the same gate getOrgBillingCustomer().hasAccess reports, and the one that decides whether the billing tab is shown at all.

creditsUsed is a real organization-wide total or it is null; it is never a partial sum. There is deliberately no per-workspace "remaining" figure — the caps belong to the organization, so cap - oneWorkspace describes nothing.

Parameters

orgIdOrUuid

string | number

Returns

Promise<OrgWorkspaceUsageResponse>


getPhoneBillingPricing()

getPhoneBillingPricing(orgUuid): Promise<PhoneBillingPricing>

Defined in: packages/sdk/src/api/org.ts:717

Return fixed phone-number and outbound-messaging prices.

Parameters

orgUuid

string

Returns

Promise<PhoneBillingPricing>


getVoiceTrustProducts()

getVoiceTrustProducts(orgUuid, legalEntityUuid): Promise<VoiceTrustProductsResponse>

Defined in: packages/sdk/src/api/org.ts:865

Cached voice trust product state (CNAM / SHAKEN-STIR / Voice Integrity) for one legal entity.

Parameters

orgUuid

string

legalEntityUuid

string

Returns

Promise<VoiceTrustProductsResponse>


getWorkspaceMemberRoles()

getWorkspaceMemberRoles(orgIdOrUuid, workspaceUuid): Promise<MemberRoleResponse[]>

Defined in: packages/sdk/src/api/org.ts:1078

List available member roles for a workspace in the organization.

Parameters

orgIdOrUuid

string | number

workspaceUuid

string

Returns

Promise<MemberRoleResponse[]>


joinWorkspace()

joinWorkspace(orgIdOrUuid, workspaceUuid, data): Promise<OrgJoinWorkspaceResponse>

Defined in: packages/sdk/src/api/org.ts:1088

Join a workspace as the current org admin/owner.

Parameters

orgIdOrUuid

string | number

workspaceUuid

string

data

OrgJoinWorkspaceRequest

Returns

Promise<OrgJoinWorkspaceResponse>


linkA2PEnrollmentSite()

linkA2PEnrollmentSite(orgUuid, brandUuid, data): Promise<A2PCampaignConfigResponse>

Defined in: packages/sdk/src/api/org.ts:992

Link the brand to a published enrollment Site (sets site_uuid). Returns the refreshed campaign config so the editor's link state updates inline.

Parameters

orgUuid

string

brandUuid

string

data

LinkA2PEnrollmentSiteRequest

Returns

Promise<A2PCampaignConfigResponse>


listA2PBrands()

listA2PBrands(orgUuid): Promise<OrgA2PBrandListResponse>

Defined in: packages/sdk/src/api/org.ts:924

List the org's A2P brands (broker resources). The SMS-consent editor uses this to pick which brand's consent config to edit.

Parameters

orgUuid

string

Returns

Promise<OrgA2PBrandListResponse>


listA2PEnrollmentSiteCandidates()

listA2PEnrollmentSiteCandidates(orgUuid, brandUuid): Promise<A2PEnrollmentSiteCandidatesResponse>

Defined in: packages/sdk/src/api/org.ts:979

Published Sites across the org's workspaces that can be linked as this brand's enrollment (opt-in) surface. Org-authorized, so it works even when the admin isn't a member of the workspace holding the Site.

Parameters

orgUuid

string

brandUuid

string

Returns

Promise<A2PEnrollmentSiteCandidatesResponse>


listLegalEntities()

listLegalEntities(orgUuid): Promise<LegalEntityListResponse>

Defined in: packages/sdk/src/api/org.ts:845

List the org's legal entities (one Customer Profile each).

Parameters

orgUuid

string

Returns

Promise<LegalEntityListResponse>


listOrganizationInvitations()

listOrganizationInvitations(orgIdOrUuid, options?): Promise<InvitationListResponse>

Defined in: packages/sdk/src/api/org.ts:248

List invitations for an organization.

Parameters

orgIdOrUuid

string | number

options?
page?

number

pageSize?

number

status?

InvitationStatus

Returns

Promise<InvitationListResponse>


listOrgDomains()

listOrgDomains(orgIdOrUuid): Promise<OrgDomainListResponse>

Defined in: packages/sdk/src/api/org.ts:535

List domains registered to an organization.

Parameters

orgIdOrUuid

string | number

Returns

Promise<OrgDomainListResponse>


listPhoneNumbers()

listPhoneNumbers(orgUuid): Promise<ProviderPhoneNumber[]>

Defined in: packages/sdk/src/api/org.ts:426

List all provider phone numbers owned by this organization.

Parameters

orgUuid

string

Returns

Promise<ProviderPhoneNumber[]>


mintA2PBrandEnrollmentLink(orgUuid, brandUuid, externalId): Promise<A2PBrandEnrollmentUrlResponse>

Defined in: packages/sdk/src/api/org.ts:1061

Mint a patient-ready enrollment link for one patient.

The returned URL carries a fresh, expiring, single-use ?grant=… bound to the member that externalId resolves to. externalId (the patient's CRM/EHR identifier) travels in the request body, never the query string, so it stays out of access logs. When it matches no member, the credential-free template URL is returned rather than an error.

Parameters

orgUuid

string

brandUuid

string

externalId

string

Returns

Promise<A2PBrandEnrollmentUrlResponse>


preflightOrgDomainSite()

preflightOrgDomainSite(orgIdOrUuid, domainUuid): Promise<SitePreflightResponse>

Defined in: packages/sdk/src/api/org.ts:660

Pre-enable DNS check: is the site CNAME resolving to the routing endpoint yet? Pure DNS — consumes no enable budget.

Parameters

orgIdOrUuid

string | number

domainUuid

string

Returns

Promise<SitePreflightResponse>


provisionA2PEnrollmentSite()

provisionA2PEnrollmentSite(orgUuid, brandUuid, data?): Promise<A2PCampaignConfigResponse>

Defined in: packages/sdk/src/api/org.ts:1012

Provision (or reuse) a patient-enrollment Site for the brand and link it — the one-click path behind the SMS Consent tab. workspaceUuid is required only when the org has multiple workspaces. Returns the refreshed campaign config so the editor's link state updates inline. Idempotent.

Parameters

orgUuid

string

brandUuid

string

data?

ProvisionA2PEnrollmentSiteRequest = {}

Returns

Promise<A2PCampaignConfigResponse>


purchasePhoneNumber()

purchasePhoneNumber(orgUuid, phoneNumber, numberType, opts?): Promise<ProviderPhoneNumber>

Defined in: packages/sdk/src/api/org.ts:500

Purchase a phone number from Twilio for this org inventory (org admin only).

Numbers in regulated countries (e.g. Australia) require a Twilio regulatory bundle and an address — pass bundleSid and addressSid for those.

Parameters

orgUuid

string

phoneNumber

string

numberType

"local" | "toll_free"

opts?
addressSid?

string

bundleSid?

string

country?

string

Returns

Promise<ProviderPhoneNumber>


reassignPhone()

reassignPhone(orgUuid, providerPhoneUuid, newWorkspaceUuid): Promise<ProviderPhoneNumber>

Defined in: packages/sdk/src/api/org.ts:447

Reassign a phone number to a different workspace.

Parameters

orgUuid

string

providerPhoneUuid

string

newWorkspaceUuid

string

Returns

Promise<ProviderPhoneNumber>


registerOrgDomain()

registerOrgDomain(orgIdOrUuid, domain): Promise<OrgDomain>

Defined in: packages/sdk/src/api/org.ts:542

Register a domain with an organization and return the TXT ownership proof.

Parameters

orgIdOrUuid

string | number

domain

string

Returns

Promise<OrgDomain>


releasePhone()

releasePhone(orgUuid, providerPhoneUuid): Promise<ProviderPhoneNumber>

Defined in: packages/sdk/src/api/org.ts:461

Release a phone number from its current workspace.

Parameters

orgUuid

string

providerPhoneUuid

string

Returns

Promise<ProviderPhoneNumber>


removeOrganizationMember()

removeOrganizationMember(orgIdOrUuid, memberId): Promise<void>

Defined in: packages/sdk/src/api/org.ts:235

Remove a member from an organization.

Parameters

orgIdOrUuid

string | number

memberId

number

Returns

Promise<void>


resendOrganizationInvitation()

resendOrganizationInvitation(orgIdOrUuid, invitationId): Promise<{ message: string; }>

Defined in: packages/sdk/src/api/org.ts:318

Resend an organization invitation email.

Parameters

orgIdOrUuid

string | number

invitationId

number

Returns

Promise<{ message: string; }>


searchPhoneNumbers()

searchPhoneNumbers(orgUuid, params?): Promise<AvailablePhoneNumberResponse[]>

Defined in: packages/sdk/src/api/org.ts:471

Search for available phone numbers to purchase from Twilio.

Parameters

orgUuid

string

params?
areaCode?

string

contains?

string

country?

string

ISO 3166-1 alpha-2 country code (e.g. 'US', 'AU'). Defaults to 'US'.

limit?

number

numberType?

"local" | "toll_free"

Returns

Promise<AvailablePhoneNumberResponse[]>


setActingMember()

setActingMember(memberUuid): void

Defined in: packages/sdk/src/api/base.ts:230

Set the acting member UUID for member identity switching. When set, all API requests will include the X-Acting-Member header. The backend will validate that the authenticated account owns this member and use it as the effective identity for the request.

Parameters

memberUuid

string | undefined

Returns

void

Inherited from

BaseApiClient.setActingMember


setEnhancedAuthHandler()

setEnhancedAuthHandler(handler): void

Defined in: packages/sdk/src/api/base.ts:204

Set the handler for enhanced authentication requirements (RFC 9470 Step-Up Auth). This handler is called when a 401 response includes WWW-Authenticate header with error="insufficient_user_authentication".

Parameters

handler

EnhancedAuthHandler | undefined

Returns

void

Inherited from

BaseApiClient.setEnhancedAuthHandler


setOrgAuthHandler()

setOrgAuthHandler(handler): void

Defined in: packages/sdk/src/api/base.ts:213

Set the handler for organization authentication requirements. This handler is called when a 401 response includes WWW-Authenticate header with realm="org". The handler should redirect the user to complete org auth.

Parameters

handler

OrgAuthHandler | undefined

Returns

void

Inherited from

BaseApiClient.setOrgAuthHandler


setOrgSession()

setOrgSession(session, orgUuid?): void

Defined in: packages/sdk/src/api/base.ts:251

Set the opaque org session credential for cross-domain requests. Opaque gr_sess_ values use X-Org-Session. Legacy orgToken JWE values still use X-Org-Token through setOrgToken() during the migration window.

orgUuid is the org that issued the credential; passing it lets the 401 handler detect a stale session when a subsequent request targets a different org and re-fire the org-auth handler instead of silently 401-ing. Callers without that context (legacy / unknown) may omit it.

Parameters

session

string | undefined

orgUuid?

string

Returns

void

Inherited from

BaseApiClient.setOrgSession


setOrgToken()

setOrgToken(token, orgUuid?): void

Defined in: packages/sdk/src/api/base.ts:260

Parameters

token

string | undefined

orgUuid?

string

Returns

void

Deprecated

Legacy compatibility for stateless orgToken JWE credentials. Prefer setOrgSession() for opaque org browser sessions.

Inherited from

BaseApiClient.setOrgToken


setupVoiceTrustProduct()

setupVoiceTrustProduct(orgUuid, legalEntityUuid, product, data): Promise<VoiceTrustProductsResponse>

Defined in: packages/sdk/src/api/org.ts:900

Set up + submit one voice trust product for a legal entity. Requires the entity's business profile to be twilio-approved (412 otherwise).

Parameters

orgUuid

string

legalEntityUuid

string

product

VoiceTrustProductKey

data

SetupVoiceTrustProductRequest

Returns

Promise<VoiceTrustProductsResponse>


startA2PRegistration()

startA2PRegistration(orgUuid, legalEntityUuid, brandName, brandUuid?): Promise<StartA2PRegistrationResponse>

Defined in: packages/sdk/src/api/org.ts:726

Start A2P brand registration under a legal entity. legalEntityUuid is required — brands register per legal entity (Customer Profile); there is no primary-entity fallback.

Parameters

orgUuid

string

legalEntityUuid

string

brandName

string

brandUuid?

string | null

Returns

Promise<StartA2PRegistrationResponse>


submitBusinessProfile()

submitBusinessProfile(orgUuid, legalEntityUuid?): Promise<BusinessProfileSubmitResponse>

Defined in: packages/sdk/src/api/org.ts:816

Submit the business profile to Twilio for review. Server re-evaluates compliance live and returns 412 if the profile is not currently compliant; returns 409 if a review is already in flight.

Parameters

orgUuid

string

legalEntityUuid?

string | null

Returns

Promise<BusinessProfileSubmitResponse>


syncVoiceTrustProducts()

syncVoiceTrustProducts(orgUuid, legalEntityUuid): Promise<SyncVoiceTrustProductsResponse>

Defined in: packages/sdk/src/api/org.ts:885

Reconcile trust product state against Twilio (discovery + status refresh). Returns the refreshed products plus which product keys were newly discovered. Responds 409 when another Trust Hub operation holds this legal entity's lock, failing fast rather than queueing.

No Retry-After is sent, deliberately (#23601): holders range from a sub-second JSONB write to a multi-minute Twilio sequence, so no interval would be honest. Back off on your own schedule, and re-read before retrying — the operation you collided with may have committed SIDs.

Parameters

orgUuid

string

legalEntityUuid

string

Returns

Promise<SyncVoiceTrustProductsResponse>


unlinkA2PEnrollmentSite()

unlinkA2PEnrollmentSite(orgUuid, brandUuid): Promise<A2PCampaignConfigResponse>

Defined in: packages/sdk/src/api/org.ts:1027

Clear the brand's enrollment-site link.

Parameters

orgUuid

string

brandUuid

string

Returns

Promise<A2PCampaignConfigResponse>


updateA2PCampaignConfig()

updateA2PCampaignConfig(orgUuid, brandUuid, data): Promise<A2PCampaignConfigResponse>

Defined in: packages/sdk/src/api/org.ts:960

Partial-update a brand's A2P campaign config. Returns the freshly resolved config so the editor's live preview updates without a second round-trip.

Parameters

orgUuid

string

brandUuid

string

data

UpdateA2PCampaignConfigRequest

Returns

Promise<A2PCampaignConfigResponse>


updateApiKey()

updateApiKey(newApiKey): void

Defined in: packages/sdk/src/api/base.ts:220

Update the API key (used after successful re-authentication).

Parameters

newApiKey

string

Returns

void

Inherited from

BaseApiClient.updateApiKey


updateBusinessProfile()

updateBusinessProfile(orgUuid, data, legalEntityUuid?): Promise<BusinessProfile>

Defined in: packages/sdk/src/api/org.ts:800

Upsert the org's business profile. Idempotent via cached SIDs. Returns a fresh BusinessProfileResponse on success — including the compliance evaluation result so the frontend can immediately enable Submit without a second round-trip.

Parameters

orgUuid

string

data

UpdateBusinessProfileRequest

legalEntityUuid?

string | null

Returns

Promise<BusinessProfile>


updateOrganizationInvitation()

updateOrganizationInvitation(orgIdOrUuid, invitationId, data): Promise<InvitationResponse>

Defined in: packages/sdk/src/api/org.ts:292

Update an organization invitation.

Parameters

orgIdOrUuid

string | number

invitationId

number

data

UpdateInvitationFormData

Returns

Promise<InvitationResponse>


updateOrganizationMember()

updateOrganizationMember(orgIdOrUuid, memberId, data): Promise<OrgMember>

Defined in: packages/sdk/src/api/org.ts:221

Update an organization member's role.

Parameters

orgIdOrUuid

string | number

memberId

number

data

UpdateOrgMemberRequest

Returns

Promise<OrgMember>


updateOrganizationSettings()

updateOrganizationSettings(orgIdOrUuid, data): Promise<AdminOrganization>

Defined in: packages/sdk/src/api/org.ts:112

Update the settings an org admin owns: name, slug and contact details.

Deliberately NOT the admin organization update — enforceCreditLimit is superuser-only and is not a field on this endpoint's request model at all.

Parameters

orgIdOrUuid

string | number

data

OrgSettingsUpdateRequest

Returns

Promise<AdminOrganization>


updateOrganizationWorkspace()

updateOrganizationWorkspace(orgIdOrUuid, workspaceUuid, data): Promise<OrgWorkspace>

Defined in: packages/sdk/src/api/org.ts:408

Update a workspace in an organization.

Parameters

orgIdOrUuid

string | number

workspaceUuid

string

data

OrgWorkspaceFormData

Returns

Promise<OrgWorkspace>


updateOrgSsoConfig()

updateOrgSsoConfig(orgIdOrUuid, data): Promise<OrgSsoConfig>

Defined in: packages/sdk/src/api/org.ts:133

Configure this organization's SSO. Requires org:admin.

Parameters

orgIdOrUuid

string | number

data

SSOConfigRequest

Returns

Promise<OrgSsoConfig>


verifyOrgDomainEmail()

verifyOrgDomainEmail(orgIdOrUuid, domainUuid): Promise<EmailVerificationResponse>

Defined in: packages/sdk/src/api/org.ts:603

Verify email DNS records, including MX.

Parameters

orgIdOrUuid

string | number

domainUuid

string

Returns

Promise<EmailVerificationResponse>


verifyOrgDomainOwnership()

verifyOrgDomainOwnership(orgIdOrUuid, domainUuid): Promise<OwnershipVerificationResponse>

Defined in: packages/sdk/src/api/org.ts:559

Verify domain ownership by checking the _gravity-verify TXT record.

Parameters

orgIdOrUuid

string | number

domainUuid

string

Returns

Promise<OwnershipVerificationResponse>


verifyOrgDomainSite()

verifyOrgDomainSite(orgIdOrUuid, domainUuid): Promise<SiteVerificationResponse>

Defined in: packages/sdk/src/api/org.ts:674

Verify the site CNAME points at the Gravity Rail sites domain.

Parameters

orgIdOrUuid

string | number

domainUuid

string

Returns

Promise<SiteVerificationResponse>