Prompts

Upsert

post

Upsert a prompt entry.

Creates a new prompt if the provided id does not exist, or updates the existing prompt with the given id.

Args: request (Prompt): The prompt data to insert or update. db (AsyncSession): The database session dependency.

Returns: JSONResponse: A JSON response containing the prompt data that was upserted.

Raises: HTTPException: If the operation encounters an unexpected error (not currently implemented, but can be added for error handling).

Notes: - Uses FastCRUD for abstracted DB operations. - Relies on the id field to determine insert vs update.

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : Read Permissions
Authorizations
OAuth2passwordRequired
Token URL:
Body

Prompt model.

idintegerRequired
codenamestringRequired
titleany ofRequired
stringOptional
or
nullOptional
valueany ofRequired
stringOptional
or
nullOptional
variablesany ofRequired
stringOptional
or
nullOptional
Responses
chevron-right
200

Successful Response

application/json
Responseany
post
/prompts/upsert

No content

Get

get

Read multiple PromptModel rows from the database.

  • Use page & itemsPerPage for paginated results

  • Use offset & limit for specific ranges

  • Returns paginated response when using page/itemsPerPage

  • Returns simple list response when using offset/limit

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : Read Permissions
Authorizations
OAuth2passwordRequired
Token URL:
Query parameters
offsetany ofOptional

Offset for unpaginated queries

integerOptional
or
nullOptional
limitany ofOptional

Limit for unpaginated queries

integerOptional
or
nullOptional
pageany ofOptional

Page number

integerOptional
or
nullOptional
itemsPerPageany ofOptional

Number of items per page

integerOptional
or
nullOptional
Responses
chevron-right
200

Successful Response

application/json
Responseany of
or
get
/prompts

Create

post

Create a new PromptModel row in the database.

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : Read Permissions
Authorizations
OAuth2passwordRequired
Token URL:
Body

Create Prompt model.

codenamestringRequired
titlestringRequired
valuestringRequired
variablesstringRequired
Responses
chevron-right
200

Successful Response

application/json
Responseany
post
/prompts

No content

Get

get

Read a single PromptModel row from the database by its primary keys: ['id'].

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : Read Permissions
Authorizations
OAuth2passwordRequired
Token URL:
Path parameters
idintegerRequired
Responses
chevron-right
200

Successful Response

application/json
get
/prompts/{id}

Delete

delete

Delete a PromptModel row from the database by its primary keys: ['id'].

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : Read Permissions
Authorizations
OAuth2passwordRequired
Token URL:
Path parameters
idintegerRequired
Responses
chevron-right
200

Successful Response

application/json
Responseany
delete
/prompts/{id}

No content

Update

patch

Update an existing PromptModel row in the database by its primary keys: ['id'].

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : Read Permissions
Authorizations
OAuth2passwordRequired
Token URL:
Path parameters
idintegerRequired
Body

Create Prompt model.

codenamestringRequired
titlestringRequired
valuestringRequired
variablesstringRequired
Responses
chevron-right
200

Successful Response

application/json
Responseany
patch
/prompts/{id}

No content

Last updated