Skip to content

feat: Add IT Contacts API - #1681

Open
jonatascastro12 wants to merge 2 commits into
mainfrom
devin/1787249045-it-contacts
Open

feat: Add IT Contacts API#1681
jonatascastro12 wants to merge 2 commits into
mainfrom
devin/1787249045-it-contacts

Conversation

@jonatascastro12

@jonatascastro12 jonatascastro12 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Description

Adds the org-scoped IT Contacts endpoints to the Organizations service, per review feedback that IT contacts are an organization subresource rather than a top-level resource:

await workos.organizations.listItContacts({ organizationId });
await workos.organizations.createItContact({ organizationId, email });
await workos.organizations.deleteItContact({ organizationId, contactId });
await workos.organizations.inviteItContact({ organizationId, contactId, intents: [ItContactIntent.SSO] });
await workos.organizations.revokeItContact({ organizationId, contactId });

Matching naming policy in openapi-spec: workos/openapi-spec#110 (OrganizationsItContacts -> Organizations, concise operation names).

Notes on why this is hand-written rather than emitted by oagen: src/organizations/organizations.ts in this repo is still the pre-oagen hand-written service. Running sdk:generate --lang node scoped to Organizations replaces it wholesale, which changes existing public signatures (getOrganization(id) -> options object, same for deleteOrganization/updateOrganization), pulls in unrelated Organization/OrganizationDomain model drift, adds unrelated endpoints (audit log configuration, authorized applications) and does not typecheck as-is — ~600 lines of breaking churn unrelated to IT contacts. So this PR follows the existing conventions of that directory (List<ItContact> from common/interfaces, Serialized*Options request shapes, serializers in src/organizations/serializers) and leaves the Organizations generation migration as separate work, which will subsume these methods.

No SDK wiring changes needed: src/index.ts and src/index.worker.ts already re-export ./organizations/interfaces, so ItContact, ItContactIntent and the option types are exported from both barrels.

Tests: five new cases in src/organizations/organizations.spec.ts covering method, path and request body for each operation. npm run lint, npm run typecheck and npm test pass locally.

Documentation

Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.

[ ] Yes

The IT Contacts reference docs already exist; they may want Node snippets once this ships.

Link to Devin session: https://app.devin.ai/sessions/2633e183d1b146d6a18a87e0e1b9c42b
Requested by: @jonatascastro12

Generate the ItContacts service from the OpenAPI spec and expose it as
workos.itContacts, with list/create/delete/invite/revoke operations.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor
Original prompt from jonatas

Please work on ticket "Add IT Contacts API to Node SDK" (ENT-6867)

@playbook:playbook-b0d9a34380374c3e903d900d340d8da7

@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot changed the title Add IT Contacts API feat: Add IT Contacts API Aug 20, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Open in Devin Review

Comment thread src/it-contacts/interfaces/index.ts Outdated
Comment on lines +9 to +11
export * from './it-contact.interface';
export * from './list-it-contacts-options.interface';
export * from './revoke-it-contact-options.interface';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 List response types for IT contacts are not publicly exported

The public type describing the IT contacts list result is left out of the module's export list (src/it-contacts/interfaces/index.ts:3-11), so anyone importing the SDK cannot reference the return type of the list operation even though every other list-returning module exposes it.
Impact: Consumers of the published package cannot import ItContactList/ItContactListListMetadata (and their response variants) to type their own code, unlike every other list-returning service.

Barrel omission vs. established generated pattern

The interfaces barrel src/it-contacts/interfaces/index.ts exports 9 interface files but omits it-contact-list.interface and it-contact-list-list-metadata.interface, both of which exist and are listed in .oagen-manifest.json:87,96,97. listItContacts returns Promise<ItContactList> (src/it-contacts/it-contacts.ts:38), and the top-level package re-exports this barrel via export * from './it-contacts/interfaces' (src/index.ts:27). By comparison, the analogous generated module exports its list-response interface in the barrel (e.g. src/pipes/interfaces/index.ts exports data-integrations-list-response.interface), and the it-contacts serializers barrel (src/it-contacts/serializers/index.ts:6-7) does export the corresponding list serializers, showing the interfaces barrel is inconsistent/incomplete.

Suggested change
export * from './it-contact.interface';
export * from './list-it-contacts-options.interface';
export * from './revoke-it-contact-options.interface';
export * from './it-contact.interface';
export * from './it-contact-list.interface';
export * from './it-contact-list-list-metadata.interface';
export * from './list-it-contacts-options.interface';
export * from './revoke-it-contact-options.interface';
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is deliberate emitter behaviour, not an omission in this PR: the node barrel generator skips list-wrapper and list-metadata models — if (isListMetadataModel(model) || isListWrapperModel(model)) continue; in generateServiceBarrels (@workos/oagen-emitters). Other services just don't have a *-list.interface.ts today (IT Contacts is the first generated non-paginated list endpoint), so there's no precedent being broken; the pipes example is a *-list-response model, which isn't a list wrapper.

Since these files are generated and must not be hand-edited, exporting ItContactList/ItContactListListMetadata would need a change in the emitter rather than here. Leaving as generated; happy to file that upstream if we want list wrappers in the public type surface.

Comment thread src/it-contacts/it-contacts.ts Outdated
Comment on lines +38 to +44
async listItContacts(options: ListItContactsOptions): Promise<ItContactList> {
const { organizationId } = options;
const { data } = await this.workos.get<ItContactListResponse>(
`/organizations/${encodeURIComponent(organizationId)}/it_contacts`,
);
return deserializeItContactList(data);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 listItContacts does not use AutoPaginatable unlike Groups

listItContacts (src/it-contacts/it-contacts.ts:38-44) performs a plain GET and returns a materialized ItContactList rather than wrapping in AutoPaginatable and accepting pagination options, unlike the analogous listGroups in src/groups/groups.ts. The response still carries list_metadata cursors, so callers cannot auto-paginate. This appears intentional as generated output for this endpoint, but worth confirming against the spec that IT contacts are not paginated.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct as generated: GET /organizations/{organization_id}/it_contacts takes no pagination parameters in the spec (only the organization_id path param), so there is nothing for AutoPaginatable to page with. The list_metadata cursors come from the shared list wrapper shape. If the API adds limit/before/after later, regenerating will pick up the paginated shape.

@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR moves the IT Contacts API into the organization-scoped service and adds its public models, serializers, fixtures, and tests.

  • Adds list, create, delete, invite, and revoke operations under workos.organizations.
  • Converts IT Contact API responses into camelCase SDK models.
  • Exports the new request and response types through the organizations interface barrel.

Confidence Score: 5/5

The PR appears safe to merge with no blocking failure remaining from the applicable previous review thread.

No blocking failure remains.

Important Files Changed

Filename Overview
src/organizations/organizations.ts Adds the five organization-scoped IT Contact operations using the shared HTTP client and serializers.
src/organizations/interfaces/it-contact-options.interface.ts Defines the public operation options, serialized payloads, and supported IT Contact intents.
src/organizations/interfaces/it-contact.interface.ts Defines the API response shape and camelCase public IT Contact model.
src/organizations/serializers/it-contact-options.serializer.ts Restricts create and invite request bodies to their API payload fields.
src/organizations/serializers/it-contact.serializer.ts Maps snake_case IT Contact timestamps to the public camelCase model.
src/organizations/organizations.spec.ts Covers the methods, HTTP verbs, endpoint paths, request bodies, and response conversion.

Sequence Diagram

sequenceDiagram
  participant App as SDK Consumer
  participant Organizations as workos.organizations
  participant API as WorkOS API
  App->>Organizations: list/create/delete/invite/revoke IT Contact
  Organizations->>API: "/organizations/{organizationId}/it_contacts/..."
  API-->>Organizations: IT Contact, list, or empty response
  Organizations-->>App: camelCase model, list, or void
Loading

Reviews (2): Last reviewed commit: "Move IT contacts onto the Organizations ..." | Re-trigger Greptile

Comment thread src/index.ts Outdated
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant