Our Python SDK got smarter. We developed a Typscript SDK too. We are updating our SDK code blocks. Python SDKhere.Typscript SDKhere.
Description

List Prompt Revisions

List prompt revisions with optional filtering.

Returns prompt revisions matching the criteria. If project_name is provided, it resolves to project_id. If no filters are provided, returns all prompt revisions for the account.

GET
/v1/prompt-revisions
/v1/prompt-revisions

The Authorization access token

Authorization

X-API-KEY<token>

In: header

Query Parameters

project_idProject Id

Filter by project ID

project_nameProject Name

Filter by project name

prompt_idPrompt Id

Filter by prompt definition ID

prompt_namePrompt Name

Filter by prompt definition name

prompt_name_startswithPrompt Name Startswith

Filter by prompt definition name prefix

revision_idRevision Id

Filter by specific revision ID

revisionRevision

Filter by revision number

latest_revision_onlyLatest Revision Only

Only return the latest revision for each prompt

Default: false

labelLabel

Filter by revisions that have this label

normalized_body_sha256Normalized Body Sha256

Filter by SHA-256 hash prefix of prompt body with whitespace stripped from start and end

limitLimit

Maximum number of records to return

Default: 1000

offsetOffset

Number of records to skip

Default: 0
curl -X GET "https://api.patronus.ai/v1/prompt-revisions?project_id=497f6eca-6276-4993-bfeb-53cbbbba6f08&project_name=string&prompt_id=497f6eca-6276-4993-bfeb-53cbbbba6f08&prompt_name=string&prompt_name_startswith=string&revision_id=497f6eca-6276-4993-bfeb-53cbbbba6f08&revision=0&latest_revision_only=false&label=string&normalized_body_sha256=string&limit=1000&offset=0" \
  -H "X-API-KEY: <token>"

Successful Response

{
  "prompt_revisions": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "prompt_definition_id": "03a177e8-e6c3-4579-9b5a-f1a28527d534",
      "prompt_definition_name": "string",
      "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",
      "project_name": "string",
      "revision": 0,
      "body": "string",
      "normalized_body_sha256": "string",
      "metadata": {},
      "labels": [
        "string"
      ],
      "created_at": "2019-08-24T14:15:22Z"
    }
  ]
}