---
title: "Create fact definition"
method: POST
path: "/context/1/facts"
tags: ["customer-engagement", "context", "facts"]
---

# Create fact definition

`POST /context/1/facts`

## Request

- Base URL: `https://api.infobip.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.infobip.com/context/1/facts`
- Auth: one of:
  - OAuth 2
    - Client credentials
    - Token URL: `https://api.infobip.com/auth/1/oauth2/token`
  - API key in header `Authorization`
  - API key in header `Authorization`
  - HTTP basic

Creates a fact definition for the calling account. The fact name must be unique within the account; the request is rejected if a fact with the same name already exists.

## Request body

- 284df221d4ea79ba964b452422482b56ed35030dc947e42a2c1842f66361972cCreateFactApiRequest: Request to create a fact definition.
  - `name` string, required: Fact name. Must be unique within the account.
  - `description` string, required: Human-readable description of the fact.
  - `valueType` 'STRING' | 'NUMBER' | 'BOOLEAN' | 'DATE', required: Supported value types for a fact definition.

## Response `201`

Created - the newly created fact definition

- 284df221d4ea79ba964b452422482b56ed35030dc947e42a2c1842f66361972cFactApiResponse: A single fact definition.
  - `id` string, uuid, required: Surrogate identifier of this fact definition.
  - `name` string, required: Fact name, unique within the account.
  - `description` string, required: Human-readable description of the fact.
  - `valueType` 'STRING' | 'NUMBER' | 'BOOLEAN' | 'DATE', required: Supported value types for a fact definition.
  - `createdAt` string, date-time, required: Timestamp (UTC, ISO-8601) when the fact definition was created.
  - `updatedAt` string, date-time, required: Timestamp (UTC, ISO-8601) when the fact definition was last updated.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `409`: Conflict - a fact with one of the requested names already exists (or a name is repeated within the request)
- `429`: Too Many Requests
- `500`: Internal Server Error

---

[API](https://skmtc.dev/infobip/apis/infobip-openapi-specification.md) - [All operations](https://skmtc.dev/infobip/apis/infobip-openapi-specification/llms.txt) - [OpenAPI document](https://skmtc.dev/infobip/apis/infobip-openapi-specification/revisions/9dcbbaf902de?raw)
