Skip to content

Align the 2.17 and Preview companies endpoints with what the API does - #758

Merged
markdennis22 merged 6 commits into
mainfrom
markdennis/2-17-companies
Oct 22, 2026
Merged

markdennis22 merged 6 commits into
mainfrom
markdennis/2-17-companies

Conversation

@markdennis22

@markdennis22 markdennis22 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Why?

The 2.17 spec for the companies endpoints didn't match the API. company.notes had a shape the API never sends, the lists described cursor paging where the API pages by number, and most error responses were missing. The Preview spec had the same problems, and the next version is cut from Preview, so it needs the same fixes.

How?

Corrects the companies endpoints and company schemas to match the API's current behaviour, and adds the OAuth scopes each endpoint accepts to its description. The same changes go into the Preview spec, keeping content that only applies to Preview, such as the {id} path parameter name.

Risks

The Preview SDKs are generated from this spec, so these changes affect generated Preview types:

Change Could SDK code stop compiling? Did that code work before?
Company.notes becomes a list object (type, data, url, total_count, has_more) instead of a notes array Yes, if it reads notes.notes No. The API sends the list object
CompanyNote loses created_at, company and author, gains url, and the CompanyNoteCompany type is removed Yes, if it reads those fields No. Notes embedded in a company never carry them
CompanyList.pages becomes PagesLink instead of CursorPages Yes, if it reads pages.next as an object No. The API sends a URL
CompanyScroll.pages is no longer CursorPages and is always null Yes, if it reads pages No. The API always sends null
Search companies returns a new CompanySearchResponse instead of CompanyList Possibly, because the return type is renamed Yes. The response itself is unchanged
Retrieve a company by ID returns Company or a new CompanyUserList instead of only Company Yes, if it reads the result as a Company without narrowing Yes. A company is still returned unless type is user or users
Retrieve companies gains CompanyUserList as a third response shape Possibly, if it matches on every shape Yes. A company or company list is still returned unless type is user or users and company_id or name is set
List companies order becomes an asc/desc enum, and both retrieve operations gain a type enum Unlikely Other order values were already rejected
New optional id on the create request and query parameters on list attached contacts No —
Notes for reviewers
  • fern check shows 0 errors and the same 317 warnings as main. There are no new dangling refs, and the operations are unchanged.
  • In Preview, notes in the company examples and update_last_request_at in the update request were already there, so they keep their place and take the 2.17 values.

Generated with Claude Code

markdennis22 and others added 6 commits October 22, 2026 09:50
Gives company.notes the list shape the API sends, switches the page-number lists to pages_link, splits out the search response, documents the 400s and 503s the API returns, and adds the accepted OAuth scopes to most operations.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The create and update company requests reject an array value with a 400, reference attributes included, which is what the scalar-only schema already says.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
With `type` set to `user` or `users`, both retrieve-company operations return a paged `user.list` of the company's users instead of the company, so each 200 now lists that shape too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The search Pagination note said a cursor sent with a different sort
returns a 400. Only a cursor from a text sort sent with a number or date
sort, or the other way round, gets the 400. Other sort changes are
accepted and return a page that doesn't follow on.

Puts back the scroll network-timeouts admonition.

Also documents the users-mode 400s on retrieving a company by id, adds
maximum: 60 to per_page on both retrieve operations, says the company
list and user list send pages.next as null on the last page, and says a
monthly_spend of 2147483647, or -2147483648 or below, returns a 422.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Applies the 2.17 Companies changes from #758 to the Preview spec, merged
operation by operation so Preview-only content is kept: the {id} path
parameter name and the update request without the bad_request example.
Preview already had notes in the company examples and
update_last_request_at in the update request, so those keep their place
and take the 2.17 values.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@markdennis22 markdennis22 changed the title Align the 2.17 companies endpoints with what the API does Align the 2.17 and Preview companies endpoints with what the API does Oct 22, 2026

@cathalging cathalging 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.

Approving. One existing sentence is worth fixing here or in a follow-up, your call: the companies scroll warning (2.17 L9034, Preview L7794). When the scroll fails on a network error, the API returns a generic 500 server_error rather than the quoted message. The open scroll also isn't cleared, so starting a new one within a minute returns 400 scroll_exists. Suggest saying the request returns a 500, and to wait up to a minute before starting a new scroll.

~ Automated via Claude (about: https://github.com/intercom/claude-plugins/blob/main/plugins/base/docs/external-message-attribution.md)

@markdennis22
markdennis22 merged commit 724601e into main Oct 22, 2026
4 checks passed
@markdennis22
markdennis22 deleted the markdennis/2-17-companies branch October 22, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants