Create a Contact Profile - Cognigy Documentation

Documentation Index

Fetch the complete documentation index at: /llms.txt

Use this file to discover all available pages before exploring further.

Create a Contact Profile

POST /v2.0/profiles

cURL

curl --request POST \
  --url https://api-trial.cognigy.ai/new/v2.0/profiles \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "profile": {
    "prevent_data_collection": true,
    "accepted_gdpr": true,
    "privacy_policy": {},
    "tasks": [
      "buyer"
    ],
    "memories": [
      {
        "id": "123456",
        "timestamp": "2024-09-23T08:37:00Z",
        "text": "This is a memory."
      }
    ],
    "firstname": "Max",
    "lastname": "Mustermann",
    "email": "jsmith@example.com",
    "profilepic": ""
  },
  "active": true,
  "contactIds": [
    "mail@example.com"
  ],
  "projectId": "<string>"
}
'

Sample Python Code

import requests

url = "https://api-trial.cognigy.ai/new/v2.0/profiles"

payload = {
    "profile": {
        "prevent_data_collection": True,
        "accepted_gdpr": True,
        "privacy_policy": {},
        "tasks": ["buyer"],
        "memories": [
            {
                "id": "123456",
                "timestamp": "2024-09-23T08:37:00Z",
                "text": "This is a memory."
            }
        ],
        "firstname": "Max",
        "lastname": "Mustermann",
        "email": "jsmith@example.com",
        "profilepic": ""
    },
    "active": True,
    "contactIds": ["mail@example.com"],
    "projectId": "<string>"
}

headers = {
    "X-API-Key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)

Response Structure

{
  "profile": {
    "prevent_data_collection": true,
    "accepted_gdpr": true,
    "privacy_policy": {},
    "tasks": ["buyer"],
    "memories": [
      {
        "id": "123456",
        "timestamp": "2024-09-23T08:37:00Z",
        "text": "This is a memory."
      }
    ],
    "firstname": "Max",
    "lastname": "Mustermann",
    "email": "jsmith@example.com",
    "profilepic": ""
  },
  "active": true,
  "contactIds": ["mail@example.com"],
  "_id": "<string>",
  "createdAt": 1694518620,
  "lastChanged": 1694518620,
  "createdBy": "<string>",
  "lastChangedBy": "<string>"
}

Error Response Example

{
  "type": "Bad Request",
  "title": "Bad Request Error",
  "status": 400,
  "detail": "Validation failed. Missing payload.",
  "instance": "/v2.0/flows/5ce7c2d833ea1e04d7e6c432",
  "code": 1000,
  "traceId": "api--f84324f4-98eb-4f02-abdd-375a2e6c3c1f",
  "details": {}
}

Authorizations