> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mem0.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate Profiles

> Start one generation: sample a few entities, or build one for a single entity.



## OpenAPI

````yaml post /v2/profiles/jobs/
openapi: 3.0.1
info:
  title: Mem0 API Docs
  description: mem0.ai API Docs
  contact:
    email: support@mem0.ai
  license:
    name: Apache 2.0
  version: v1
servers:
  - url: https://api.mem0.ai/
security:
  - ApiKeyAuth: []
paths:
  /v2/profiles/jobs/:
    post:
      tags:
        - profiles
      summary: Generate profiles
      description: >-
        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.
      operationId: profiles_create_job
      parameters:
        - in: header
          name: Idempotency-Key
          required: true
          schema:
            type: string
            minLength: 8
            maxLength: 128
          description: 'Makes a retry safe: the same key returns the same job.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - operation
                - entity_type
              properties:
                operation:
                  type: string
                  enum:
                    - sample
                    - trigger
                  description: >-
                    What to generate. Optional only when `entity_id` is set,
                    which means `trigger`.
                entity_type:
                  type: string
                  enum:
                    - user
                entity_id:
                  type: string
                  description: One entity, for `trigger`.
                limit:
                  type: integer
                  minimum: 1
                  maximum: 10
                  description: How many entities to sample.
      responses:
        '202':
          description: Job accepted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  job_id:
                    type: string
                  status:
                    type: string
                  status_url:
                    type: string
                    description: >-
                      Poll this. Building the path yourself breaks on a route
                      change.
                  operation:
                    type: string
                  entity_type:
                    type: string
                  entity_count_reserved:
                    type: integer
                    description: Entities reserved against usage for this job.
                  event_id:
                    type: string
                    nullable: true
                  replayed:
                    type: boolean
                    description: True when an Idempotency-Key returned an existing job.
                  sampled:
                    type: integer
                    description: '`sample` only.'
                  entity_ids:
                    type: array
                    items:
                      type: string
                    description: >-
                      `sample` only: the entity ids picked. Read each with `GET
                      /v2/entities/user/{entity_id}/profile/`.
        '400':
          description: Unknown or missing `operation`, or profiles are not configured.
        '402':
          description: Payment required.
        '409':
          description: >-
            A job is already running, or the Idempotency-Key was used for a
            different request. Branch on `error.code`.
        '429':
          description: Cooldown. `retry_after_seconds` sits inside `error`.
        '503':
          description: '`jobs_unavailable` — generation is switched off for this project.'
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Prefix your Mem0 API key with 'Token '. Example:
        'Token your_api_key'

````