# Enrichment API

Source: https://frameleaf.app/docs/api/reference/enrichment/

Use your own server and its scoped API keys.

## Get a video moment frame

GET /api/enrichment/frames/{id}

The image of one reusable video frame, under the same access as its video.

```json
{
  "description": "The image of one reusable video frame, under the same access as its video.",
  "operationId": "getVideoMomentFrame",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/octet-stream": {
          "schema": {
            "format": "binary",
            "type": "string"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Get a video moment frame",
  "tags": [
    "Enrichment"
  ],
  "x-frameleaf-permission": "asset.read"
}
```

## Find moments like a video frame

GET /api/enrichment/frames/{id}/similar

Finds the moments nearest one frame's stored search embedding across your videos, including other times in the same video, never the frame itself. Nothing is sent to a model and nothing is written.

```json
{
  "description": "Finds the moments nearest one frame's stored search embedding across your videos, including other times in the same video, never the frame itself. Nothing is sent to a model and nothing is written.",
  "operationId": "searchSimilarVideoMoments",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    },
    {
      "name": "limit",
      "required": false,
      "in": "query",
      "description": "Most moments to return",
      "schema": {
        "minimum": 1,
        "maximum": 100,
        "default": 24,
        "type": "integer"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/VideoMomentSearchResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Find moments like a video frame",
  "tags": [
    "Enrichment"
  ],
  "x-frameleaf-permission": "asset.read"
}
```

## Search video moments

POST /api/enrichment/moments/search

Finds timestamped moments inside your videos by meaning, against the frame index, and by words in captions and typed transcripts.

```json
{
  "description": "Finds timestamped moments inside your videos by meaning, against the frame index, and by words in captions and typed transcripts.",
  "operationId": "searchVideoMoments",
  "parameters": [],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/VideoMomentSearchDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/VideoMomentSearchResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Search video moments",
  "tags": [
    "Enrichment"
  ],
  "x-frameleaf-permission": "asset.read"
}
```

## Choose a video cover frame

PUT /api/enrichment/videos/{id}/cover

Keeps the chosen frame as a time in the video, so it survives the frames being cut again. Null returns to the best-ranked frame.

```json
{
  "description": "Keeps the chosen frame as a time in the video, so it survives the frames being cut again. Null returns to the best-ranked frame.",
  "operationId": "setVideoMomentCover",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/VideoMomentCoverDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/VideoMomentsResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Choose a video cover frame",
  "tags": [
    "Enrichment"
  ],
  "x-frameleaf-permission": "asset.update"
}
```

## Get video moments

GET /api/enrichment/videos/{id}/moments

The reusable frames of a video ranked best first, its cover, its generated and manual moments, and what they were made from, with any that are out of date marked.

```json
{
  "description": "The reusable frames of a video ranked best first, its cover, its generated and manual moments, and what they were made from, with any that are out of date marked.",
  "operationId": "getVideoMoments",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/VideoMomentsResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Get video moments",
  "tags": [
    "Enrichment"
  ],
  "x-frameleaf-permission": "asset.read"
}
```

## Add a video moment

POST /api/enrichment/videos/{id}/moments

Adds your own moment, with an optional title and typed transcript. Refreshing never removes it.

```json
{
  "description": "Adds your own moment, with an optional title and typed transcript. Refreshing never removes it.",
  "operationId": "createVideoMoment",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/VideoMomentCreateDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/VideoMomentDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Add a video moment",
  "tags": [
    "Enrichment"
  ],
  "x-frameleaf-permission": "asset.update"
}
```

## Delete a video moment

DELETE /api/enrichment/videos/{id}/moments/{momentId}

Removes one of your own moments. Generated moments are refreshed, not deleted.

```json
{
  "description": "Removes one of your own moments. Generated moments are refreshed, not deleted.",
  "operationId": "deleteVideoMoment",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "description": "Asset ID",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    },
    {
      "name": "momentId",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    }
  ],
  "responses": {
    "204": {
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Delete a video moment",
  "tags": [
    "Enrichment"
  ],
  "x-frameleaf-permission": "asset.update"
}
```

## Update a video moment

PUT /api/enrichment/videos/{id}/moments/{momentId}

Edits one of your own moments. Generated moments are refreshed, not edited.

```json
{
  "description": "Edits one of your own moments. Generated moments are refreshed, not edited.",
  "operationId": "updateVideoMoment",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "description": "Asset ID",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    },
    {
      "name": "momentId",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/VideoMomentUpdateDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/VideoMomentDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Update a video moment",
  "tags": [
    "Enrichment"
  ],
  "x-frameleaf-permission": "asset.update"
}
```
