agent-swarm.devagent-swarm.dev

PromptTemplates

Store and retrieve reusable prompt templates for consistent agent instructions

GET
/api/prompt-templates

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Query Parameters

eventType?string
scope?string
scopeId?string
isDefault?string
Value in"true" | "false"

Response Body

application/json

curl -X GET "http://localhost:3013/api/prompt-templates"
{
  "templates": [
    {
      "id": "string",
      "eventType": "string",
      "scope": "global",
      "scopeId": "string",
      "state": "enabled",
      "body": "string",
      "isDefault": true,
      "version": 0,
      "createdBy": "string",
      "createdAt": "string",
      "updatedAt": "string",
      "defaultDrifted": true
    }
  ]
}
PUT
/api/prompt-templates

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PUT "http://localhost:3013/api/prompt-templates" \  -H "Content-Type: application/json" \  -d '{    "eventType": "string",    "body": "string"  }'
{
  "template": {
    "id": "string",
    "eventType": "string",
    "scope": "global",
    "scopeId": "string",
    "state": "enabled",
    "body": "string",
    "isDefault": true,
    "version": 0,
    "createdBy": "string",
    "createdAt": "string",
    "updatedAt": "string",
    "defaultDrifted": true
  }
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
DELETE
/api/prompt-templates/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string

Response Body

application/json

application/json

application/json

curl -X DELETE "http://localhost:3013/api/prompt-templates/string"
{
  "deleted": true
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
GET
/api/prompt-templates/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string

Response Body

application/json

application/json

curl -X GET "http://localhost:3013/api/prompt-templates/string"
{
  "template": {
    "id": "string",
    "eventType": "string",
    "scope": "global",
    "scopeId": "string",
    "state": "enabled",
    "body": "string",
    "isDefault": true,
    "version": 0,
    "createdBy": "string",
    "createdAt": "string",
    "updatedAt": "string",
    "defaultDrifted": true
  },
  "history": [
    {
      "id": "string",
      "templateId": "string",
      "version": 0,
      "body": "string",
      "state": "string",
      "changedBy": "string",
      "changedAt": "string",
      "changeReason": "string"
    }
  ]
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
POST
/api/prompt-templates/{id}/checkout

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

version*number

Response Body

application/json

application/json

application/json

curl -X POST "http://localhost:3013/api/prompt-templates/string/checkout" \  -H "Content-Type: application/json" \  -d '{    "version": 0  }'
{
  "template": {
    "id": "string",
    "eventType": "string",
    "scope": "global",
    "scopeId": "string",
    "state": "enabled",
    "body": "string",
    "isDefault": true,
    "version": 0,
    "createdBy": "string",
    "createdAt": "string",
    "updatedAt": "string",
    "defaultDrifted": true
  }
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
POST
/api/prompt-templates/{id}/reset

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string

Response Body

application/json

application/json

curl -X POST "http://localhost:3013/api/prompt-templates/string/reset"
{
  "template": {
    "id": "string",
    "eventType": "string",
    "scope": "global",
    "scopeId": "string",
    "state": "enabled",
    "body": "string",
    "isDefault": true,
    "version": 0,
    "createdBy": "string",
    "createdAt": "string",
    "updatedAt": "string",
    "defaultDrifted": true
  }
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
GET
/api/prompt-templates/events

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Response Body

application/json

curl -X GET "http://localhost:3013/api/prompt-templates/events"
{
  "events": [
    {
      "eventType": "string",
      "header": "string",
      "defaultBody": "string",
      "variables": [
        {
          "name": "string",
          "description": "string",
          "example": "string"
        }
      ],
      "category": "event"
    }
  ]
}
POST
/api/prompt-templates/preview

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "http://localhost:3013/api/prompt-templates/preview" \  -H "Content-Type: application/json" \  -d '{    "eventType": "string"  }'
{
  "rendered": "string",
  "unresolved": [
    "string"
  ]
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
POST
/api/prompt-templates/render

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "http://localhost:3013/api/prompt-templates/render" \  -H "Content-Type: application/json" \  -d '{    "eventType": "string"  }'
{
  "text": "string",
  "templateId": "string",
  "scope": "string",
  "skipped": true,
  "unresolved": [
    "string"
  ]
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
GET
/api/prompt-templates/resolved

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Query Parameters

eventType*string
agentId?string
repoId?string

Response Body

application/json

application/json

curl -X GET "http://localhost:3013/api/prompt-templates/resolved?eventType=string"
{
  "resolution": {
    "text": "string",
    "templateId": "string",
    "scope": "string",
    "skipped": true,
    "unresolved": [
      "string"
    ]
  },
  "dbResult": {
    "template": {
      "id": "string",
      "eventType": "string",
      "scope": "global",
      "scopeId": "string",
      "state": "enabled",
      "body": "string",
      "isDefault": true,
      "version": 0,
      "createdBy": "string",
      "createdAt": "string",
      "updatedAt": "string",
      "defaultDrifted": true
    }
  },
  "definition": {
    "eventType": "string",
    "header": "string",
    "defaultBody": "string",
    "variables": [
      {
        "name": "string",
        "description": "string",
        "example": "string"
      }
    ],
    "category": "event"
  }
}
{
  "error": "string",
  "property1": null,
  "property2": null
}