Prompts

Authentication
The API key should be sent as a Bearer token in the Authorization header of the request. Get your API key.
List

API endpoint

GET
https://phplens.lunatio.com/api/v1/prompts

Request example

curl --location --request GET 'https://phplens.lunatio.com/api/v1/prompts' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'

Parameters

Name
Type
Description
search
optional string
Search query.
search_by
optional string
Search by. Possible values are: query for Query, project for Project. Defaults to: query.
project_id
optional integer
Project ID.
favorite
optional boolean
Filter by favorite.
sort_by
optional string
Sort by. Possible values are: id for Date created, query for Query. Defaults to: id.
sort
optional string
Sort. Possible values are: desc for Descending, asc for Ascending. Defaults to: desc.
per_page
optional integer
Results per page. Possible values are: 10, 25, 50, 100. Defaults to: 10.
Show

API endpoint

GET
https://phplens.lunatio.com/api/v1/prompts/{id}

Request example

curl --location --request GET 'https://phplens.lunatio.com/api/v1/prompts/{id}' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
Store

API endpoint

POST
https://phplens.lunatio.com/api/v1/prompts

Request example

curl --location --request POST 'https://phplens.lunatio.com/api/v1/prompts' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'project_id={project_id}' \
--data-urlencode 'name={name}' \
--data-urlencode 'domain={domain}'

Parameters

Name
Type
Description
project_id
required integer
Project ID.
name
required string
Name.
domain
required string
Domain.
Update

API endpoint

PUT PATCH
https://phplens.lunatio.com/api/v1/prompts/{id}

Request example

curl --location --request PUT 'https://phplens.lunatio.com/api/v1/prompts/{id}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}'

Parameters

Name
Type
Description
name
optional string
Name.
domain
optional string
Domain.
Delete

API endpoint

DELETE
https://phplens.lunatio.com/api/v1/prompts/{id}

Request example

curl --location --request DELETE 'https://phplens.lunatio.com/api/v1/prompts/{id}' \
--header 'Authorization: Bearer {api_key}'