Library Workflow Prompts

The list representation omits definition and contexts. Retrieve a specific prompt to include those fields. Contexts are created, updated, and deleted through the Library Workflow Prompt Contexts nested resource.

Get All Library Workflow Prompts

This endpoint retrieves a list of Library Workflow Prompt resources.

GET /api/v2/library/workflow-prompts/

Query Parameters

The following parameters may be used to filter the Library Workflow Prompt resources in the response.

Parameter Description
active Filter Library Workflow Prompts based on whether they are active or not. Valid values: true, false.
active__in Returns all Library Workflow Prompts which are either active or inactive.
ordering Sort Library Workflow Prompts by the specified field. Prefix field name with minus to sort descending. Sortable fields: id, name, command, active.
search Filter Library Workflow Prompts by performing a textual search on its id, name, command or description.
type__in Returns all Library Workflow Prompts which are either Built-in or Custom.

The active filter reflects whether a Library Workflow Prompt is enabled for the requesting organization. A Built-in Library Workflow Prompt that the organization has disabled is returned by active=false, and is excluded from active=true.


GET /api/v2/library/workflow-prompts/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json

{
    "results": [
        {
            "id": "WP1",
            "db_id": 1,
            "name": "Prompt name",
            "command": "prompt_command",
            "description": "This is a really long description",
            "type": "Built-in",
            "active": true,
            "created_date": "2026-09-03T13:27:51.332224-04:00",
            "created_by": {
                "id": 1,
                "email": "admin@example.com",
                "first_name": "Admin",
                "last_name": "Testerton"
            },
            "last_updated_date": "2026-09-03T13:28:09.779723-04:00",
            "last_updated_by": {
                "id": 4,
                "email": "no-reply+content_admin@localhost",
                "first_name": "SD",
                "last_name": "Elements"
            }
        }
    ]
}

Get a specific Library Workflow Prompt

This endpoint retrieves a single Library Workflow Prompt resource.

GET /api/v2/library/workflow-prompts/{prompt_id}/

URL Parameters

Parameter Description
prompt_id The ID of the Library Workflow Prompt to retrieve.
GET /api/v2/library/workflow-prompts/WP1/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": "WP1",
    "db_id": 1,
    "name": "Prompt name",
    "command": "prompt_command",
    "description": "This is a really long description",
    "type": "Built-in",
    "active": true,
    "created_date": "2026-09-03T13:27:51.332224-04:00",
    "created_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton"
    },
    "last_updated_date": "2026-09-03T13:28:09.779723-04:00",
    "last_updated_by": {
        "id": 4,
        "email": "no-reply+content_admin@localhost",
        "first_name": "SD",
        "last_name": "Elements"
    },
    "definition": "Execute this prompt with the following instructions: ...",
    "contexts": [
        {
            "id": "WPC1",
            "db_id": 1,
            "label": "Database conventions"
        },
        {
            "id": "WPC2",
            "db_id": 2,
            "label": "Code review standards"
        }
    ]
}

Create a Library Workflow Prompt

This endpoint creates a new custom Library Workflow Prompt.

POST /api/v2/library/workflow-prompts/

Payload

Fields Required Description
name Yes The name of the Library Workflow Prompt. Maximum length: 140 characters.
command No A snake_case identifier for the Library Workflow Prompt (lowercase letters and digits separated by single underscores). Maximum length: 100 characters. Defaults to an empty string.
description Yes A short description of the Library Workflow Prompt. Maximum length: 1024 characters.
definition Yes The prompt definition. Maximum size: 512 KB as UTF-8 encoded bytes.
active No The active status of the Library Workflow Prompt. If no value is provided the new prompt will be active.
POST /api/v2/library/workflow-prompts/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"

{
    "name": "Threat Model Review",
    "command": "threat_model_review",
    "description": "Walks a reviewer through a threat model.",
    "definition": "You are reviewing a threat model.",
    "active": true
}
HTTP/1.1 201 CREATED
Content-Type: application/json

{
    "id": "CWP1",
    "db_id": -1,
    "name": "Threat Model Review",
    "command": "threat_model_review",
    "description": "Walks a reviewer through a threat model.",
    "type": "Custom",
    "active": true,
    "created_date": "2026-09-11T12:14:24.508697-04:00",
    "created_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton"
    },
    "last_updated_date": "2026-09-11T12:14:24.508769-04:00",
    "last_updated_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton"
    },
    "definition": "You are reviewing a threat model.",
    "contexts": []
}

Update a Library Workflow Prompt

This endpoint updates a specific Library Workflow Prompt resource.

Built-in prompts may only have their active field changed. Updating any other field on a built-in prompt returns HTTP 400. Custom prompts may update any of the writable fields below.

PATCH /api/v2/library/workflow-prompts/{prompt_id}/

URL Parameters

Parameter Description
prompt_id The id of the Library Workflow Prompt to update.

Payload

Fields Required Description
name No The name of the Library Workflow Prompt. Maximum length: 140 characters.
command No A snake_case identifier for the Library Workflow Prompt (lowercase letters and digits separated by single underscores). Maximum length: 100 characters.
description No A short description of the Library Workflow Prompt. Maximum length: 1024 characters.
definition No The prompt definition. Maximum size: 512 KB as UTF-8 encoded bytes.
active No Built-in Library Workflow Prompts can be activated or deactivated.
PATCH /api/v2/library/workflow-prompts/CWP1/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"

{
    "name": "Updated Threat Model Review",
    "description": "Updated description for the review workflow.",
    "definition": "You are reviewing an updated threat model.",
    "active": false
}
HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": "CWP1",
    "db_id": -1,
    "name": "Updated Threat Model Review",
    "command": "threat_model_review",
    "description": "Updated description for the review workflow.",
    "type": "Custom",
    "active": false,
    "created_date": "2026-09-11T12:14:24.508697-04:00",
    "created_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton"
    },
    "last_updated_date": "2026-09-11T12:14:28.867506-04:00",
    "last_updated_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton"
    },
    "definition": "You are reviewing an updated threat model.",
    "contexts": []
}

Delete a Library Workflow Prompt

This endpoint deletes a specific Library Workflow Prompt resource. Deleting a prompt also deletes its contexts.

Only custom Library Workflow Prompts can be deleted.

DELETE /api/v2/library/workflow-prompts/{prompt_id}/

URL Parameters

Parameter Description
prompt_id The id of the Library Workflow Prompt to delete.
DELETE /api/v2/library/workflow-prompts/CWP1/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 204 NO CONTENT
Content-Type: application/json

{}

results matching ""

    No results matching ""