# PromptLayer

> Browse prompt templates, workflows, tables and evaluations, or run a PromptLayer workflow.

App · 13 actions. Web page: https://docs.lodol.com/docs/integrations/promptlayer

## Actions

### Get logged request

Get logged request in the connected PromptLayer workspace.

**Inputs**

- Request ID (`request_id`, number, required): The ID of the request to retrieve. At least 1.

**Outputs**

- `data` (object): The response from PromptLayer.

**Example output**

```json
{
  "data": {
    "input_tokens": 1,
    "latency_ms": 1,
    "model": "example",
    "output_tokens": 1,
    "price": 1,
    "prompt_blueprint": {},
    "provider": "example",
    "request_end_time": "example",
    "request_id": 1,
    "request_start_time": "example",
    "success": true,
    "tokens": 1,
    "trace_id": "example"
  }
}
```

### Get raw prompt template

Get raw prompt template in the connected PromptLayer workspace.

**Inputs**

- Identifier (`identifier`, text, required): Identifier.
- Version (`version`, number): Version.
- Label (`label`, text): Label.
- Resolve snippets (`resolve_snippets`, true/false): Resolve snippets.
- Include llm kwargs (`include_llm_kwargs`, true/false): Include llm kwargs.

**Outputs**

- `data` (object): The response from PromptLayer.

**Example output**

```json
{
  "data": {
    "commit_message": "example",
    "created_at": "example",
    "id": 1,
    "llm_kwargs": {},
    "metadata": {
      "model": {
        "api_type": "example",
        "base_model": "example",
        "display_params": {},
        "model_config_display_name": "example",
        "name": "example",
        "parameters": {},
        "provider": "example"
      }
    },
    "prompt_name": "example",
    "prompt_template": {
      "content": [
        {
          "annotations": {},
          "id": {},
          "text": {},
          "thought_signature": {},
          "type": {}
        }
      ],
      "input_variables": [
        "example"
      ],
      "template_format": "f-string",
      "type": "completion"
    },
    "snippets": [
      {
        "label": "example",
        "prompt_name": "example",
        "version": 1
      }
    ],
    "success": true,
    "tags": [
      "example"
    ],
    "version": 1,
    "workspace_id": 1
  }
}
```

### Get table

Get table in the connected PromptLayer workspace.

**Inputs**

- Table (`table_id`, text, required): Table ID.

**Outputs**

- `data` (object): The response from PromptLayer.

**Example output**

```json
{
  "data": {
    "success": true,
    "table": {
      "sheet_row_counts": {}
    }
  }
}
```

### Get workflow

Get workflow in the connected PromptLayer workspace.

**Inputs**

- Workflow ID or name (`workflow_id_or_name`, text, required): The agent ID or name.
- Version (`version`, number): Specific version number to retrieve. Mutually exclusive with `label`.
- Label (`label`, text): Release label name to retrieve (e.g. 'prod', 'staging'). Mutually exclusive with `version`.

**Outputs**

- `data` (object): The response from PromptLayer.

**Example output**

```json
{
  "data": {
    "commit_message": "example",
    "created_at": "example",
    "edges": [
      {
        "conditionals": [
          {}
        ],
        "id": "example",
        "is_and": true,
        "source_node_name": "example",
        "target_node_name": "example"
      }
    ],
    "nodes": [
      {
        "configuration": {},
        "dependencies": [
          {}
        ],
        "id": "example",
        "is_output_node": true,
        "name": "example",
        "node_type": "example",
        "workflow_version_id": 1
      }
    ],
    "release_labels": [
      "example"
    ],
    "required_input_variables": {},
    "success": true,
    "version": 1,
    "workflow_id": 1,
    "workflow_name": "example",
    "workflow_version_id": 1
  }
}
```

### List evaluations

List evaluations in the connected PromptLayer workspace.

**Inputs**

- Workspace ID (`workspace_id`, number): Filter by specific workspace ID. If not provided, uses the current user's workspace. At least 1.
- Name (`name`, text): Filter evaluations by name (case-insensitive partial match)
- Status (`status`, text): Filter evaluations by status: 'active' (default) returns only active evaluations, 'deleted' returns only deleted/archived evaluations, 'all' returns both. One of: `active`, `deleted`, `all`.
- Include runs (`include_runs`, true/false): If true, include batch runs nested under each evaluation. Each run includes its full report data, status (RUNNING or COMPLETED), and cell status counts.
- Page (`page`, number): Page number for pagination. At least 1.
- Per page (`per_page`, number): Number of items per page. From 1 to 100.
- Created by email (`created_by_email`, text): Filter by the creator's email address.
- Created after (`created_after`, date and time): Filter resources created at or after this timestamp.
- Created before (`created_before`, date and time): Filter resources created at or before this timestamp.
- Updated after (`updated_after`, date and time): Filter resources updated at or after this timestamp.
- Updated before (`updated_before`, date and time): Filter resources updated at or before this timestamp.
- External source (`external_source`, text): External ID source to filter by. Must be provided with external_id.
- External ID (`external_id`, text): External ID value to filter by. Must be provided with external_source.
- Sort by (`sort_by`, text): Sort field. One of: `created_at` (Created at), `updated_at` (Updated at), `name`, `id`.
- Sort order (`sort_order`, text): Sort direction. One of: `asc`, `desc`.

**Outputs**

- `data` (object): The response from PromptLayer.

**Example output**

```json
{
  "data": {
    "evaluations": [
      {
        "comment": "example",
        "created_at": "example",
        "dataset_id": 1,
        "deleted": true,
        "external_ids": [
          {}
        ],
        "folder_id": 1,
        "id": 1,
        "is_blueprint": true,
        "name": "example",
        "parent_report_id": 1,
        "runs": [
          {}
        ],
        "score_configuration": {},
        "tags": {},
        "updated_at": "example",
        "user_id": 1,
        "workspace_id": 1
      }
    ],
    "message": "example",
    "page": 1,
    "pages": 1,
    "per_page": 1,
    "success": true,
    "total": 1
  }
}
```

### List prompt template labels

List prompt template labels in the connected PromptLayer workspace.

**Inputs**

- Identifier (`identifier`, text, required): Identifier.

**Outputs**

- `data` (object): The response from PromptLayer.

**Example output**

```json
{
  "data": {
    "release_labels": [
      {
        "prompt_version_id": 1,
        "prompt_version_number": 1,
        "release_label": "example",
        "release_label_id": 1
      }
    ]
  }
}
```

### List prompt templates

List prompt templates in the connected PromptLayer workspace.

**Inputs**

- Page (`page`, number): Page.
- Per page (`per_page`, number): Per page.
- Label (`label`, text): Filter prompt templates by release label (e.g., 'prod', 'dev', 'staging')
- Name (`name`, text): Filter prompt templates by name (case-insensitive partial match)
- Tags (`tags`, text): Filter prompt templates by tags. Can be a single tag or a list of tags. Only templates whose tags contain all specified values are returned.
- Status (`status`, text): Filter prompt templates by status: 'active' (default) returns only active templates, 'deleted' returns only deleted/archived templates, 'all' returns both. One of: `active`, `deleted`, `all`.
- External source (`external_source`, text): External ID source to filter by. Must be provided with external_id.
- External ID (`external_id`, text): External ID value to filter by. Must be provided with external_source.
- Created by email (`created_by_email`, text): Filter by the creator's email address.
- Created after (`created_after`, date and time): Filter resources created at or after this timestamp.
- Created before (`created_before`, date and time): Filter resources created at or before this timestamp.
- Updated after (`updated_after`, date and time): Filter resources updated at or after this timestamp.
- Updated before (`updated_before`, date and time): Filter resources updated at or before this timestamp.
- Sort by (`sort_by`, text): Sort field. One of: `created_at` (Created at), `updated_at` (Updated at), `name`, `id`.
- Sort order (`sort_order`, text): Sort direction. One of: `asc`, `desc`.
- Is snippet (`is_snippet`, true/false): When true, return snippets only. When false, exclude snippets. When omitted, return both prompts and snippets.

**Outputs**

- `data` (object): The response from PromptLayer.

**Example output**

```json
{
  "data": {
    "has_next": true,
    "has_prev": true,
    "items": [
      {
        "commit_message": "example",
        "external_ids": [
          {}
        ],
        "id": 1,
        "is_snippet": true,
        "llm_kwargs": {},
        "metadata": {
          "model": {}
        },
        "prompt_name": "example",
        "prompt_template": {
          "content": {},
          "input_variables": {},
          "template_format": {},
          "type": {}
        },
        "version": 1
      }
    ],
    "next_num": 1,
    "page": 1,
    "pages": 1,
    "prev_num": 1,
    "total": 1
  }
}
```

### List table sheets

List table sheets in the connected PromptLayer workspace.

**Inputs**

- Table (`table_id`, text, required): Table ID.
- Cursor (`cursor`, text): Cursor.
- Limit (`limit`, number): Limit. From 1 to 100.
- Order (`order`, text): Order. One of: `asc`, `desc`.
- Prompt ID (`prompt_id`, number): Prompt ID.
- Prompt version ID (`prompt_version_id`, number): Prompt version ID.
- Prompt label ID (`prompt_label_id`, number): Prompt label ID.

**Outputs**

- `data` (object): The response from PromptLayer.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_at": "example",
        "id": "example",
        "index": 1,
        "row_count": 1,
        "table_id": "example",
        "title": "example",
        "updated_at": "example",
        "version_count": 1,
        "workspace_id": 1
      }
    ],
    "has_more": true,
    "next_cursor": "example"
  }
}
```

### List tables

List tables in the connected PromptLayer workspace.

**Inputs**

- Folder ID (`folder_id`, number): Folder ID.
- Name (`name`, text): Name.
- Cursor (`cursor`, text): Cursor.
- Limit (`limit`, number): Limit. From 1 to 100.
- Order (`order`, text): Order. One of: `asc`, `desc`.
- Prompt ID (`prompt_id`, number): Prompt ID.
- Prompt version ID (`prompt_version_id`, number): Prompt version ID.
- Prompt label ID (`prompt_label_id`, number): Prompt label ID.

**Outputs**

- `data` (object): The response from PromptLayer.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_at": "example",
        "folder_id": 1,
        "id": "example",
        "sheet_count": 1,
        "title": "example",
        "updated_at": "example",
        "workspace_id": 1
      }
    ],
    "has_more": true,
    "next_cursor": "example"
  }
}
```

### List workflow labels

List workflow labels in the connected PromptLayer workspace.

**Inputs**

- Workflow ID or name (`workflow_id_or_name`, text, required): The agent ID or name.

**Outputs**

- `data` (object): The response from PromptLayer.

**Example output**

```json
{
  "data": {
    "release_labels": [
      {
        "release_label": "example",
        "release_label_id": 1,
        "workflow_version_id": 1,
        "workflow_version_number": 1
      }
    ],
    "success": true
  }
}
```

### List workflows

List workflows in the connected PromptLayer workspace.

**Inputs**

- Page (`page`, number): Page number for pagination. At least 1.
- Per page (`per_page`, number): Number of items per page. From 1 to 100.
- Created by email (`created_by_email`, text): Filter by the creator's email address.
- Created after (`created_after`, date and time): Filter resources created at or after this timestamp.
- Created before (`created_before`, date and time): Filter resources created at or before this timestamp.
- Updated after (`updated_after`, date and time): Filter resources updated at or after this timestamp.
- Updated before (`updated_before`, date and time): Filter resources updated at or before this timestamp.
- External source (`external_source`, text): External ID source to filter by. Must be provided with external_id.
- External ID (`external_id`, text): External ID value to filter by. Must be provided with external_source.
- Sort by (`sort_by`, text): Sort field. One of: `created_at` (Created at), `updated_at` (Updated at), `name`, `id`.
- Sort order (`sort_order`, text): Sort direction. One of: `asc`, `desc`.

**Outputs**

- `data` (object): The response from PromptLayer.

**Example output**

```json
{
  "data": {
    "has_next": true,
    "has_prev": true,
    "items": [
      {
        "external_ids": [
          {}
        ],
        "id": 1,
        "is_deleted": true,
        "latest_version_number": 1,
        "name": "example",
        "release_labels": [
          {}
        ],
        "user_id": 1,
        "workspace_id": 1
      }
    ],
    "next_num": 1,
    "page": 1,
    "pages": 1,
    "per_page": 1,
    "prev_num": 1,
    "total": 1
  }
}
```

### Render prompt template

Render a prompt template with the variables you supply.

**Inputs**

- Identifier (`identifier`, text, required): Identifier.
- Version (`version`, number): Version. At least 1.
- Label (`label`, text): Label.
- Input variables (`input_variables`, object): Input variables.

**Outputs**

- `data` (object): The response from PromptLayer.

**Example output**

```json
{
  "data": {
    "commit_message": "example",
    "id": 1,
    "llm_kwargs": {},
    "metadata": {
      "model": {
        "api_type": "example",
        "base_model": "example",
        "display_params": {},
        "model_config_display_name": "example",
        "name": "example",
        "parameters": {},
        "provider": "example"
      }
    },
    "prompt_name": "example",
    "prompt_template": {
      "content": [
        {
          "annotations": {},
          "id": {},
          "text": {},
          "thought_signature": {},
          "type": {}
        }
      ],
      "input_variables": [
        "example"
      ],
      "template_format": "f-string",
      "type": "completion"
    },
    "version": 1
  }
}
```

### Run workflow

Start a PromptLayer workflow with its input variables.

**Inputs**

- Workflow name (`workflow_name`, text, required): Workflow name.
- Input variables (`input_variables`, object): Input variables.
- Workflow label name (`workflow_label_name`, text): Workflow label name.
- Workflow version number (`workflow_version_number`, number): Workflow version number. At least 1.

**Outputs**

- `data` (object): The response from PromptLayer.

**Example output**

```json
{
  "data": {
    "message": "example",
    "success": true,
    "warning": "example",
    "workflow_version_execution_id": 1
  }
}
```
