---
title: "Generate profiles"
method: POST
path: "/v2/profiles/jobs/"
tags: ["profiles"]
---

# Generate profiles

`POST /v2/profiles/jobs/`

## Request

- Base URL: `https://api.mem0.ai`
- URL: `https://api.mem0.ai/v2/profiles/jobs/`
- Auth: API key in header `Authorization`

Start one generation. `operation` says what to build:

- `sample` — up to 10 real entities, so a schema can be judged before it is used widely. These are real profiles: they are saved to those entities and count toward usage.
- `trigger` — one entity, named by `entity_id`.

Send an `Idempotency-Key` header. Replaying the same key returns the same job instead of charging twice. Poll `status_url` from the response until the status is terminal.

## Headers

- `Idempotency-Key` string, required

## Request body

- object
  - `operation` 'sample' | 'trigger', required: What to generate. Optional only when `entity_id` is set, which means `trigger`.
  - `entity_type` 'user', required
  - `entity_id` string: One entity, for `trigger`.
  - `limit` integer: How many entities to sample.

## Response `202`

Job accepted.

- object
  - `job_id` string
  - `status` string
  - `status_url` string: Poll this. Building the path yourself breaks on a route change.
  - `operation` string
  - `entity_type` string
  - `entity_count_reserved` integer: Entities reserved against usage for this job.
  - `event_id` string, nullable
  - `replayed` boolean: True when an Idempotency-Key returned an existing job.
  - `sampled` integer: `sample` only.
  - `entity_ids` string[]: `sample` only: the entity ids picked. Read each with `GET /v2/entities/user/{entity_id}/profile/`.

## Other responses

- `400`: Unknown or missing `operation`, or profiles are not configured.
- `402`: Payment required.
- `409`: A job is already running, or the Idempotency-Key was used for a different request. Branch on `error.code`.
- `429`: Cooldown. `retry_after_seconds` sits inside `error`.
- `503`: `jobs_unavailable` — generation is switched off for this project.

## Changes

- **2026-09-23** `e03088efda24`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/mem0/apis/mem0-api-docs/changes/v2/profiles/jobs/post.md)

---

[API](https://skmtc.dev/mem0/apis/mem0-api-docs.md) - [All operations](https://skmtc.dev/mem0/apis/mem0-api-docs/llms.txt) - [OpenAPI document](https://skmtc.dev/mem0/apis/mem0-api-docs/revisions/e03088efda24?raw)
