|
404 | 404 | } |
405 | 405 | } |
406 | 406 | }, |
| 407 | + "/companies/{companyId}/reports/bundle": { |
| 408 | + "parameters": [ |
| 409 | + { |
| 410 | + "$ref": "#/components/parameters/companyId" |
| 411 | + }, |
| 412 | + { |
| 413 | + "name": "reportId", |
| 414 | + "description": "The identifier of the report to bundle. Only `latest` is supported.", |
| 415 | + "in": "query", |
| 416 | + "required": true, |
| 417 | + "schema": { |
| 418 | + "type": "string", |
| 419 | + "title": "Latest", |
| 420 | + "enum": [ |
| 421 | + "latest" |
| 422 | + ] |
| 423 | + } |
| 424 | + }, |
| 425 | + { |
| 426 | + "name": "lang", |
| 427 | + "description": "The language of the report files to bundle. Defaults to English.", |
| 428 | + "in": "query", |
| 429 | + "required": false, |
| 430 | + "schema": { |
| 431 | + "type": "string", |
| 432 | + "title": "Language", |
| 433 | + "enum": [ |
| 434 | + "en", |
| 435 | + "en-us", |
| 436 | + "en-gb", |
| 437 | + "fr", |
| 438 | + "fr-ca" |
| 439 | + ] |
| 440 | + } |
| 441 | + } |
| 442 | + ], |
| 443 | + "get": { |
| 444 | + "x-internal": true, |
| 445 | + "tags": [ |
| 446 | + "Spend analysis" |
| 447 | + ], |
| 448 | + "summary": "Download report bundle", |
| 449 | + "description": "The _Download report bundle_ endpoint returns a ZIP archive containing every file output of the company's latest generated [spend analysis report](https://docs.codat.io/spend-insights-api#/operations/generate-report) for the requested language.\n\nThe archive is returned with `Content-Disposition: attachment; filename={companyName}_SpendReports_{date}.zip`, where `{companyName}` is the company name sanitized for use in a file name and `{date}` is the bundle creation date in `yyyy-MM-dd` format. When a non-English `lang` is requested, a locale marker is appended before the date, for example `{companyName}_SpendReports_fr_{date}.zip`.\n\nEvery archive includes a `manifest.txt` file listing the report type, report ID, company ID, creation timestamp (UTC), and a correlation ID for support traceability, followed by one line per expected file with its status (`INCLUDED` or `FAILED`), timestamp, and failure reason, if any.\n\nIf at least one file can be bundled, the endpoint responds with a `200` status code and records any failed files in the manifest. The `X-Bundle-Partial` response header is set to `true` when one or more files failed, and the `X-Bundle-Included` and `X-Bundle-Total` headers indicate how many of the expected files were included. If no files can be bundled, the endpoint responds with a `500` status code and a correlation ID.\n", |
| 450 | + "operationId": "download-report-bundle", |
| 451 | + "x-speakeasy-name-override": "download-report-bundle", |
| 452 | + "responses": { |
| 453 | + "200": { |
| 454 | + "$ref": "#/components/responses/ReportBundle" |
| 455 | + }, |
| 456 | + "400": { |
| 457 | + "$ref": "#/components/responses/BadRequest" |
| 458 | + }, |
| 459 | + "401": { |
| 460 | + "$ref": "#/components/responses/Unauthorized" |
| 461 | + }, |
| 462 | + "402": { |
| 463 | + "$ref": "#/components/responses/Payment-Required" |
| 464 | + }, |
| 465 | + "403": { |
| 466 | + "$ref": "#/components/responses/Forbidden" |
| 467 | + }, |
| 468 | + "404": { |
| 469 | + "$ref": "#/components/responses/Not-Found" |
| 470 | + }, |
| 471 | + "429": { |
| 472 | + "$ref": "#/components/responses/Too-Many-Requests" |
| 473 | + }, |
| 474 | + "500": { |
| 475 | + "$ref": "#/components/responses/Internal-Server-Error" |
| 476 | + }, |
| 477 | + "503": { |
| 478 | + "$ref": "#/components/responses/Service-Unavailable" |
| 479 | + } |
| 480 | + } |
| 481 | + } |
| 482 | + }, |
407 | 483 | "/companies/{companyId}/data/info": { |
408 | 484 | "parameters": [ |
409 | 485 | { |
|
1968 | 2044 | } |
1969 | 2045 | } |
1970 | 2046 | }, |
| 2047 | + "ReportBundle": { |
| 2048 | + "description": "OK", |
| 2049 | + "headers": { |
| 2050 | + "Content-Disposition": { |
| 2051 | + "description": "Indicates the response is an attachment and provides the bundle file name, following the convention `attachment; filename={companyName}_SpendReports_{date}.zip`.", |
| 2052 | + "schema": { |
| 2053 | + "type": "string", |
| 2054 | + "example": "attachment; filename=ExampleCompany_SpendReports_2026-06-03.zip" |
| 2055 | + } |
| 2056 | + }, |
| 2057 | + "X-Bundle-Partial": { |
| 2058 | + "description": "Set to `true` when one or more expected files could not be included in the bundle. Failed files are recorded in the `manifest.txt` inside the archive.", |
| 2059 | + "schema": { |
| 2060 | + "type": "string", |
| 2061 | + "enum": [ |
| 2062 | + "true", |
| 2063 | + "false" |
| 2064 | + ] |
| 2065 | + } |
| 2066 | + }, |
| 2067 | + "X-Bundle-Included": { |
| 2068 | + "description": "The number of files included in the bundle.", |
| 2069 | + "schema": { |
| 2070 | + "type": "integer" |
| 2071 | + } |
| 2072 | + }, |
| 2073 | + "X-Bundle-Total": { |
| 2074 | + "description": "The total number of files expected in the bundle.", |
| 2075 | + "schema": { |
| 2076 | + "type": "integer" |
| 2077 | + } |
| 2078 | + } |
| 2079 | + }, |
| 2080 | + "content": { |
| 2081 | + "application/zip": { |
| 2082 | + "schema": { |
| 2083 | + "title": "Data", |
| 2084 | + "type": "string", |
| 2085 | + "format": "binary" |
| 2086 | + } |
| 2087 | + } |
| 2088 | + } |
| 2089 | + }, |
1971 | 2090 | "BadRequest": { |
1972 | 2091 | "description": "The request made is not valid.", |
1973 | 2092 | "content": { |
|
0 commit comments