Skip to content

Building a Provider Profile

A profile tells the integrations module everything it needs to know about an external SaaS service: authorization endpoints, API base URLs, account identification, pagination styles, rate-limit headers, and webhook signature algorithms. It is a declarative JSON specification containing zero code.

With a profile in place, an application needs only a minimal kirak.json entry:

{
"integrations": {
"providers": {
"acme": {
"profile": "acme",
"client_id": "your-client-id"
}
}
}
}

Source File Location Application Configuration
Bundled kirak/integrations/profiles/<name>.json (shipped with kirak) "profile": "<name>"
Project integrations/<name>.json (in your application root) "profile": "<name>"
Community kirak-integration-profiles repository Copy profiles/<name>/profile.json into integrations/<name>.json

  1. Every Fact from Vendor Documentation: URLs, scopes, headers, and signing recipes must come directly from official documentation. Never guess or interpolate from other vendors.
  2. Strict Regex Patterns: Every placeholder in a host or URL must have a strict regex pattern. Loose patterns allow malicious URL injection that could exfiltrate user access tokens.
  3. No Secret Values in Profiles: A profile names the secrets it needs in its secrets section and says where to get them, but never holds a value. Client secrets, private keys, API keys, and webhook secrets reside exclusively in environment variables (KIRAK_INTEGRATION_<NAME>_CLIENT_SECRET, _PRIVATE_KEY, _API_KEY, _WEBHOOK_SECRET).
  4. Honest Testing Metadata: The final line of the profile’s notes array records verification status:
    • Untested: "Written from vendor docs on YYYY-MM-DD; not yet checked against a live account."
    • Tested: "Checked against a live account on YYYY-MM-DD."

Create integrations/<name>.json in your project root:

{
"profile_version": 1,
"name": "acme",
"title": "Acme CRM",
"website": "https://www.acme.example",
"docs_url": "https://developers.acme.example/api",
"auth": {
"type": "oauth2",
"authorize_url": "https://auth.acme.example/oauth/authorize",
"token_url": "https://api.acme.example/oauth/token",
"pkce": true
},
"scopes": {
"default": ["read:contacts"],
"known": {
"read:contacts": "Read contacts and leads"
}
},
"secrets": {
"client_secret": {"label": "Client secret", "where": "Acme developer console > your app > Credentials > Client secret"}
},
"api": {
"base_url": "https://api.acme.example/v1"
},
"account": {
"from": "request",
"url": "https://api.acme.example/v1/me",
"id": "user.id",
"label": "user.email"
},
"verify": {
"method": "GET",
"path": "/me"
},
"notes": [
"Written from vendor docs on 2026-11-06; not yet checked against a live account."
]
}

The secrets section lists the secrets the app sets for the service, under Kirak’s names. Kirak knows what to do with each name, so a profile cannot invent one; it maps the vendor’s own name onto Kirak’s with label, and says where to find it with where:

Kirak name Declare it when Vendor examples (label)
client_secret token_auth is basic (the default) or body; call_with is client_secret; a revoke’s client_auth or webhooks.secret uses it Client secret, App secret (Dropbox), Consumer Secret (Salesforce)
private_key token_auth is private_key_jwt Private key (PEM) (Okta)
webhook_secret the webhooks are checked with it (not a public_key scheme, and webhooks.secret is not client_secret) Signing secret (Stripe), Secret Token (Zoom)
api_key every api_key profile Secret key (Stripe), Server API token (Postmark)
"secrets": {
"api_key": {"label": "Secret key", "where": "Stripe Dashboard > Developers > API keys > Secret key"},
"webhook_secret": {"label": "Signing secret", "where": "Stripe Dashboard > Developers > Webhooks > your endpoint > Signing secret"}
}

Validation checks the section against the rest of the profile: a secret the profile uses must be declared, and a declared one must be used (integration_profile_secrets). Whether a secret is required follows from its name: webhook_secret never is, since only an app that takes webhooks needs it, and api_key is required only for key_owner: app.

A public client, one with no secret at all, sets "token_auth": "none" and declares no client_secret; Kirak then sends only the client id on the token request, and PKCE must stay on. A profile with no secrets has "secrets": {}.

kirak env, kirak validate and kirak integrations list show the label and the where text next to a secret that is not set, so keep where a short click path in the vendor’s own words.


Kirak uses three distinct placeholder namespaces across profile URLs and headers:

flowchart TD
A["{settings.x}<br/>(Static Config in kirak.json)"] --> D["Authorize URL"]
B["{connect.x}<br/>(Ephemeral: User Input Before OAuth)"] --> D
D --> E["OAuth Token Exchange"]
E --> C["{connection.x}<br/>(Persistent: Saved on Connection Row)"]
C --> F["API Base URL / Calls"]
C --> G["Token Refresh / Revoke"]
  1. {settings.x} (Static Application Configuration):
    • Configured in kirak.json under integrations.providers.<name>.settings.<x>.
    • Used for fixed parameters like tenant IDs, regions, or data center prefixes.
  2. {connect.x} (Ephemeral Connect Parameters):
    • Supplied by the caller when initiating OAuth via POST /integrations/<name>/connect.
    • Lifecycle Boundary: {connect.x} exists only during the authorization redirect and initial token exchange. It is destroyed once the connection is established.
  3. {connection.x} (Persistent Connection Metadata):
    • Extracted from the OAuth callback query, the token exchange response, or bridged from {connect.x} via from: "connect".
    • Persisted securely in the database (integration_connections.metadata).
    • Available for all subsequent API requests, proxy calls, and token refreshes.

[!SECURITY] When a placeholder represents an entire domain or host in a token URL (https://{connection.datacenter}.example.com/oauth/token), the placeholder’s pattern regex must strictly whitelist permitted host values (e.g. "pattern": "^(us|eu|ap)$"). Open patterns fail kirak validate with integration_profile_token_host_open.


Validate profile schema conformance and placeholder security rules:

Terminal window
kirak validate

Common problem codes:

  • integration_profile_invalid: Schema structure error.
  • integration_profile_placeholder: A placeholder was used without declaring a regex pattern.
  • integration_profile_connect_after_connect: A {connect.x} placeholder was used in a post-connect URL (refresh, revoke, or API base URL) instead of bridging to {connection.x}.
  • integration_profile_host_not_allowed: A lookup or API URL does not match api.base_url or api.allowed_hosts.

Test provider credentials without an interactive OAuth flow:

Terminal window
kirak integrations check acme

Probes the provider’s token endpoint to verify that client_id and client secrets are recognized.

  1. Mount the local redirect URL in the provider console: {base_url}/integrations/acme/callback.
  2. Connect an account via POST /integrations/acme/connect.
  3. Verify connection health: POST /integrations/acme/connections/{id}/check.
  4. Test proxy requests: GET /integrations/acme/proxy?path=/me.
  5. Update testing notes in the profile JSON to confirm live verification.