Fetch Entity by Foreign ID
Entity Endpoints
Fetch Entity by Foreign ID
Get an entity by its foreign ID, optionally creating it if not found
Fetch Entity by Foreign ID
Requires the
entities bundle. A project without the entities bundle returns 403 database/tables-not-available. See Bundles.foreignId within the project. Optionally creates a blank entity if none exists — useful for automatically bootstrapping entities when a user first visits a page or URL in your application.
Query Parameters
string
required
The foreign ID to look up. This is the identifier from your application (URL, slug, database ID, etc.).
string
When
"true", creates a blank entity with this foreignId if no entity is found. The new entity has no title, content, or user attribution. Defaults to "false".string
Comma-separated list of associations to include:
user— the author’s user profilespace— the space the entity belongs totopComment— the highest-voted commentsaved— whether the authenticated user has saved this entityfiles— uploaded file/image attachmentsgrants— the reputation-grant summary for the entity
Response
Returns an Entity object.This endpoint returns entities regardless of moderation status, so the client can display the appropriate moderation state. Draft entities are only returned to their author (or with a service/master key).
Error Responses
Not Found — 404
Not Found — 404
foreignId exists and createIfNotFound is not "true".
