Bluejay Prompts API

The Prompts API from Bluejay — 6 operation(s) for prompts.

OpenAPI Specification

bluejay-prompts-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Bluejay Agents Prompts API
  description: Bluejay API
  version: 0.1.0
servers:
- url: https://api.getbluejay.ai
  description: Production server
security:
- apiKeyAuth: []
tags:
- name: Prompts
paths:
  /v1/agents/{agent_id}/prompts:
    get:
      tags:
      - Prompts
      summary: Get Prompt By Label Agent Scoped
      description: 'retrieve a single prompt by label under /agents/{agent_id}/prompts?label=... .


        - if label is missing -> 400

        - if label resolves to 0 -> 404; >1 -> 400 ambiguous (except latest which should be unique)'
      operationId: get_prompt_by_label_agent_scoped_v1_agents__agent_id__prompts_get
      security:
      - HTTPBearer: []
      parameters:
      - name: agent_id
        in: path
        required: true
        schema:
          type: integer
          title: Agent Id
      - name: label
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Label
      - name: X-API-Key
        in: header
        required: true
        schema:
          type: string
        description: API key required to authenticate requests.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/agents/{agent_id}/prompts/versions:
    post:
      tags:
      - Prompts
      summary: Create Prompt Version Agent Scoped
      description: create a new prompt version under /agents/{agent_id}/prompts/versions.
      operationId: create_prompt_version_agent_scoped_v1_agents__agent_id__prompts_versions_post
      security:
      - HTTPBearer: []
      parameters:
      - name: agent_id
        in: path
        required: true
        schema:
          type: integer
          title: Agent Id
      - name: X-API-Key
        in: header
        required: true
        schema:
          type: string
        description: API key required to authenticate requests.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePromptVersionBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Prompts
      summary: List Prompt Versions
      description: list prompt versions with optional filters (label, version).
      operationId: list_prompt_versions_v1_agents__agent_id__prompts_versions_get
      security:
      - HTTPBearer: []
      parameters:
      - name: agent_id
        in: path
        required: true
        schema:
          type: integer
          title: Agent Id
      - name: label
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Label
      - name: version
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
          - type: 'null'
          title: Version
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 50
          title: Limit
      - name: X-API-Key
        in: header
        required: true
        schema:
          type: string
        description: API key required to authenticate requests.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PromptResponse'
                title: Response List Prompt Versions V1 Agents  Agent Id  Prompts Versions Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Prompts
      summary: Delete Prompt Version By Label Agent Scoped
      description: 'delete a prompt version by label.


        - if label is production -> 400 (must move production first)

        - if label resolves to 0 -> 404; >1 -> 400 ambiguous (except latest which should be unique)

        - if deleting latest, reassign latest to highest remaining version

        - cannot delete if it is the only version'
      operationId: delete_prompt_version_by_label_agent_scoped_v1_agents__agent_id__prompts_versions_delete
      security:
      - HTTPBearer: []
      parameters:
      - name: agent_id
        in: path
        required: true
        schema:
          type: integer
          title: Agent Id
      - name: label
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Label
      - name: X-API-Key
        in: header
        required: true
        schema:
          type: string
        description: API key required to authenticate requests.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/agents/{agent_id}/prompts/promote:
    post:
      tags:
      - Prompts
      summary: Promote Production Label Agent Scoped
      description: Move the production label to the latest prompt version, or to the version identified by prompt_id.
      operationId: promote_production_label_agent_scoped_v1_agents__agent_id__prompts_promote_post
      security:
      - HTTPBearer: []
      parameters:
      - name: agent_id
        in: path
        required: true
        schema:
          type: integer
          title: Agent Id
      - name: prompt_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          description: If set, attach the production label to this prompt version; otherwise attach to the latest version.
          title: Prompt Id
        description: If set, attach the production label to this prompt version; otherwise attach to the latest version.
      - name: X-API-Key
        in: header
        required: true
        schema:
          type: string
        description: API key required to authenticate requests.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/agents/{agent_id}/prompts/versions/{version}:
    get:
      tags:
      - Prompts
      summary: Get Prompt Version Agent Scoped
      operationId: get_prompt_version_agent_scoped_v1_agents__agent_id__prompts_versions__version__get
      security:
      - HTTPBearer: []
      parameters:
      - name: agent_id
        in: path
        required: true
        schema:
          type: integer
          title: Agent Id
      - name: version
        in: path
        required: true
        schema:
          type: integer
          title: Version
      - name: X-API-Key
        in: header
        required: true
        schema:
          type: string
        description: API key required to authenticate requests.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Prompts
      summary: Delete Prompt Version Agent Scoped
      description: 'delete a specific prompt version; cannot delete production; cannot delete only version.


        if deleting latest, reassign latest to highest remaining version.

        returns metadata about the deletion.'
      operationId: delete_prompt_version_agent_scoped_v1_agents__agent_id__prompts_versions__version__delete
      security:
      - HTTPBearer: []
      parameters:
      - name: agent_id
        in: path
        required: true
        schema:
          type: integer
          title: Agent Id
      - name: version
        in: path
        required: true
        schema:
          type: integer
          title: Version
      - name: X-API-Key
        in: header
        required: true
        schema:
          type: string
        description: API key required to authenticate requests.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/agents/{agent_id}/prompts/{prompt_id}:
    get:
      tags:
      - Prompts
      summary: Get Prompt By Id
      operationId: get_prompt_by_id_v1_agents__agent_id__prompts__prompt_id__get
      security:
      - HTTPBearer: []
      parameters:
      - name: agent_id
        in: path
        required: true
        schema:
          type: integer
          title: Agent Id
      - name: prompt_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Prompt Id
      - name: X-API-Key
        in: header
        required: true
        schema:
          type: string
        description: API key required to authenticate requests.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Prompts
      summary: Delete Prompt By Id Agent Scoped
      operationId: delete_prompt_by_id_agent_scoped_v1_agents__agent_id__prompts__prompt_id__delete
      security:
      - HTTPBearer: []
      parameters:
      - name: agent_id
        in: path
        required: true
        schema:
          type: integer
          title: Agent Id
      - name: prompt_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Prompt Id
      - name: X-API-Key
        in: header
        required: true
        schema:
          type: string
        description: API key required to authenticate requests.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/agents/{agent_id}/prompts/versions/{version}/labels:
    get:
      tags:
      - Prompts
      summary: List Prompt Version Labels Agent Scoped
      operationId: list_prompt_version_labels_agent_scoped_v1_agents__agent_id__prompts_versions__version__labels_get
      security:
      - HTTPBearer: []
      parameters:
      - name: agent_id
        in: path
        required: true
        schema:
          type: integer
          title: Agent Id
      - name: version
        in: path
        required: true
        schema:
          type: integer
          title: Version
      - name: X-API-Key
        in: header
        required: true
        schema:
          type: string
        description: API key required to authenticate requests.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - Prompts
      summary: Add Prompt Version Labels Agent Scoped
      operationId: add_prompt_version_labels_agent_scoped_v1_agents__agent_id__prompts_versions__version__labels_post
      security:
      - HTTPBearer: []
      parameters:
      - name: agent_id
        in: path
        required: true
        schema:
          type: integer
          title: Agent Id
      - name: version
        in: path
        required: true
        schema:
          type: integer
          title: Version
      - name: X-API-Key
        in: header
        required: true
        schema:
          type: string
        description: API key required to authenticate requests.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LabelDeltaRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Prompts
      summary: Remove Prompt Version Labels Agent Scoped
      operationId: remove_prompt_version_labels_agent_scoped_v1_agents__agent_id__prompts_versions__version__labels_delete
      security:
      - HTTPBearer: []
      parameters:
      - name: agent_id
        in: path
        required: true
        schema:
          type: integer
          title: Agent Id
      - name: version
        in: path
        required: true
        schema:
          type: integer
          title: Version
      - name: X-API-Key
        in: header
        required: true
        schema:
          type: string
        description: API key required to authenticate requests.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LabelDeltaRequest'
              default:
                labels: []
                override_label: false
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    LabelDeltaRequest:
      properties:
        labels:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Labels
        override_label:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Override Label
          default: false
      type: object
      title: LabelDeltaRequest
      description: 'request body for add/remove label operations.


        labels: list of labels to add or remove. empty/null means no-op for add,

        and clear-all for remove (callers decide the semantics).

        override_label: when true, adding an existing label moves its association

        to the requested resource; when false, conflicts return 409.'
    CreatePromptVersionBody:
      properties:
        prompt_text:
          type: string
          title: Prompt Text
        commit_message:
          anyOf:
          - type: string
          - type: 'null'
          title: Commit Message
        labels:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Labels
        metadata:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Metadata
      type: object
      required:
      - prompt_text
      title: CreatePromptVersionBody
      description: body for agent-scoped create version endpoint (agent_id in path).
    LabelListResponse:
      properties:
        labels:
          items:
            type: string
          type: array
          title: Labels
      type: object
      title: LabelListResponse
      description: response wrapper for just a list of labels.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    PromptResponse:
      properties:
        id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Id
          description: the id of the prompt
        prompt_text:
          type: string
          title: Prompt Text
          description: the prompt content
        commit_message:
          anyOf:
          - type: string
          - type: 'null'
          title: Commit Message
        labels:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Labels
          description: labels associated with the prompt
        metadata:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Metadata
          description: arbitrary JSON metadata
        version:
          type: integer
          title: Version
          description: the version number of the prompt
        agent_id:
          type: integer
          title: Agent Id
          description: id of the agent that owns this prompt
      type: object
      required:
      - prompt_text
      - version
      - agent_id
      title: PromptResponse
      description: response model for prompt without created_at.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key required to authenticate requests.