RAZIEL.docs
API Explorer

Prompts

Shared prompt library

List prompt library items

Returns own prompts plus public prompts in the same org, ordered by usage count descending.

GET
/api/prompts
AuthorizationBearer <token>

Clerk session token. Automatically set as a cookie in the browser; pass as Authorization: Bearer for server-side calls.

In: header

Query Parameters

q?string

Full-text search across title and content

tag?string

Filter by tag

Response Body

curl -X GET "https://app.raziel.fun/api/prompts?q=string&tag=string"
{
  "prompts": [
    {
      "id": "string",
      "userId": "string",
      "orgSlug": "string",
      "title": "Write unit tests",
      "content": "Write comprehensive unit tests for the selected file using Vitest.",
      "tags": [
        "testing"
      ],
      "agent": "string",
      "isPublic": true,
      "useCount": 0,
      "createdAt": "2019-08-24T14:15:22Z",
      "updatedAt": "2019-08-24T14:15:22Z"
    }
  ],
  "currentUserId": "string"
}
{
  "error": "Unauthorized"
}

Create a prompt library item

POST
/api/prompts
AuthorizationBearer <token>

Clerk session token. Automatically set as a cookie in the browser; pass as Authorization: Bearer for server-side calls.

In: header

titlestring
contentstring
tags?array<string>
agent?string
isPublic?boolean
Defaultfalse

Response Body

curl -X POST "https://app.raziel.fun/api/prompts" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Write unit tests",
    "content": "Write comprehensive unit tests for the selected file using Vitest."
  }'
{
  "prompt": {
    "id": "string",
    "userId": "string",
    "orgSlug": "string",
    "title": "Write unit tests",
    "content": "Write comprehensive unit tests for the selected file using Vitest.",
    "tags": [
      "testing"
    ],
    "agent": "string",
    "isPublic": true,
    "useCount": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}
{
  "error": "Not found"
}
{
  "error": "Unauthorized"
}

Get a prompt

GET
/api/prompts/{id}
AuthorizationBearer <token>

Clerk session token. Automatically set as a cookie in the browser; pass as Authorization: Bearer for server-side calls.

In: header

Path Parameters

idstring

Response Body

curl -X GET "https://app.raziel.fun/api/prompts/string"
{
  "prompt": {
    "id": "string",
    "userId": "string",
    "orgSlug": "string",
    "title": "Write unit tests",
    "content": "Write comprehensive unit tests for the selected file using Vitest.",
    "tags": [
      "testing"
    ],
    "agent": "string",
    "isPublic": true,
    "useCount": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}
{
  "error": "Unauthorized"
}
{
  "error": "Not found"
}

Update a prompt

PATCH
/api/prompts/{id}
AuthorizationBearer <token>

Clerk session token. Automatically set as a cookie in the browser; pass as Authorization: Bearer for server-side calls.

In: header

Path Parameters

idstring
title?string
content?string
tags?array<string>
agent?string
isPublic?boolean

Response Body

curl -X PATCH "https://app.raziel.fun/api/prompts/string" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "prompt": {
    "id": "string",
    "userId": "string",
    "orgSlug": "string",
    "title": "Write unit tests",
    "content": "Write comprehensive unit tests for the selected file using Vitest.",
    "tags": [
      "testing"
    ],
    "agent": "string",
    "isPublic": true,
    "useCount": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}
{
  "error": "Unauthorized"
}
{
  "error": "Not found"
}

Delete a prompt

DELETE
/api/prompts/{id}
AuthorizationBearer <token>

Clerk session token. Automatically set as a cookie in the browser; pass as Authorization: Bearer for server-side calls.

In: header

Path Parameters

idstring

Response Body

curl -X DELETE "https://app.raziel.fun/api/prompts/string"
{
  "ok": true
}
{
  "error": "Unauthorized"
}
{
  "error": "Not found"
}

Record prompt usage

Increments the useCount counter for tracking frequently-used prompts.

POST
/api/prompts/{id}/use
AuthorizationBearer <token>

Clerk session token. Automatically set as a cookie in the browser; pass as Authorization: Bearer for server-side calls.

In: header

Path Parameters

idstring

Response Body

curl -X POST "https://app.raziel.fun/api/prompts/string/use"
{
  "ok": true
}
{
  "error": "Unauthorized"
}
{
  "error": "Not found"
}