Skip to content

GET /v1/prompts/:promptId/versions

Summary

This endpoint returns a list of published versions for a given prompt. It always returns the most recent versions first and is limited to 10 entries. Each entry contains the version's identifier, publication timestamp and a flag indicating whether it is the latest.

HTTP Request

http
GET /v1/prompts/:promptId/versions

Path parameters

ParameterTypeRequiredDescription
promptIdstringYesIdentifier for the published prompt.

Response

Success (200 OK)

When the prompt exists, the server returns a JSON object whose status is "SUCCESS" and a data field containing the prompt metadata.

FieldTypeDescription
promptIdstringIdentifier of the prompt.
titlestringTitle of the prompt.
versionsarray of versionsUp to 10 published versions.
versions[].promptVersionIdstringIdentifier of a prompt version.
versions[].publishedAtstring (ISO 8601)Timestamp published.
versions[].isLatesttrue | undefinedPresent and true for latest.

Example response

json
{
  "status": "SUCCESS",
  "data": {
    "promptId": "01234567-89ab-cdef-0123-456789abcdef",
    "title": "Image caption generator",
    "versions": [
      {
        "promptVersionId": "aaaa1111-bbbb-cccc-dddd-eeee1111ffff",
        "publishedAt": "2025-08-27T12:34:56.789Z",
        "isLatest": true
      },
      {
        "promptVersionId": "99998888-7777-6666-5555-444433332222",
        "publishedAt": "2025-07-15T08:20:10.123Z"
      }
    ]
  }
}

Error responses

HTTP statusstatus codeDescription
422VALIDATION_ERRORInvalid UUID.
404NOT_FOUND_ERRORPrompt not found or no versions exist.

See also