Document API

API methods for managing documents

Find Query

GET: /v1/environments/{environment_id}/entries/{content_type}

Retrieves collection of documents from a specific content type.

Path Parameters

ParameterTypeDescription
environment_idstringThe associated environment id
content_typestringThe associated content type

Query string Parameters

For semantic searching use where[_semantic_search][eq]={searchstring}.

ParameterTypeDescriptionDefault
where[{property}][eq]string,numbervalue for comparisonnull
where[{property}][neq]string,numbervalue for comparisonnull
where[{property}][gt]string,numbervalue for comparisonnull
where[{property}][gte]string,numbervalue for comparisonnull
where[{property}][lt]string,numbervalue for comparisonnull
where[{property}][lt]string,numbervalue for comparisonnull
where[{property}][in]string,numbervalue for comparisonnull
where[{property}][notIn]string,numbervalue for comparisonnull
where[{property}][begins]string,numbervalue for comparisonnull
where[{property}][ends]string,numbervalue for comparisonnull
aggregate[count]-count(*)-
aggregate[{property}][sum]-num(property)-
aggregate[{property}][avg]-avg(property)-
aggregate[{property}][min]-min(property)-
aggregate[{property}][max]-max(property)-
aggregate[{property}][or]-or-
aggregate[{property}][or][openGrouping]-or (-
aggregate[{property}][openGrouping]-and (-
aggregate[{property}][closeGrouping]-)-
select[{propertyList}]-Comma seperate listnull
populate[{propertyList}]-Comma seperate list, used to populate relationshipsnull
orderBy[{property}]string"desc" or "asc""asc"
pagination[page]numberpage index to return0
pagination[pageSize]numberpage size to return10

Headers

ParameterTypeDescription
authorizationstringBearer token set to access_token or API key.

Upsert

post: /v1/environments/{environment_id}/entries/{content_type}/{doc_id}

Creates or updates a document in a collection.

Path Parameters

ParameterTypeDescription
environment_idstringThe associated environment id
content_typestringThe associated content type
doc_idstringTo id of the document to create or update

Body

ParameterTypeDescription
bodyJSONDocument to save

Headers

ParameterTypeDescription
content-typestring"application/json; charset=utf-8"
authorizationstringBearer token set to access_token or API key.
x-brightlever-actionstringOptional, set to "publish" if desired.
x-brightlever-source-idstringThe sourceId associated with a webhook action.

Validate

post: /v1/environments/{environment_id}/entries/{content_type}/{doc_id}

Return document validation.

Path Parameters

ParameterTypeDescription
environment_idstringThe associated environment id
content_typestringThe associated content type

Body

ParameterTypeDescription
bodyJSONDocument to save

Headers

ParameterTypeDescription
content-typestring"application/json; charset=utf-8"
x-brightlever-actionstringSet to "validate".
authorizationstringBearer token set to access_token or API key.

Read

get: /v1/environments/{environment_id}/entries/{content_type}/{doc_id}

Reads a document from a collection.

Path Parameters

ParameterTypeDescription
environment_idstringThe associated environment id
content_typestringThe associated content type
doc_idstringTo id of the document to read

Headers

ParameterTypeDescription
authorizationstringBearer token set to access_token or API key.

Delete

delete: /v1/environments/{environment_id}/entries/{content_type}/{doc_id}

Deletes a document from a collection.

Path Parameters

ParameterTypeDescription
environment_idstringThe associated environment id
content_typestringThe associated content type
doc_idstringTo id of the document to delete

Headers

ParameterTypeDescription
authorizationstringBearer token set to access_token or API key.
x-brightlever-source-idstringThe sourceId associated with a webhook action.

Rollback

post: /v1/environments/{environment_id}/entries/{content_type}/{doc_id}/rollback

Rolls document back to the previous published version.

Path Parameters

ParameterTypeDescription
environment_idstringThe associated environment id
content_typestringThe associated content type
doc_idstringTo id of the document to rollback
x-brightlever-source-idstringThe sourceId associated with a webhook action.

Headers

ParameterTypeDescription
authorizationstringBearer token set to access_token or API key.

Publish

post: /v1/environments/{environment_id}/entries/{content_type}/{doc_id}/publish/{version_id}

Publishes a prexisting document document version.

Path Parameters

ParameterTypeDescription
environment_idstringThe associated environment id
content_typestringThe associated content type
doc_idstringTo id of the document
version_idstringTo version_id of the document to publish
x-brightlever-source-idstringThe sourceId associated with a webhook action.

Headers

ParameterTypeDescription
authorizationstringBearer token set to access_token or API key.

History

get: /v1/environments/{environment_id}/entries/{content_type}/{doc_id}/history

This endpoint is not yet implemented. It will return the version history of the document.

Path Parameters

ParameterTypeDescription
environment_idstringThe associated environment id
content_typestringThe associated content type
doc_idstringTo id of the document to delete

Headers

ParameterTypeDescription
authorizationstringBearer token set to access_token or API key.

Generate

post: /v1/environments/{environment_id}/entries/{content_type}

This generates one or more documents based on the the prompt.

If you pass a document with the request then the prompt will be used to update the document.

Path Parameters

ParameterTypeDescription
environment_idstringThe associated environment id
content_typestringThe associated content type

Body

ParameterTypeDescription
bodyJSON{document?:object, prompt:string}

Headers

ParameterTypeDescription
content-typestring"application/json; charset=utf-8"
x-brightlever-actionstringSet to "generate".
authorizationstringBearer token set to access_token or API key.