-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodat-platform-openapi.json
More file actions
8121 lines (8121 loc) · 308 KB
/
Copy pathcodat-platform-openapi.json
File metadata and controls
8121 lines (8121 loc) · 308 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"openapi": "3.1.0",
"x-stoplight": {
"id": "466k6ayziv9at"
},
"servers": [
{
"description": "Production",
"url": "https://api.codat.io"
}
],
"info": {
"title": "Platform API",
"version": "3.0.0",
"summary": "Platform API",
"description": "An API for the common components of all of Codat's products.\n\nThese end points cover creating and managing your companies, data connections, and integrations.\n\n[Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) \n\n---\n<!-- Start Codat Tags Table -->\n## Endpoints\n\n| Endpoints | Description |\n| :- |:- |\n| Companies | Create and manage your SMB users' companies. |\n| Connections | Create new and manage existing data connections for a company. |\n| Connection management | Configure connection management UI and retrieve access tokens for authentication. |\n| Webhooks | Create and manage webhooks that listen to Codat's events. |\n| Integrations | Get a list of integrations supported by Codat and their logos. |\n| Refresh data | Initiate data refreshes, view pull status and history. |\n| Settings | Manage company profile configuration, sync settings, and API keys. |\n| Push data | Initiate and monitor Create, Update, and Delete operations. |\n| Supplemental data | Configure and pull additional data you can include in Codat's standard data types. |\n| Custom data type | Configure and pull additional data types that are not included in Codat's standardized data model. |\n<!-- End Codat Tags Table -->",
"contact": {
"name": "Codat",
"email": "support@codat.io"
},
"termsOfService": "https://www.codat.io/legals/"
},
"security": [
{
"auth_header": []
}
],
"x-speakeasy-retries": {
"strategy": "backoff",
"backoff": {
"initialInterval": 500,
"maxInterval": 60000,
"maxElapsedTime": 3600000,
"exponent": 1.5
},
"statusCodes": [
408,
429,
"5XX"
],
"retryConnectionErrors": true
},
"x-speakeasy-name-override": [
{
"operationId": "^list-.*?",
"methodNameOverride": "list"
},
{
"operationId": "^list-.*?-attachments",
"methodNameOverride": "list-attachments"
},
{
"operationId": "^get-.*?",
"methodNameOverride": "get"
},
{
"operationId": "^get-create-.*?-model",
"methodNameOverride": "get-create-model"
},
{
"operationId": "^get-create-update.*?-model",
"methodNameOverride": "get-create-update-model"
},
{
"operationId": "^get-.*?-attachment",
"methodNameOverride": "get-attachment"
},
{
"operationId": "^update-.*?",
"methodNameOverride": "update"
},
{
"operationId": "^create-.*?",
"methodNameOverride": "create"
},
{
"operationId": "^delete-.*?",
"methodNameOverride": "delete"
},
{
"operationId": "^delete-.*?-attachment",
"methodNameOverride": "delete-attachment"
},
{
"operationId": "^download-.*?-attachment",
"methodNameOverride": "download-attachment"
},
{
"operationId": "^upload-.*?-attachment",
"methodNameOverride": "upload-attachment"
}
],
"x-codat-docs-path": "platform-api",
"x-codat-keep-docs-paths-local": true,
"x-codat-speakeasy-pagination": {
"type": "offsetLimit",
"inputs": [
{
"name": "page",
"in": "parameters",
"type": "page"
}
],
"outputs": {
"results": "$.results"
}
},
"tags": [
{
"name": "Companies",
"description": "Create and manage your SMB users' companies."
},
{
"name": "Connection management",
"description": "Configure UI and retrieve access tokens for authentication used by **Connections SDK**."
},
{
"name": "Connections",
"description": "Create new and manage existing data connections for a company."
},
{
"name": "Webhooks",
"description": "Create and manage webhooks that listen to Codat's events."
},
{
"name": "Integrations",
"description": "Get a list of integrations supported by Codat and their logos."
},
{
"name": "Refresh data",
"description": "Initiate data refreshes, view pull status and history."
},
{
"name": "Settings",
"description": "Manage company profile configuration, sync settings, and API keys."
},
{
"name": "Push data",
"description": "Initiate and monitor Create, Update, and Delete operations."
},
{
"name": "Read data",
"description": "View validation outcomes for completed read data operations."
},
{
"name": "Supplemental data",
"description": "Configure and pull additional data you can include in Codat's standard data types."
},
{
"name": "Custom data type",
"description": "Configure and pull additional data types that are not included in Codat's standardized data model."
}
],
"paths": {
"/companies": {
"get": {
"summary": "List companies",
"tags": [
"Companies"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Companies"
},
"examples": {
"One company": {
"value": {
"results": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "My Test Company",
"description": "My Test Company make testing software",
"platform": "",
"redirect": "https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6",
"lastSync": "2022-01-01T12:30:00.000Z",
"dataConnections": [
{
"id": "51baa045-4836-4317-a42e-3542e991e581",
"integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390",
"integrationKey": "vjms",
"sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b",
"platformName": "Pandle",
"linkUrl": "https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start",
"status": "Linked",
"lastSync": "2022-01-01T12:30:00.000Z",
"created": "2022-01-01T11:30:00Z",
"sourceType": "Accounting"
}
],
"created": "2022-01-01T11:30:00Z",
"createdByUserName": "Mike Smith",
"products": [
"spend-insights",
"lending",
"expenses-v1",
"commerce"
],
"referenceSubsidiaryCompanies": []
}
],
"pageNumber": 1,
"pageSize": 100,
"totalResults": 1,
"_links": {
"current": {
"href": "/companies?page=1&pageSize=100"
},
"self": {
"href": "/companies"
}
}
}
},
"List of Companies": {
"value": {
"results": [
{
"id": "d1568dde-adf6-11ed-afa1-0242ac120002",
"name": "Technicalium",
"description": "Technology services, including web and app design and development",
"platform": "",
"redirect": "https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002",
"lastSync": "2022-01-01T12:30:00.000Z",
"dataConnections": [
{
"id": "51baa045-4836-4317-a42e-3542e991e581",
"integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390",
"integrationKey": "vjms",
"sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b",
"platformName": "Pandle",
"linkUrl": "https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start",
"status": "Linked",
"lastSync": "2022-01-01T12:30:00.000Z",
"created": "2022-01-01T11:30:00Z",
"sourceType": "Accounting"
}
],
"created": "2022-01-01T11:30:00Z",
"createdByUserName": "Joe Bloggs",
"products": [
"spend-insights",
"lending",
"payables-v2"
],
"referenceSubsidiaryCompanies": []
},
{
"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0",
"name": "Toft stores",
"redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0",
"dataConnections": [],
"created": "2022-11-10T10:45:18Z",
"createdByUserName": "Dan Tzabar",
"products": [
"spend-insights"
],
"referenceSubsidiaryCompanies": [
{
"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d",
"name": "Toft stores UK",
"links": {
"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"
}
},
{
"id": "db94eddc-9212-4568-9b5c-3eab0e325913",
"name": "Toft stores US",
"links": {
"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"
}
}
]
},
{
"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d",
"name": "Toft stores UK",
"redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d",
"dataConnections": [
{
"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e",
"integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137",
"integrationKey": "akxx",
"sourceId": "9815b998-024d-4415-a40b-89903b2cad6f",
"platformName": "Oracle NetSuite",
"linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start",
"status": "Linked",
"lastSync": "2022-01-01T12:30:00.000Z",
"created": "2022-01-01T11:30:00Z",
"sourceType": "Accounting"
}
],
"created": "2022-11-10T10:45:18Z",
"createdByUserName": "Dan Tzabar",
"products": [
"lending",
"spend-insights",
"payables"
],
"referenceParentCompany": {
"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0",
"name": "Toft stores",
"links": {
"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"
}
},
"referenceSubsidiaryCompanies": []
},
{
"id": "db94eddc-9212-4568-9b5c-3eab0e325913",
"name": "Toft stores US",
"redirect": "https://link.codat.io/company/db94eddc-9212-4568-9b5c-3eab0e325913",
"dataConnections": [
{
"id": "1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb",
"integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137",
"integrationKey": "akxx",
"sourceId": "9815b998-024d-4415-a40b-89903b2cad6f",
"platformName": "Oracle NetSuite",
"linkUrl": "https://link-api.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/connections/1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb/start",
"status": "Linked",
"lastSync": "2022-01-01T12:30:00.000Z",
"created": "2022-01-01T11:30:00Z",
"sourceType": "Accounting"
}
],
"created": "2022-11-10T10:45:18Z",
"createdByUserName": "Dan Tzabar",
"products": [
"spend-insights"
],
"referenceParentCompany": {
"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0",
"name": "Toft stores",
"links": {
"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"
}
},
"referenceSubsidiaryCompanies": []
}
],
"pageNumber": 1,
"pageSize": 100,
"totalResults": 3,
"_links": {
"current": {
"href": "/companies?page=1&pageSize=100"
},
"self": {
"href": "/companies"
}
}
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/Malformed-Query"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/Payment-Required"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/Not-Found"
},
"429": {
"$ref": "#/components/responses/Too-Many-Requests"
},
"500": {
"$ref": "#/components/responses/Internal-Server-Error"
},
"503": {
"$ref": "#/components/responses/Service-Unavailable"
}
},
"operationId": "list-companies",
"description": "The *List companies* endpoint returns a list of [companies](https://docs.codat.io/platform-api#/schemas/Company) associated to your instances.\n\nA [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.\n\n## Filter by tags\n\nThe *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying):\n\n- equals (`=`)\n- not equals (`!=`)\n- contains (`~`)\n\nFor example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: \n- Foreign key: `uid = {yourCustomerId}`\n- Region: `region != uk`\n- Owning team and region: `region = uk && owningTeam = invoice-finance`",
"parameters": [
{
"$ref": "#/components/parameters/page"
},
{
"$ref": "#/components/parameters/pageSize"
},
{
"$ref": "#/components/parameters/query"
},
{
"$ref": "#/components/parameters/orderBy"
},
{
"name": "tags",
"in": "query",
"schema": {
"type": "string"
},
"example": "region=uk && team=invoice-finance",
"description": "Filter companies by tags using the \"equals\" (=), \"not equals\" (!=), and \"contains\" (~) operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying)."
}
]
},
"post": {
"summary": "Create company",
"tags": [
"Companies"
],
"operationId": "create-company",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"x-speakeasy-usage-example": true,
"schema": {
"$ref": "#/components/schemas/Company"
},
"examples": {
"With no description": {
"value": {
"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0",
"name": "Technicalium",
"description": "",
"platform": "",
"redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0",
"dataConnections": [],
"created": "2022-11-10T10:45:18.1950523Z",
"createdByUserName": "Dan Tzabar",
"products": [
"spend-insights"
],
"referenceSubsidiaryCompanies": []
}
},
"With a description": {
"value": {
"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0",
"name": "Technicalium",
"description": "Technology services, including web and app design and development",
"platform": "",
"redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0",
"dataConnections": [],
"created": "2022-11-10T10:45:18.1950523Z",
"createdByUserName": "Dan Tzabar",
"products": [
"spend-insights"
],
"referenceSubsidiaryCompanies": []
}
},
"With a tag": {
"value": {
"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0",
"name": "Technicalium",
"description": "",
"platform": "",
"redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0",
"dataConnections": [],
"created": "2022-11-10T10:45:18.1950523Z",
"createdByUserName": "Dan Tzabar",
"products": [
"spend-insights"
],
"tags": {
"region": "us"
},
"referenceSubsidiaryCompanies": []
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/Bad-Request"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/Payment-Required"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"429": {
"$ref": "#/components/responses/Too-Many-Requests"
},
"500": {
"$ref": "#/components/responses/Internal-Server-Error"
},
"503": {
"$ref": "#/components/responses/Service-Unavailable"
}
},
"description": "Use the *Create company* endpoint to create a new [company](https://docs.codat.io/platform-api#/schemas/Company) that represents your customer in Codat. \n\nA [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.\n\nIf forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`.",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CompanyRequestBody"
},
"examples": {
"With no description": {
"value": {
"name": "Technicalium"
}
},
"With a description": {
"value": {
"name": "Technicalium",
"description": "Technology services, including web and app design and development"
}
}
}
}
}
}
}
},
"/companies/{companyId}": {
"get": {
"summary": "Get company",
"operationId": "get-company",
"description": "The *Get company* endpoint returns a single company for a given `companyId`.\n\nA [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.\n",
"parameters": [
{
"$ref": "#/components/parameters/companyId"
}
],
"tags": [
"Companies"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Company"
},
"examples": {
"Simple company": {
"value": {
"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0",
"name": "Toft stores holdings",
"description": "",
"platform": "",
"redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0",
"dataConnections": [],
"created": "2022-11-10T10:45:18Z",
"createdByUserName": "Dan Tzabar",
"products": [
"spend-insights",
"lending",
"expenses-v1",
"commerce"
],
"referenceSubsidiaryCompanies": []
}
},
"Parent multi-entity company": {
"value": {
"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0",
"name": "Toft stores",
"description": "",
"platform": "",
"redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0",
"dataConnections": [],
"created": "2022-11-10T10:45:18Z",
"createdByUserName": "Dan Tzabar",
"products": [
"spend-insights",
"lending",
"expenses-v1",
"commerce"
],
"referenceSubsidiaryCompanies": [
{
"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d",
"name": "Toft stores UK",
"links": {
"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"
}
},
{
"id": "db94eddc-9212-4568-9b5c-3eab0e325913",
"name": "Toft stores US",
"links": {
"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"
}
}
]
}
},
"Subsidiary multi-entity company": {
"value": {
"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d",
"name": "Toft stores UK",
"description": "",
"platform": "",
"redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d",
"dataConnections": [
{
"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e",
"integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137",
"integrationKey": "akxx",
"sourceId": "9815b998-024d-4415-a40b-89903b2cad6f",
"platformName": "Oracle NetSuite",
"linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start",
"status": "Linked",
"lastSync": "2022-01-01T12:30:00.000Z",
"created": "2022-01-01T11:30:00Z",
"sourceType": "Accounting"
}
],
"created": "2022-11-10T10:45:18Z",
"createdByUserName": "Dan Tzabar",
"products": [
"spend-insights",
"lending",
"expenses-v1",
"commerce"
],
"referenceParentCompany": {
"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0",
"name": "Toft stores",
"links": {
"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"
}
},
"referenceSubsidiaryCompanies": []
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/Payment-Required"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/Not-Found"
},
"429": {
"$ref": "#/components/responses/Too-Many-Requests"
},
"500": {
"$ref": "#/components/responses/Internal-Server-Error"
},
"503": {
"$ref": "#/components/responses/Service-Unavailable"
}
}
},
"delete": {
"summary": "Delete a company",
"operationId": "delete-company",
"parameters": [
{
"$ref": "#/components/parameters/companyId"
}
],
"description": "The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/platform-api#/schemas/Company), its [connections](https://docs.codat.io/platform-api#/schemas/Connection) and any cached data. This operation is irreversible.\n\nA [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.\n",
"tags": [
"Companies"
],
"responses": {
"204": {
"description": "No Content"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/Payment-Required"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/Not-Found"
},
"429": {
"$ref": "#/components/responses/Too-Many-Requests"
},
"500": {
"$ref": "#/components/responses/Internal-Server-Error"
},
"503": {
"$ref": "#/components/responses/Service-Unavailable"
}
}
},
"put": {
"summary": "Replace company",
"description": "Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload.\n\nA [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.",
"operationId": "replace-company",
"x-speakeasy-name-override": "replace",
"parameters": [
{
"$ref": "#/components/parameters/companyId"
}
],
"tags": [
"Companies"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Company"
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/Payment-Required"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/Not-Found"
},
"429": {
"$ref": "#/components/responses/Too-Many-Requests"
},
"500": {
"$ref": "#/components/responses/Internal-Server-Error"
},
"503": {
"$ref": "#/components/responses/Service-Unavailable"
}
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CompanyRequestBody"
},
"examples": {
"Update name": {
"value": {
"name": "New Name"
}
},
"Update description": {
"value": {
"name": "Same name",
"description": "Additional documents required"
}
}
}
}
}
}
},
"patch": {
"summary": "Update company",
"description": "Use the *Update company* endpoint to update the name, description, or tags of the company.\n\nThe *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. \n\nA [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data.",
"operationId": "update-company",
"parameters": [
{
"$ref": "#/components/parameters/companyId"
}
],
"tags": [
"Companies"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Company"
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/Payment-Required"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/Not-Found"
},
"429": {
"$ref": "#/components/responses/Too-Many-Requests"
},
"500": {
"$ref": "#/components/responses/Internal-Server-Error"
},
"503": {
"$ref": "#/components/responses/Service-Unavailable"
}
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CompanyUpdateRequest"
},
"examples": {
"Update tags": {
"value": {
"tags": {
"refrence": "new reference"
}
}
},
"Update name": {
"value": {
"name": "New Name"
}
}
}
}
}
}
}
},
"/companies/{companyId}/products/{productIdentifier}": {
"parameters": [
{
"$ref": "#/components/parameters/companyId"
},
{
"$ref": "#/components/parameters/productIdentifier"
}
],
"put": {
"summary": "Add product",
"operationId": "add-product",
"x-speakeasy-name-override": "add-product",
"description": "Use the *Add product* endpoint to enable a product for the company specified by `companyId`.\n\n> Note: This feature is currently in alpha and available only to participants in the development program.",
"tags": [
"Companies"
],
"responses": {
"204": {
"description": "OK"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/Payment-Required"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/Not-Found"
},
"429": {
"$ref": "#/components/responses/Too-Many-Requests"
},
"500": {
"$ref": "#/components/responses/Internal-Server-Error"
},
"503": {
"$ref": "#/components/responses/Service-Unavailable"
}
}
},
"delete": {
"summary": "Remove product",
"operationId": "remove-product",
"x-speakeasy-name-override": "remove-product",
"description": "Use the *Remove product* endpoint to disable a product for the company specified by `companyId`.\n\n> Note: This feature is currently in alpha and available only to participants in the development program.",
"tags": [
"Companies"
],
"responses": {
"204": {
"description": "OK"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/Payment-Required"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/Not-Found"
},
"429": {
"$ref": "#/components/responses/Too-Many-Requests"
},
"500": {
"$ref": "#/components/responses/Internal-Server-Error"
},
"503": {
"$ref": "#/components/responses/Service-Unavailable"
}
}
}
},
"/companies/{companyId}/products/{productIdentifier}/refresh": {
"parameters": [
{
"$ref": "#/components/parameters/companyId"
},
{
"$ref": "#/components/parameters/productIdentifier"
}
],
"post": {
"summary": "Refresh product data",
"operationId": "refresh-product-data",
"x-speakeasy-name-override": "refresh-product-data",
"description": "Use the **Refresh product data** endpoint to manually refresh data for a custom product for a specific company.\n\n### Tips and traps\n\n- This endpoint only supports refreshing data for **custom products** and can't be used for Codat's standard solutions. Refer to [individual solutions' documentation](https://docs.codat.io/) instead.\n- If a data sync is already in progress for a custom product, the refresh request will return a `Bad request (400)` response.\n- If a company has multiple custom products enabled, you can refresh data for each product individually.\n - Optionally include a request body with `dataTypes` to refresh only selected data types for the specified product. If omitted, the product's scheduled refresh is triggered as usual.\n - When specifying `dataTypes`, each value must be a valid data type supported by the product. Invalid values will result in a `Bad request (400)` response listing valid options.",
"tags": [
"Companies"
],
"requestBody": {
"required": false,
"description": "Optionally specify one or more data types to refresh for the given custom product. If omitted, the product's scheduled refresh is triggered as usual. When provided, each data type must be valid for the specified product.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"dataTypes": {
"type": "array",
"description": "One or more data types to refresh for the product.",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"examples": {
"Filter specific data types": {
"value": {
"dataTypes": [
"invoices",
"payments"
]
}
}
}
}
}
},
"responses": {
"202": {
"description": "OK"
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorMessage"
},
"examples": {
"Standard product not supported": {
"value": {
"statusCode": 400,
"service": "PublicApi",
"error": "Bank Feeds doesn't support data refreshing. For more information, refer to your solution’s documentation [here](https://docs.codat.io).",
"correlationId": "bc997528a9d7abb9161ef45f05d38599",
"canBeRetried": "Unknown",
"detailedErrorCode": 0
}
},
"Read in progress": {