diff --git a/static/oas/Codat-Platform.json b/static/oas/Codat-Platform.json index 0acf7f001..2dc5d79f7 100644 --- a/static/oas/Codat-Platform.json +++ b/static/oas/Codat-Platform.json @@ -1510,6 +1510,151 @@ } } }, + "/companies/{companyId}/syncSettings": { + "parameters": [ + { + "$ref": "#/components/parameters/companyId" + } + ], + "get": { + "summary": "Get company sync settings", + "tags": [ + "Companies" + ], + "operationId": "get-company-syncSettings", + "x-speakeasy-name-override": "get-company-sync-settings", + "description": "Retrieve the [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for a specific company. This includes how often data types should be queued to be updated, and how much history should be fetched.", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CompanySyncSettings" + }, + "examples": { + "Example": { + "value": { + "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", + "settings": [ + { + "dataType": "invoices", + "fetchOnFirstLink": true, + "syncSchedule": 24, + "syncOrder": 0, + "syncFromUtc": "2020-01-01T12:00:00.000Z", + "syncFromWindow": 24, + "monthsToSync": 24, + "isLocked": true + } + ], + "overridesDefaults": true + } + } + } + } + } + }, + "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" + } + } + }, + "post": { + "summary": "Set company sync settings", + "description": "Set the sync settings for a specific company.", + "tags": [ + "Companies" + ], + "operationId": "set-company-syncSettings", + "x-speakeasy-name-override": "set-company-sync-settings", + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "$ref": "#/components/responses/Bad-Request" + }, + "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": { + "allOf": [ + { + "properties": { + "companyId": { + "type": "string", + "format": "uuid", + "example": "8a210b68-6988-11ed-a1eb-0242ac120002", + "description": "Unique identifier for your SMB in Codat." + }, + "settings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SyncSetting" + } + }, + "overridesDefaults": { + "type": "boolean", + "default": true, + "description": "Set to `True` if you want to override default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings)." + } + }, + "required": [ + "companyId", + "settings", + "overridesDefaults" + ] + } + ], + "type": "object" + } + } + }, + "description": "Include a `syncSetting` object for each data type.\n`syncFromWindow`, `syncFromUTC` & `monthsToSync` only need to be included if you wish to set a value for them." + } + } + }, "/companies/{companyId}/connectionManagement/accessToken": { "parameters": [ { @@ -5152,7 +5297,7 @@ "type": "object", "properties": { "id": { - "$ref": "#/components/parameters/companyId/schema" + "$ref": "#/paths/~1companies~1%7BcompanyId%7D~1syncSettings/post/requestBody/content/application~1json/schema/allOf/0/properties/companyId" }, "name": { "type": "string", @@ -5227,7 +5372,7 @@ "type": "object", "properties": { "id": { - "$ref": "#/components/parameters/companyId/schema" + "$ref": "#/paths/~1companies~1%7BcompanyId%7D~1syncSettings/post/requestBody/content/application~1json/schema/allOf/0/properties/companyId" }, "name": { "$ref": "#/components/schemas/Company/definitions/companyDetails/properties/name" @@ -5374,6 +5519,25 @@ } } }, + "CompanySyncSettings": { + "title": "Company sync settings", + "type": "object", + "properties": { + "companyId": { + "$ref": "#/paths/~1companies~1%7BcompanyId%7D~1syncSettings/post/requestBody/content/application~1json/schema/allOf/0/properties/companyId" + }, + "settings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SyncSetting" + } + }, + "overridesDefaults": { + "type": "boolean", + "description": "Set to `True` if you want to override the default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings)." + } + } + }, "CompanyWebhook": { "title": "Company webhook", "type": "object", @@ -6735,7 +6899,7 @@ "description": "The type of data being pushed, eg invoices, customers." }, "companyId": { - "$ref": "#/components/parameters/companyId/schema" + "$ref": "#/paths/~1companies~1%7BcompanyId%7D~1syncSettings/post/requestBody/content/application~1json/schema/allOf/0/properties/companyId" }, "pushOperationKey": { "type": "string", @@ -7805,10 +7969,7 @@ "in": "path", "required": true, "schema": { - "type": "string", - "format": "uuid", - "example": "8a210b68-6988-11ed-a1eb-0242ac120002", - "description": "Unique identifier for your SMB in Codat." + "$ref": "#/paths/~1companies~1%7BcompanyId%7D~1syncSettings/post/requestBody/content/application~1json/schema/allOf/0/properties/companyId" }, "description": "Unique identifier for a company." }, diff --git a/static/oas/Codat-Spend-Insights.json b/static/oas/Codat-Spend-Insights.json index f836af8a7..41ca25d31 100644 --- a/static/oas/Codat-Spend-Insights.json +++ b/static/oas/Codat-Spend-Insights.json @@ -1990,38 +1990,6 @@ } } }, - "Malformed-Query": { - "description": "Your `query` parameter was not correctly formed", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/responses/Conflict/content/application~1json/schema" - }, - "examples": { - "Malformed query": { - "value": { - "statusCode": 400, - "service": "ClientsApi", - "error": "Error parsing query - Malformed query.", - "correlationId": "bc997528a9d7abb9161ef45f05d38599", - "canBeRetried": "Unknown", - "detailedErrorCode": 0 - } - }, - "Unresolved property": { - "value": { - "statusCode": 400, - "service": "PullApi", - "error": "Error parsing query - Could not resolve property isCompleted on Dataset", - "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", - "canBeRetried": "Unknown", - "detailedErrorCode": 0 - } - } - } - } - } - }, "Unauthorized": { "description": "Your API request was not properly authorized.", "content": { diff --git a/static/oas/Codat-Sync-Commerce.json b/static/oas/Codat-Sync-Commerce.json index f0f59c445..1bf48610a 100644 --- a/static/oas/Codat-Sync-Commerce.json +++ b/static/oas/Codat-Sync-Commerce.json @@ -1904,7 +1904,7 @@ "type": "object", "properties": { "companyId": { - "$ref": "#/components/parameters/companyId" + "$ref": "#/components/parameters/companyId/schema" }, "accountingSoftwareCompanyName": { "type": "string",