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
Parameter | Type | Description |
---|---|---|
environment_id | string | The associated environment id |
content_type | string | The associated content type |
Query string Parameters
For semantic searching use where[_semantic_search][eq]={searchstring}
.
Parameter | Type | Description | Default |
---|---|---|---|
where[{property}][eq] | string,number | value for comparison | null |
where[{property}][neq] | string,number | value for comparison | null |
where[{property}][gt] | string,number | value for comparison | null |
where[{property}][gte] | string,number | value for comparison | null |
where[{property}][lt] | string,number | value for comparison | null |
where[{property}][lt] | string,number | value for comparison | null |
where[{property}][in] | string,number | value for comparison | null |
where[{property}][notIn] | string,number | value for comparison | null |
where[{property}][begins] | string,number | value for comparison | null |
where[{property}][ends] | string,number | value for comparison | null |
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 list | null |
populate[{propertyList}] | - | Comma seperate list, used to populate relationships | null |
orderBy[{property}] | string | "desc" or "asc" | "asc" |
pagination[page] | number | page index to return | 0 |
pagination[pageSize] | number | page size to return | 10 |
Headers
Parameter | Type | Description |
---|---|---|
authorization | string | Bearer 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
Parameter | Type | Description |
---|---|---|
environment_id | string | The associated environment id |
content_type | string | The associated content type |
doc_id | string | To id of the document to create or update |
Body
Parameter | Type | Description |
---|---|---|
body | JSON | Document to save |
Headers
Parameter | Type | Description |
---|---|---|
content-type | string | "application/json; charset=utf-8" |
authorization | string | Bearer token set to access_token or API key. |
x-brightlever-action | string | Optional, set to "publish" if desired. |
x-brightlever-source-id | string | The sourceId associated with a webhook action. |
Validate
post: /v1/environments/{environment_id}/entries/{content_type}/{doc_id}
Return document validation.
Path Parameters
Parameter | Type | Description |
---|---|---|
environment_id | string | The associated environment id |
content_type | string | The associated content type |
Body
Parameter | Type | Description |
---|---|---|
body | JSON | Document to save |
Headers
Parameter | Type | Description |
---|---|---|
content-type | string | "application/json; charset=utf-8" |
x-brightlever-action | string | Set to "validate". |
authorization | string | Bearer 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
Parameter | Type | Description |
---|---|---|
environment_id | string | The associated environment id |
content_type | string | The associated content type |
doc_id | string | To id of the document to read |
Headers
Parameter | Type | Description |
---|---|---|
authorization | string | Bearer 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
Parameter | Type | Description |
---|---|---|
environment_id | string | The associated environment id |
content_type | string | The associated content type |
doc_id | string | To id of the document to delete |
Headers
Parameter | Type | Description |
---|---|---|
authorization | string | Bearer token set to access_token or API key. |
x-brightlever-source-id | string | The 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
Parameter | Type | Description |
---|---|---|
environment_id | string | The associated environment id |
content_type | string | The associated content type |
doc_id | string | To id of the document to rollback |
x-brightlever-source-id | string | The sourceId associated with a webhook action. |
Headers
Parameter | Type | Description |
---|---|---|
authorization | string | Bearer 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
Parameter | Type | Description |
---|---|---|
environment_id | string | The associated environment id |
content_type | string | The associated content type |
doc_id | string | To id of the document |
version_id | string | To version_id of the document to publish |
x-brightlever-source-id | string | The sourceId associated with a webhook action. |
Headers
Parameter | Type | Description |
---|---|---|
authorization | string | Bearer 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
Parameter | Type | Description |
---|---|---|
environment_id | string | The associated environment id |
content_type | string | The associated content type |
doc_id | string | To id of the document to delete |
Headers
Parameter | Type | Description |
---|---|---|
authorization | string | Bearer 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
Parameter | Type | Description |
---|---|---|
environment_id | string | The associated environment id |
content_type | string | The associated content type |
Body
Parameter | Type | Description |
---|---|---|
body | JSON | {document?:object, prompt:string} |
Headers
Parameter | Type | Description |
---|---|---|
content-type | string | "application/json; charset=utf-8" |
x-brightlever-action | string | Set to "generate". |
authorization | string | Bearer token set to access_token or API key. |