# Integrations & imports

Jira CSV import, repository connections, provider settings and connected apps.

0 operation(s) for tokens, 18 app-only. The full schemas are in [openapi.json](https://docs.youniton.com/openapi.json) (search the operation ID).

## Start a Jira CSV import into one project (beta, behind the jira_csv_import flag)

`POST /imports`

- Operation ID: `startJiraImport`
- Call with: Session of the Youniton apps (app only)
- Feature: F-INT-09

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |

Request body (application/json, required): `object`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | A draft import; upload the CSV with purpose import_source and target import(id). | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The import's state, progress, counts and first row errors

`GET /imports/{importId}`

- Operation ID: `getJiraImport`
- Call with: Session of the Youniton apps (app only)
- Feature: F-INT-09

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `importId` | path | string (uuid) | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The import. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Cancel a queued or running import or dry run; committed batches stay

`POST /imports/{importId}/cancel`

- Operation ID: `cancelJiraImport`
- Call with: Session of the Youniton apps (app only)
- Feature: F-INT-09

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `importId` | path | string (uuid) | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | Cancelled (or already finished — the current state is returned). | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Check the uploaded CSV against the mapping — counts and row errors, nothing written

`POST /imports/{importId}/dry-run`

- Operation ID: `checkJiraImport`
- Call with: Session of the Youniton apps (app only)
- Feature: F-INT-09

XM-1241: the request reads its files within integrations.import.checkTimeBudgetSeconds (one parse of the CSV, the options of the fields to create, the archive's directory); when the budget is spent, 422 integration.import_check_too_large (budgetSeconds) before anything is created — split the export. One check at a time per import and integrations.import.checksPerMinute per tenant (429 rate_limit.exceeded, limiter jira-check-import or jira-check, Retry-After; 503 service.unavailable when the counter store fails). An archive that holds none of the attachment ids the export names is 422 integration.import_file_invalid (reason layout) at /attachmentsFileId.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `importId` | path | string (uuid) | yes |  |

Request body (application/json, required): `JiraImportDryRunInput`

| Status | Description | Content type | Type |
|---|---|---|---|
| 202 | The dry run is queued. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The profile of a file uploaded for the import, for the mapping step — rows, statuses, custom-field columns (R13; XM-1080)

`GET /imports/{importId}/profile`

- Operation ID: `getJiraImportProfile`
- Call with: Session of the Youniton apps (app only)
- Feature: F-INT-09

Read on each request from the import's own file and never stored. Holds cell values: operators are refused (403 proposal.not_proposable) before the file is opened. One profile at a time per import and integrations.import.profilesPerMinute per tenant (429 rate_limit.exceeded, limiter jira-profile-import or jira-profile, Retry-After; 503 service.unavailable when the counter store fails). The file is read once within integrations.import.profileTimeBudgetSeconds; when the budget is spent, 422 integration.import_profile_too_large (reason time, budgetSeconds); an answer larger than integrations.import.profileAnswerMaxBytes is 422 integration.import_profile_too_large (reason size, maxBytes) — the dry run still takes the file (XM-1080 fix rounds 1 and 2). One column for each field name, compared case-insensitively; unlistedColumns counts the later spellings.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `importId` | path | string (uuid) | yes |  |
| `fileId` | query | string (uuid) | yes | The import_source file uploaded for import(importId). |
| `source` | query | string | no | F-INT-09.R14 (XM-1387): the format the Admin chose in the Format choice. Absent: the source is detected by the upload's shape. No adapter, more than one, or a chosen format that does not recognise the upload answers 422 integration.import_file_invalid (reason source_unknown, source_ambiguous or source_mismatch, with candidates). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The profile (Cache-Control no-store). | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The whole row report as CSV (row, jira_key, column, code, reason, worklog_id, date, minutes) under the exports' CSV safety rule (XM-112, XM-1387)

`GET /imports/{importId}/report`

- Operation ID: `getJiraImportReport`
- Call with: Session of the Youniton apps (app only)
- Feature: F-INT-09

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `importId` | path | string (uuid) | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The CSV file (Content-Disposition attachment), UTF-8 with a byte-order mark, lines ended by CRLF; every cell guarded against spreadsheet formulas. Made from the import's row, so it is gone 30 days after the import ended. | text/csv | `string` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Run the import checked by the last dry run (same file and mapping), optionally fetching attachments

`POST /imports/{importId}/run`

- Operation ID: `runJiraImport`
- Call with: Session of the Youniton apps (app only)
- Feature: F-INT-09

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |
| `importId` | path | string (uuid) | yes |  |

Request body (application/json, required): `JiraImportRunInput`

| Status | Description | Content type | Type |
|---|---|---|---|
| 202 | The import is queued. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The tenant's allowed Git providers, self-managed instances, rotation default and linking switch

`GET /integrations/provider-settings`

- Operation ID: `getProviderSettings`
- Call with: Session of the Youniton apps (app only)
- Feature: F-INT-01

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The provider settings with in-use counts. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Replace the provider settings (allowed providers, instances, rotation default and lead, linking by ticket key)

`PUT /integrations/provider-settings`

- Operation ID: `putProviderSettings`
- Call with: Session of the Youniton apps (app only)
- Feature: F-INT-01

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/json, required): `ProviderSettingsInput`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | Saved (or unchanged); the new version. | application/json | `object` |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The account's person-level grants across its tenants (v1 — the calendar feeds)

`GET /me/connected-apps`

- Operation ID: `listConnectedApps`
- Call with: Session of the Youniton apps (app only)
- Feature: F-INT-08

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The grants. | application/json | `object` |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Disconnect a connected app — revokes the calendar feed at once

`DELETE /me/connected-apps/{connectedAppId}`

- Operation ID: `disconnectConnectedApp`
- Call with: Session of the Youniton apps (app only)
- Feature: F-INT-08

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `connectedAppId` | path | string (uuid) | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 204 | Disconnected (or already gone). |  |  |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The project-centric repositories table — every project, its live connections, or a "No repository" row

`GET /repository-connections`

- Operation ID: `listRepositoryConnections`
- Call with: Session of the Youniton apps (app only)
- Feature: F-INT-02

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `filter[presence]` | query | string | no |  |
| `filter[projectKey]` | query | string | no |  |
| `filter[archived]` | query | boolean | no |  |
| `q` | query | string | no |  |
| `page[number]` | query | integer | no |  |
| `page[size]` | query | integer | no |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | One page of rows with exact counts per filter. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |

## Connect the chosen repository with a consumed token check; the member becomes the connection's owner

`POST /repository-connections`

- Operation ID: `connectRepository`
- Call with: Session of the Youniton apps (app only)
- Feature: F-INT-03

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |

Request body (application/json, required): `object`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | Connected; a manual hook's URL and secret are returned once. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 502 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Verify a pasted access token with the provider and list the repositories it can read; the token is held 10 minutes

`POST /repository-connections/token-checks`

- Operation ID: `checkRepositoryToken`
- Call with: Session of the Youniton apps (app only)
- Feature: F-INT-03

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |

Request body (application/json, required): `object`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The verified token's facts and repositories; never the token. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 502 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Disconnect a repository from its project; links stay as frozen history

`DELETE /repository-connections/{connectionId}`

- Operation ID: `disconnectRepository`
- Call with: Session of the Youniton apps (app only)
- Feature: F-INT-02

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `connectionId` | path | string (uuid) | yes |  |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 204 | Disconnected (or already disconnected). |  |  |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Set a connection's own rotation period (shorter than the tenant default) or reset it to the default

`PATCH /repository-connections/{connectionId}`

- Operation ID: `changeRepositoryConnectionRotation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-INT-04

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `connectionId` | path | string (uuid) | yes |  |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/json, required): `object`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | Changed; the due date recomputed. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Designate the connection's accountable owner (Admins); resumes a connection paused for "owner needed"

`PUT /repository-connections/{connectionId}/owner`

- Operation ID: `transferRepositoryConnectionOwner`
- Call with: Session of the Youniton apps (app only)
- Feature: F-INT-04

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `connectionId` | path | string (uuid) | yes |  |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/json, required): `object`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | Transferred. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Replace a connection's access token and webhook secret together; resumes a paused or expired connection

`PUT /repository-connections/{connectionId}/token`

- Operation ID: `replaceRepositoryToken`
- Call with: Session of the Youniton apps (app only)
- Feature: F-INT-04

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `connectionId` | path | string (uuid) | yes |  |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/json, required): `object`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | Replaced; a manual hook's new secret is returned once. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 502 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
