{"openapi":"3.1.0","info":{"title":"Kairro Integration API","version":"1.0.0","description":"Endpoints for identity-provider provisioning (SCIM 2.0), audit log retrieval, SAML single sign-on, and service health.\n\n**Authentication.** SCIM endpoints take a provisioning token (`Authorization: Bearer kairro_…`) created under Settings → Provisioning. Admin endpoints take the session token returned at sign-in.\n\n**Rate limits.** Responses carry `RateLimit-Limit`, `RateLimit-Remaining`, and `RateLimit-Reset`. A `429` includes `Retry-After` in seconds.\n\n**Tenancy.** Every request acts only on the organization that owns the credential."},"servers":[{"url":"https://app.kairro.ai"}],"tags":[{"name":"Provisioning (SCIM)","description":"RFC 7643 / 7644 Users and Groups."},{"name":"Audit log","description":"Read and export the workspace audit trail. Requires the Admin role."},{"name":"Single sign-on","description":"SAML 2.0 service-provider endpoints."},{"name":"Service","description":"Health and metrics."}],"paths":{"/health":{"get":{"tags":["Service"],"summary":"Liveness","security":[],"responses":{"200":{"description":"The process is running.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok"}}}}}}}}},"/ready":{"get":{"tags":["Service"],"summary":"Readiness","security":[],"responses":{"200":{"description":"Dependencies are reachable.","content":{"application/json":{"schema":{"type":"object"}}}},"503":{"description":"A dependency is unavailable.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/openapi.json":{"get":{"tags":["Service"],"summary":"This document","security":[],"responses":{"200":{"description":"OpenAPI 3.1 document.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/scim/v2/ServiceProviderConfig":{"get":{"tags":["Provisioning (SCIM)"],"summary":"Supported SCIM features","security":[{"scimToken":[]}],"responses":{"200":{"description":"Service provider configuration.","content":{"application/scim+json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/ScimError"},"403":{"$ref":"#/components/responses/ScimError"}}}},"/v1/scim/v2/ResourceTypes":{"get":{"tags":["Provisioning (SCIM)"],"summary":"Resource types","security":[{"scimToken":[]}],"responses":{"200":{"description":"User and Group resource types.","content":{"application/scim+json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/ScimError"},"403":{"$ref":"#/components/responses/ScimError"}}}},"/v1/scim/v2/Schemas":{"get":{"tags":["Provisioning (SCIM)"],"summary":"Attribute schemas","security":[{"scimToken":[]}],"responses":{"200":{"description":"User and Group schemas.","content":{"application/scim+json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/ScimError"},"403":{"$ref":"#/components/responses/ScimError"}}}},"/v1/scim/v2/Users":{"get":{"tags":["Provisioning (SCIM)"],"summary":"List or find users","description":"Filter on `userName`, `externalId`, `emails.value`, or `id`.","security":[{"scimToken":[]}],"parameters":[{"name":"filter","in":"query","description":"One comparison of the form `attribute eq \"value\"`.","schema":{"type":"string"},"example":"userName eq \"ada@example.com\""},{"name":"startIndex","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"count","in":"query","schema":{"type":"integer","minimum":0,"maximum":200,"default":100}}],"responses":{"200":{"description":"Matching users.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string"}},"totalResults":{"type":"integer"},"startIndex":{"type":"integer"},"itemsPerPage":{"type":"integer"},"Resources":{"type":"array","items":{"$ref":"#/components/schemas/ScimUser"}}}}}}},"400":{"$ref":"#/components/responses/ScimError"},"401":{"$ref":"#/components/responses/ScimError"},"403":{"$ref":"#/components/responses/ScimError"}}},"post":{"tags":["Provisioning (SCIM)"],"summary":"Create a user","description":"Creates a console account with the Viewer role unless `roles` names ANALYST or ADMIN. The Owner role is never assigned.","security":[{"scimToken":[]}],"requestBody":{"required":true,"content":{"application/scim+json":{"schema":{"$ref":"#/components/schemas/ScimUser"}},"application/json":{"schema":{"$ref":"#/components/schemas/ScimUser"}}}},"responses":{"201":{"description":"The created user.","content":{"application/scim+json":{"schema":{"$ref":"#/components/schemas/ScimUser"}}}},"400":{"$ref":"#/components/responses/ScimError"},"401":{"$ref":"#/components/responses/ScimError"},"403":{"$ref":"#/components/responses/ScimError"},"409":{"$ref":"#/components/responses/ScimError"}}}},"/v1/scim/v2/Users/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Provisioning (SCIM)"],"summary":"Get a user","security":[{"scimToken":[]}],"responses":{"200":{"description":"The user.","content":{"application/scim+json":{"schema":{"$ref":"#/components/schemas/ScimUser"}}}},"401":{"$ref":"#/components/responses/ScimError"},"403":{"$ref":"#/components/responses/ScimError"},"404":{"$ref":"#/components/responses/ScimError"}}},"put":{"tags":["Provisioning (SCIM)"],"summary":"Replace a user","security":[{"scimToken":[]}],"requestBody":{"required":true,"content":{"application/scim+json":{"schema":{"$ref":"#/components/schemas/ScimUser"}},"application/json":{"schema":{"$ref":"#/components/schemas/ScimUser"}}}},"responses":{"200":{"description":"The updated user.","content":{"application/scim+json":{"schema":{"$ref":"#/components/schemas/ScimUser"}}}},"400":{"$ref":"#/components/responses/ScimError"},"401":{"$ref":"#/components/responses/ScimError"},"403":{"$ref":"#/components/responses/ScimError"},"404":{"$ref":"#/components/responses/ScimError"},"409":{"$ref":"#/components/responses/ScimError"}}},"patch":{"tags":["Provisioning (SCIM)"],"summary":"Update a user","description":"Setting `active` to false disables the account and ends its sessions. The last active Owner cannot be deactivated.","security":[{"scimToken":[]}],"requestBody":{"required":true,"content":{"application/scim+json":{"schema":{"$ref":"#/components/schemas/ScimPatch"}},"application/json":{"schema":{"$ref":"#/components/schemas/ScimPatch"}}}},"responses":{"200":{"description":"The updated user.","content":{"application/scim+json":{"schema":{"$ref":"#/components/schemas/ScimUser"}}}},"400":{"$ref":"#/components/responses/ScimError"},"401":{"$ref":"#/components/responses/ScimError"},"403":{"$ref":"#/components/responses/ScimError"},"404":{"$ref":"#/components/responses/ScimError"},"409":{"$ref":"#/components/responses/ScimError"}}},"delete":{"tags":["Provisioning (SCIM)"],"summary":"Deprovision a user","description":"Disables the account and retains its history.","security":[{"scimToken":[]}],"responses":{"204":{"description":"Deprovisioned."},"401":{"$ref":"#/components/responses/ScimError"},"403":{"$ref":"#/components/responses/ScimError"},"404":{"$ref":"#/components/responses/ScimError"},"409":{"$ref":"#/components/responses/ScimError"}}}},"/v1/scim/v2/Groups":{"get":{"tags":["Provisioning (SCIM)"],"summary":"List or find groups","description":"Groups map to teams. Filter on `displayName`, `externalId`, or `id`.","security":[{"scimToken":[]}],"parameters":[{"name":"filter","in":"query","description":"One comparison of the form `attribute eq \"value\"`.","schema":{"type":"string"},"example":"userName eq \"ada@example.com\""},{"name":"startIndex","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"count","in":"query","schema":{"type":"integer","minimum":0,"maximum":200,"default":100}}],"responses":{"200":{"description":"Matching groups.","content":{"application/scim+json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string"}},"totalResults":{"type":"integer"},"startIndex":{"type":"integer"},"itemsPerPage":{"type":"integer"},"Resources":{"type":"array","items":{"$ref":"#/components/schemas/ScimGroup"}}}}}}},"400":{"$ref":"#/components/responses/ScimError"},"401":{"$ref":"#/components/responses/ScimError"},"403":{"$ref":"#/components/responses/ScimError"}}},"post":{"tags":["Provisioning (SCIM)"],"summary":"Create a group","security":[{"scimToken":[]}],"requestBody":{"required":true,"content":{"application/scim+json":{"schema":{"$ref":"#/components/schemas/ScimGroup"}},"application/json":{"schema":{"$ref":"#/components/schemas/ScimGroup"}}}},"responses":{"201":{"description":"The created group.","content":{"application/scim+json":{"schema":{"$ref":"#/components/schemas/ScimGroup"}}}},"400":{"$ref":"#/components/responses/ScimError"},"401":{"$ref":"#/components/responses/ScimError"},"403":{"$ref":"#/components/responses/ScimError"},"409":{"$ref":"#/components/responses/ScimError"}}}},"/v1/scim/v2/Groups/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Provisioning (SCIM)"],"summary":"Get a group","security":[{"scimToken":[]}],"responses":{"200":{"description":"The group.","content":{"application/scim+json":{"schema":{"$ref":"#/components/schemas/ScimGroup"}}}},"401":{"$ref":"#/components/responses/ScimError"},"403":{"$ref":"#/components/responses/ScimError"},"404":{"$ref":"#/components/responses/ScimError"}}},"put":{"tags":["Provisioning (SCIM)"],"summary":"Replace a group and its members","security":[{"scimToken":[]}],"requestBody":{"required":true,"content":{"application/scim+json":{"schema":{"$ref":"#/components/schemas/ScimGroup"}},"application/json":{"schema":{"$ref":"#/components/schemas/ScimGroup"}}}},"responses":{"200":{"description":"The updated group.","content":{"application/scim+json":{"schema":{"$ref":"#/components/schemas/ScimGroup"}}}},"400":{"$ref":"#/components/responses/ScimError"},"401":{"$ref":"#/components/responses/ScimError"},"403":{"$ref":"#/components/responses/ScimError"},"404":{"$ref":"#/components/responses/ScimError"},"409":{"$ref":"#/components/responses/ScimError"}}},"patch":{"tags":["Provisioning (SCIM)"],"summary":"Rename a group or change its members","security":[{"scimToken":[]}],"requestBody":{"required":true,"content":{"application/scim+json":{"schema":{"$ref":"#/components/schemas/ScimPatch"}},"application/json":{"schema":{"$ref":"#/components/schemas/ScimPatch"}}}},"responses":{"200":{"description":"The updated group.","content":{"application/scim+json":{"schema":{"$ref":"#/components/schemas/ScimGroup"}}}},"400":{"$ref":"#/components/responses/ScimError"},"401":{"$ref":"#/components/responses/ScimError"},"403":{"$ref":"#/components/responses/ScimError"},"404":{"$ref":"#/components/responses/ScimError"},"409":{"$ref":"#/components/responses/ScimError"}}},"delete":{"tags":["Provisioning (SCIM)"],"summary":"Delete a group","description":"Built-in governance teams and teams referenced by policies cannot be deleted.","security":[{"scimToken":[]}],"responses":{"204":{"description":"Deleted."},"401":{"$ref":"#/components/responses/ScimError"},"403":{"$ref":"#/components/responses/ScimError"},"404":{"$ref":"#/components/responses/ScimError"},"409":{"$ref":"#/components/responses/ScimError"}}}},"/v1/admin/audit-logs":{"get":{"tags":["Audit log"],"summary":"List audit entries","security":[{"session":[]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"from","in":"query","description":"Earliest entry time (ISO 8601).","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"Latest entry time (ISO 8601).","schema":{"type":"string","format":"date-time"}},{"name":"eventType","in":"query","description":"Exact event code, for example `POLICY_UPDATED`.","schema":{"type":"string"}},{"name":"entityType","in":"query","description":"Exact target type, for example `User`.","schema":{"type":"string"}},{"name":"actor","in":"query","description":"Matches actor name, email, or API key name.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Matches event code, target type, target ID, or IP address.","schema":{"type":"string"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["asc","desc"],"default":"desc"}}],"responses":{"200":{"description":"A page of entries, newest first by default.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AuditEntry"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"},"eventTypes":{"type":"array","items":{"type":"string"}},"entityTypes":{"type":"array","items":{"type":"string"}}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"429":{"$ref":"#/components/responses/E429"}}}},"/v1/admin/audit-logs/export":{"get":{"tags":["Audit log"],"summary":"Export audit entries as CSV","description":"Returns up to 10,000 rows. `X-Export-Truncated: true` means more rows matched; narrow the date range. The export is itself recorded in the audit log. Requires a plan with audit exports.","security":[{"session":[]}],"parameters":[{"name":"from","in":"query","description":"Earliest entry time (ISO 8601).","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"Latest entry time (ISO 8601).","schema":{"type":"string","format":"date-time"}},{"name":"eventType","in":"query","description":"Exact event code, for example `POLICY_UPDATED`.","schema":{"type":"string"}},{"name":"entityType","in":"query","description":"Exact target type, for example `User`.","schema":{"type":"string"}},{"name":"actor","in":"query","description":"Matches actor name, email, or API key name.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Matches event code, target type, target ID, or IP address.","schema":{"type":"string"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["asc","desc"],"default":"desc"}}],"responses":{"200":{"description":"CSV file (UTF-8 with BOM).","headers":{"X-Export-Row-Count":{"schema":{"type":"integer"}},"X-Export-Truncated":{"schema":{"type":"string","enum":["true","false"]}}},"content":{"text/csv":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"429":{"$ref":"#/components/responses/E429"}}}},"/v1/admin/scim":{"get":{"tags":["Provisioning (SCIM)"],"summary":"Provisioning status and tokens","security":[{"session":[]}],"responses":{"200":{"description":"Base URL, token list (never the token values), and sync activity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisioningStatus"}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"}}}},"/v1/admin/scim/tokens":{"post":{"tags":["Provisioning (SCIM)"],"summary":"Create a provisioning token","description":"The token value is returned once. Requires a sign-in within the last 10 minutes.","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":160},"expiresInDays":{"type":"integer","minimum":1,"maximum":730,"default":365}}}}}},"responses":{"201":{"description":"The new token.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"lastFour":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"token":{"type":"string","description":"Shown once."}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"}}}},"/v1/admin/scim/tokens/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["Provisioning (SCIM)"],"summary":"Revoke a provisioning token","security":[{"session":[]}],"responses":{"204":{"description":"Revoked."},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"}}}},"/v1/admin/org/display-preferences":{"get":{"tags":["Service"],"summary":"Workspace display preferences","security":[{"session":[]}],"responses":{"200":{"description":"The workspace time zone used for timestamps.","content":{"application/json":{"schema":{"type":"object","properties":{"timezone":{"type":"string","example":"UTC"}}}}}},"401":{"$ref":"#/components/responses/E401"}}}},"/v1/auth/sso/saml/metadata/{connectionId}":{"parameters":[{"name":"connectionId","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Single sign-on"],"summary":"Service-provider metadata","security":[],"responses":{"200":{"description":"SAML metadata XML with the entity ID and ACS URL.","content":{"application/samlmetadata+xml":{"schema":{"type":"string"}}}},"404":{"description":"No SAML connection with this ID."}}}},"/v1/auth/sso/saml/acs/{connectionId}":{"parameters":[{"name":"connectionId","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["Single sign-on"],"summary":"Assertion consumer service","description":"The identity provider posts the signed response here from the user's browser. Only responses to a sign-in started at Kairro are accepted; IdP-initiated sign-in is not supported.","security":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["SAMLResponse","RelayState"],"properties":{"SAMLResponse":{"type":"string"},"RelayState":{"type":"string"}}}}}},"responses":{"303":{"description":"Redirects to the app's sign-in page with a one-time code, or with an error flag if the response was rejected."}}}}},"components":{"securitySchemes":{"scimToken":{"type":"http","scheme":"bearer","description":"Provisioning token from Settings → Provisioning."},"session":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Session token returned at sign-in."}},"responses":{"E400":{"description":"The request is malformed or a parameter is out of range.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E401":{"description":"Missing or expired credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E403":{"description":"The credential's role or plan does not allow this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E404":{"description":"Not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E429":{"description":"Rate limit exceeded.","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ScimError":{"description":"SCIM error (RFC 7644 §3.12).","content":{"application/scim+json":{"schema":{"$ref":"#/components/schemas/ScimError"}}}}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}},"ScimError":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"string"}},"status":{"type":"string"},"scimType":{"type":"string"},"detail":{"type":"string"}}},"ScimUser":{"type":"object","required":["userName"],"properties":{"schemas":{"type":"array","items":{"type":"string"}},"id":{"type":"string","readOnly":true},"externalId":{"type":"string"},"userName":{"type":"string","format":"email","description":"The user's email address; unique within the workspace."},"name":{"type":"object","properties":{"formatted":{"type":"string"},"givenName":{"type":"string"},"familyName":{"type":"string"}}},"displayName":{"type":"string"},"emails":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","format":"email"},"primary":{"type":"boolean"},"type":{"type":"string"}}}},"active":{"type":"boolean","default":true},"roles":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","enum":["VIEWER","ANALYST","ADMIN"]},"primary":{"type":"boolean"}}}},"meta":{"type":"object","readOnly":true}}},"ScimGroup":{"type":"object","required":["displayName"],"properties":{"schemas":{"type":"array","items":{"type":"string"}},"id":{"type":"string","readOnly":true},"externalId":{"type":"string"},"displayName":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","description":"A SCIM user id."},"display":{"type":"string","readOnly":true}}}},"meta":{"type":"object","readOnly":true}}},"ScimPatch":{"type":"object","required":["Operations"],"properties":{"schemas":{"type":"array","items":{"type":"string"}},"Operations":{"type":"array","minItems":1,"items":{"type":"object","required":["op"],"properties":{"op":{"type":"string","enum":["add","replace","remove"]},"path":{"type":"string"},"value":{}}}}}},"AuditEntry":{"type":"object","properties":{"id":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"eventType":{"type":"string","example":"SECURITY_SETTINGS_UPDATED"},"entityType":{"type":"string","example":"Organization"},"entityId":{"type":["string","null"]},"actorType":{"type":"string","enum":["USER","API_KEY","SYSTEM","KAIRRO_OPERATIONS"]},"actor":{"type":["object","null"],"properties":{"id":{"type":["string","null"]},"name":{"type":["string","null"]},"email":{"type":["string","null"]}}},"apiKey":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"lastFour":{"type":"string"}}},"ipAddress":{"type":["string","null"]},"userAgent":{"type":["string","null"]},"metadata":{"description":"Event-specific details. Field names of changed settings, never their values."}}},"ProvisioningStatus":{"type":"object","properties":{"entitled":{"type":"boolean"},"baseUrl":{"type":"string"},"provisionedUserCount":{"type":"integer"},"lastActivityAt":{"type":["string","null"],"format":"date-time"},"lastActivityType":{"type":["string","null"]},"tokens":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"lastFour":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"revokedAt":{"type":["string","null"],"format":"date-time"},"createdBy":{"type":["string","null"]},"status":{"type":"string","enum":["ACTIVE","EXPIRED","REVOKED"]}}}}}}}}}