Skip to content

Commit 2f2381e

Browse files
efassorclaude
andauthored
Add POST /companies/{id}/notes endpoint to OpenAPI spec (#374)
* Add POST /companies/{id}/notes endpoint to OpenAPI spec (Unstable) ### Why? The implementation in PR #470943 adds the ability to create notes on company records via the API, but requires corresponding OpenAPI documentation. ### How? Add the POST endpoint to the Unstable version of the OpenAPI spec, following the same pattern as the existing POST /contacts/{id}/notes endpoint. <sub>Generated with Claude Code</sub> * Fix OpenAPI spec issues based on code review Fixes: - Remove company_id from request body (conflicts with path parameter) - Add 401 Unauthorized response - Clarify 404 description (company OR admin not found) - Improve admin_id description (explain default behavior) - Remove company_id from request examples Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent f7655dd commit 2f2381e

File tree

1 file changed

+101
-0
lines changed

1 file changed

+101
-0
lines changed

descriptions/0/api.intercom.io.yaml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3323,6 +3323,107 @@ paths:
33233323
message: Company Not Found
33243324
schema:
33253325
"$ref": "#/components/schemas/error"
3326+
post:
3327+
summary: Create a company note
3328+
parameters:
3329+
- name: Intercom-Version
3330+
in: header
3331+
schema:
3332+
"$ref": "#/components/schemas/intercom_version"
3333+
- name: id
3334+
in: path
3335+
required: true
3336+
description: The unique identifier for the company which is given by Intercom
3337+
example: 5f4d3c1c-7b1b-4d7d-a97e-6095715c6632
3338+
schema:
3339+
type: string
3340+
tags:
3341+
- Notes
3342+
- Companies
3343+
operationId: createCompanyNote
3344+
description: You can add a note to a single company.
3345+
responses:
3346+
'200':
3347+
description: Successful response
3348+
content:
3349+
application/json:
3350+
examples:
3351+
Successful response:
3352+
value:
3353+
type: note
3354+
id: '31'
3355+
created_at: 1734537390
3356+
company:
3357+
type: company
3358+
id: 5f4d3c1c-7b1b-4d7d-a97e-6095715c6632
3359+
author:
3360+
type: admin
3361+
id: '991267583'
3362+
name: Ciaran124 Lee
3363+
email: admin124@email.com
3364+
away_mode_enabled: false
3365+
away_mode_reassign: false
3366+
body: "<p>Hello</p>"
3367+
schema:
3368+
"$ref": "#/components/schemas/note"
3369+
'401':
3370+
description: Unauthorized
3371+
content:
3372+
application/json:
3373+
schema:
3374+
"$ref": "#/components/schemas/error"
3375+
'404':
3376+
description: Company or admin not found
3377+
content:
3378+
application/json:
3379+
examples:
3380+
Admin not found:
3381+
value:
3382+
type: error.list
3383+
request_id: 168f1bc3-d198-4797-8422-9f93fe8af5ad
3384+
errors:
3385+
- code: not_found
3386+
message: Resource Not Found
3387+
Company not found:
3388+
value:
3389+
type: error.list
3390+
request_id: 6f372239-0259-428f-9943-91b8f7a92162
3391+
errors:
3392+
- code: company_not_found
3393+
message: Company Not Found
3394+
schema:
3395+
"$ref": "#/components/schemas/error"
3396+
requestBody:
3397+
content:
3398+
application/json:
3399+
schema:
3400+
type: object
3401+
required:
3402+
- body
3403+
properties:
3404+
body:
3405+
type: string
3406+
description: The text of the note.
3407+
example: New note
3408+
admin_id:
3409+
type: string
3410+
description: The unique identifier of the admin creating the note. If not provided, defaults to the admin associated with the access token.
3411+
example: '991267583'
3412+
examples:
3413+
successful_response:
3414+
summary: Successful response
3415+
value:
3416+
body: Hello
3417+
admin_id: '991267583'
3418+
admin_not_found:
3419+
summary: Admin not found
3420+
value:
3421+
body: Hello
3422+
admin_id: '123'
3423+
company_not_found:
3424+
summary: Company not found
3425+
value:
3426+
body: Hello
33263427
"/companies/list":
33273428
post:
33283429
summary: List all companies

0 commit comments

Comments
 (0)