Skip to main content

Uniphore Help Center Portal

Create Fact-Organization Mapping API

This API allows to customize System Facts as per each organization needs across different tenants. Using this API, you can modify the Query and Values (choices). It is recommended to add the Query and Values in the respective language of the Fact response. In addition to English, Spanish is supported.

Endpoint

Method: POST

URL: https://<api-base-url>/uzng-conversation-facts-backend/cf/v2/fact-org-mapping/<fact-id>

curl -X POST "https://<api-base-url>/uzng-conversation-facts-backend/cf/v2/fact-org-mapping/<fact-id>" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "organizationIds": [
      "org-id-1",
      "org-id-2"
    ],
    "query": "fact-query",
    "choices": [
      "choice 1",
      "choice 2"
    ],
    "allowOther": true
  }'
Header Parameter
Authorization - Bearer <Token>

Note

To obtain an authorization token, click here.

Sample Request Parameter
{
    "organizationIds": [
      "org-id-1",
      "org-id-2"
    ],
    "query": "fact-query",
    "choices": [
      "choice 1",
      "choice 2"
    ],
    "allowOther": true
  }
Path Parameter

Parameter Name

Data type

Description

Required/ Optional

factId

String

The ID of the System Fact.

Required

Request Parameter

Parameter Name

Data type

Description

Required/ Optional

orgIds

String

The List of Organization IDs for which the System Facts needs to be customized.

Required

query

Text

The Query to be modified for the given Organization IDs and Fact ID.

Required

choices

String

The Choices (values) to be modified for the given Organization IDs.

Applicable only for List facts.

Optional

allowOther

Boolean

If set to True, LLM predicted choices can be added for the given Organization IDs.

If set to False, the LLM predicted choices are ignored.

Applicable only for List facts.

Optional

Sample Response
{
  "success": true,
  "result": [
    {
      "id": "64a1b2c3d4e5f6g7h8i9j0k1",
      "factId": "fact_123",
      "tenantId": "tenant_xyz",
      "orgIds": ["org1"],
      "factName": "Customer Satisfaction",
      "query": "Custom query for this organization",
      "responseType": "CATEGORICAL",
      "choices": ["Option 1", "Option 2", "Option 3"],
      "allowOther": true,
      "defaultValue": "Option 1",
      "status": "APPROVED",
      "version": 1,
      "createdBy": "user@example.com",
      "createdDate": 1702834567890,
      "updatedDate": 1702834567890
    },
    {
      "id": "64a1b2c3d4e5f6g7h8i9j0k2",
      "factId": "fact_123",
      "tenantId": "tenant_xyz",
      "orgIds": ["org2"],
      "factName": "Customer Satisfaction",
      "query": "Custom query for this organization",
      "responseType": "CATEGORICAL",
      "choices": ["Option 1", "Option 2", "Option 3"],
      "allowOther": true,
      "defaultValue": "Option 1",
      "status": "APPROVED",
      "version": 1,
      "createdBy": "user@example.com",
      "createdDate": 1702834567890,
      "updatedDate": 1702834567890
    }
  ]
}
Response and Error Codes

Code

Condition

Description

200

OK

Fact org mappings fetched successfully.

400

Bad request

The values provided in the request parameters are invalid.

401

Unauthorized

A valid bearer token is required for authorization, or the token doesn’t have the required permission.

404

Not Found

Provided fact ID not found.

500

Internal Server Error

An unexpected issue occurred on the server side. Retry after some time.