curl --request POST --fail-with-body --max-time 30 \
"${AMLOK_API_BASE_URL}/v1/embedding-sessions" \
--header "Authorization: Bearer ${AMLOK_API_KEY}" \
--header 'Accept: application/json' \
--header 'Idempotency-Key: createEmbeddingSession-synthetic-0042' \
--header 'Content-Type: application/json' \
--data '{"borrower_id":"bor_synthetic","embedding_version_id":"embed_synthetic","purpose":"connect","return_url":"https://institution.example.com/connected","consent_purposes":["credit_assessment","continuous_monitoring"],"embed_origin":"https://institution.example.com"}'import os
import requests
headers = {'Accept': 'application/json', 'Idempotency-Key': 'createEmbeddingSession-synthetic-0042', 'Content-Type': 'application/json'}
headers["Authorization"] = "Bearer " + os.environ["AMLOK_API_KEY"]
response = requests.request('POST', os.environ["AMLOK_API_BASE_URL"] + '/v1/embedding-sessions', headers=headers, json={'borrower_id': 'bor_synthetic', 'embedding_version_id': 'embed_synthetic', 'purpose': 'connect', 'return_url': 'https://institution.example.com/connected', 'consent_purposes': ['credit_assessment', 'continuous_monitoring'], 'embed_origin': 'https://institution.example.com'}, timeout=30, allow_redirects=False)
response.raise_for_status()
print(response.json())
const headers = {"Accept": "application/json", "Idempotency-Key": "createEmbeddingSession-synthetic-0042", "Content-Type": "application/json"};
headers.Authorization = `Bearer ${process.env.AMLOK_API_KEY}`;
const response = await fetch(process.env.AMLOK_API_BASE_URL + "/v1/embedding-sessions", {
method: "POST", headers, redirect: "error", signal: AbortSignal.timeout(30000),
body: JSON.stringify({"borrower_id": "bor_synthetic", "embedding_version_id": "embed_synthetic", "purpose": "connect", "return_url": "https://institution.example.com/connected", "consent_purposes": ["credit_assessment", "continuous_monitoring"], "embed_origin": "https://institution.example.com"})
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
console.log(await response.json());
{
"data": {
"id": "embs_synthetic",
"borrower_id": "bor_synthetic",
"status": "created",
"launch_url": "https://borrower.example.com/session/synthetic",
"expires_at": "2026-11-06T12:15:00Z",
"connection_ids": [],
"consent_ids": [],
"record_version": 1,
"embedding_version_id": "embed_synthetic",
"purpose": "connect",
"origination_id": null,
"monitor_id": null,
"requirement_id": null,
"consent_purposes": [
"credit_assessment",
"continuous_monitoring"
],
"embed_origin": "https://institution.example.com",
"return_url": "https://institution.example.com/connected",
"failure": null
},
"meta": {
"request_id": "req_synthetic",
"schema_version": "1.0.0",
"environment": "sandbox"
}
}{
"error": {
"code": "validation_error",
"message": "Validation error.",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "unauthenticated",
"message": "Unauthenticated.",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "insufficient_credits",
"message": "Insufficient credits.",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "forbidden",
"message": "Forbidden.",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "not_found",
"message": "Not found.",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "idempotency_conflict",
"message": "Idempotency conflict.",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "cursor_expired",
"message": "Cursor expired.",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "payload_too_large",
"message": "payload too large",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "unsupported_media_type",
"message": "unsupported media type",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "validation_error",
"message": "Validation error.",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limited.",
"retryable": true,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "temporarily_unavailable",
"message": "Temporarily unavailable.",
"retryable": true,
"request_id": "req_synthetic",
"field": null
}
}Create embedding session
Create a short-lived Integrations Hub session. Send only launch_url to the borrower. AMLOK captures consent and manages provider authorization and ingestion.
curl --request POST --fail-with-body --max-time 30 \
"${AMLOK_API_BASE_URL}/v1/embedding-sessions" \
--header "Authorization: Bearer ${AMLOK_API_KEY}" \
--header 'Accept: application/json' \
--header 'Idempotency-Key: createEmbeddingSession-synthetic-0042' \
--header 'Content-Type: application/json' \
--data '{"borrower_id":"bor_synthetic","embedding_version_id":"embed_synthetic","purpose":"connect","return_url":"https://institution.example.com/connected","consent_purposes":["credit_assessment","continuous_monitoring"],"embed_origin":"https://institution.example.com"}'import os
import requests
headers = {'Accept': 'application/json', 'Idempotency-Key': 'createEmbeddingSession-synthetic-0042', 'Content-Type': 'application/json'}
headers["Authorization"] = "Bearer " + os.environ["AMLOK_API_KEY"]
response = requests.request('POST', os.environ["AMLOK_API_BASE_URL"] + '/v1/embedding-sessions', headers=headers, json={'borrower_id': 'bor_synthetic', 'embedding_version_id': 'embed_synthetic', 'purpose': 'connect', 'return_url': 'https://institution.example.com/connected', 'consent_purposes': ['credit_assessment', 'continuous_monitoring'], 'embed_origin': 'https://institution.example.com'}, timeout=30, allow_redirects=False)
response.raise_for_status()
print(response.json())
const headers = {"Accept": "application/json", "Idempotency-Key": "createEmbeddingSession-synthetic-0042", "Content-Type": "application/json"};
headers.Authorization = `Bearer ${process.env.AMLOK_API_KEY}`;
const response = await fetch(process.env.AMLOK_API_BASE_URL + "/v1/embedding-sessions", {
method: "POST", headers, redirect: "error", signal: AbortSignal.timeout(30000),
body: JSON.stringify({"borrower_id": "bor_synthetic", "embedding_version_id": "embed_synthetic", "purpose": "connect", "return_url": "https://institution.example.com/connected", "consent_purposes": ["credit_assessment", "continuous_monitoring"], "embed_origin": "https://institution.example.com"})
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
console.log(await response.json());
{
"data": {
"id": "embs_synthetic",
"borrower_id": "bor_synthetic",
"status": "created",
"launch_url": "https://borrower.example.com/session/synthetic",
"expires_at": "2026-11-06T12:15:00Z",
"connection_ids": [],
"consent_ids": [],
"record_version": 1,
"embedding_version_id": "embed_synthetic",
"purpose": "connect",
"origination_id": null,
"monitor_id": null,
"requirement_id": null,
"consent_purposes": [
"credit_assessment",
"continuous_monitoring"
],
"embed_origin": "https://institution.example.com",
"return_url": "https://institution.example.com/connected",
"failure": null
},
"meta": {
"request_id": "req_synthetic",
"schema_version": "1.0.0",
"environment": "sandbox"
}
}{
"error": {
"code": "validation_error",
"message": "Validation error.",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "unauthenticated",
"message": "Unauthenticated.",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "insufficient_credits",
"message": "Insufficient credits.",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "forbidden",
"message": "Forbidden.",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "not_found",
"message": "Not found.",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "idempotency_conflict",
"message": "Idempotency conflict.",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "cursor_expired",
"message": "Cursor expired.",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "payload_too_large",
"message": "payload too large",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "unsupported_media_type",
"message": "unsupported media type",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "validation_error",
"message": "Validation error.",
"retryable": false,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limited.",
"retryable": true,
"request_id": "req_synthetic",
"field": null
}
}{
"error": {
"code": "temporarily_unavailable",
"message": "Temporarily unavailable.",
"retryable": true,
"request_id": "req_synthetic",
"field": null
}
}Authorizations
Server-to-server API key bound to exactly one workspace, institution tenant and environment. No caller-supplied workspace override is accepted. Do not use in public browser code.
Headers
Stable for one intended command and its retries, scoped to key workspace/environment and operation. Mismatched body returns 409. Full response replay 24 hours; durable receipt remains.
1Body
Launch an already published console-configured Hub for this borrower. Enabled integrations and categories come from embedding_version_id and cannot be overridden here. The backend verifies its own borrower association before creating a session; only the short-lived launch URL reaches the browser.
Opaque identifier, authorized within the API key workspace and environment.
1Opaque identifier, authorized within the API key workspace and environment.
1Purpose for CreateEmbeddingSession. Constraints, requiredness and allowed values are defined by this schema.
connect, reauthorize Must match an institution-approved return URL. No arbitrary redirects.
1Explicit purposes presented for borrower authorization; must be a subset of the published Hub purposes. Credit assessment alone does not permit monitoring.
1credit_assessment, continuous_monitoring Opaque identifier, authorized within the API key workspace and environment.
1Opaque identifier, authorized within the API key workspace and environment.
1Exact HTTPS parent origin approved for this Hub. Omit for full-page redirects. No path, wildcard or opaque origin.
1Monitor whose open requirement this session addresses. Mutually exclusive with origination_id.
1Open requirement on origination_id or monitor_id; completion atomically associates the authorized connection with that resource.
1