Entries API
Retrieve entries from your Obelisk. Each entry belongs to a specific entry type.
Get Single Entry
GET /api/v1/entries/:id
Retrieve a single entry by its ID.
Example Request:
Response Format:
List Entries
GET /api/v1/entry_types/:entry_type_id/entries
Retrieve a paginated list of entries for a specific entry type.
Query Parameters
- •
limit(optional) - Number of entries per page (default: 100, max: 1000) - •
after(optional) - Cursor for pagination - •
q(optional) - Search query - •
include_drafts(optional) - Set totrueto include draft entries (default: false) - •
include_archived(optional) - Set totrueto include archived entries (default: false)
Note: By default, only published (non-draft) and non-archived entries are returned. This ensures you're working with active, finalized entries in your API integrations.
Example Request
Response Format
Search Examples
You can use the q parameter to perform queries on your entries. The search system can handle a wide range of queries:
-
General Search:
q=John -
Field-Specific Search:
q=name:John -
Boolean Search:
q=active:trueORq=active:no -
Numeric Comparison:
q=age>18ORq=weight>=70.5 -
Combined Search:
q=name:John && age>18 -
Alternative Operators:
q=Downtown || Mixed -
Date Range:
q=created_at>2024-01-01 && created_at<2024-01-31 -
Relationships:
q=relationship:Primary Field Name
Example Search Request:
curl -X GET "https://obelisk.li/api/v1/entry_types/entry_type_id/entries?q=name%3AJohn+%26%26+age%3E18" \
-H "X-Api-Key: your_api_key_here"
Cursor Pagination
To efficiently browse through large sets of entries, this API uses cursor-based pagination. Each response returns a next_cursor that can be used to request the next set of entries.
Pass a limit parameter to control how many entries are returned per page (default is 100).
If there are more entries than the current limit, the response will contain a next_cursor value.
To retrieve the next page of entries, supply the after parameter set to the value of next_cursor from the previous response.
For example, your first call might be:
GET https://obelisk.li/api/v1/entry_types/entry_type_id/entries?limit=100
If the response contains a next_cursor, your following call would look like:
GET https://obelisk.li/api/v1/entry_types/entry_type_id/entries?after=eyJjcmVhdGVkX2F0IjoiMjAyMy0wOC0wMSIsImlkIjoiNDU2NzgifQ%3D%3D&limit=100
This approach ensures that the pagination is both efficient and consistent even as new entries are created.