cURL API Examples
Schema
This is a DVD Rentals example database schema from PostgreSQL Tutorial.
There are 15 tables in the DVD Rental database:
actor – stores actors data including first name and last name.
film – stores film data such as title, release year, length, rating, etc.
film_actor – stores the relationships between films and actors.
category – stores film’s categories data.
film_category- stores the relationships between films and categories.
store – contains the store data including manager staff and address.
inventory – stores inventory data.
rental – stores rental data.
payment – stores customer’s payments.
staff – stores staff data.
customer – stores customer data.
address – stores address data for staff and customers
city – stores city names.
country – stores country names.
Here is the ERD of the sample DVD rentals database:

This is the schema in the Neurelo Schema Language JSON Specification format
GET endpoint examples
Get All Actors
curl https://us-east-2.aws.neurelo.app/rest/actor \
--header 'X-API-KEY: <api-key>'
Get specific actor(s)
# Find actor with "actor_id" = 200
curl https://us-east-2.aws.neurelo.app/rest/actor \
--url-query filter='{"actor_id":200}' \
--header 'X-API-KEY: <api-key>'
# Find actor(s) with the First Name "Ed"
curl https://us-east-2.aws.neurelo.app/rest/actor \
--url-query filter='{"first_name":"Ed"}' \
--header 'X-API-KEY: <api-key>'
# Find actor(s) whose Last Name contains "berg"
curl https://us-east-2.aws.neurelo.app/rest/actor \
--url-query filter='{"last_name": {"contains": "berg"}}' \
--header 'X-API-KEY: <api-key>'
# Find actor(s) whose First Name does not contain "John"
curl https://us-east-2.aws.neurelo.app/rest/actor \
--url-query filter='{"NOT":{"first_name":{"contains":"John"}}}' \
--header 'X-API-KEY: <api-key>'
# Find actor(s) whose First Name is not "John"
curl https://us-east-2.aws.neurelo.app/rest/actor \
--url-query filter='{"NOT":{"first_name":"John"}}' \
--header 'X-API-KEY: <api-key>'
# Find actor(s) whose First Name is "John" or "Ed"
curl https://us-east-2.aws.neurelo.app/rest/actor \
--url-query filter='{"OR":[{"first_name":"John"},{"first_name":"Ed"}]}' \
--header 'X-API-KEY: <api-key>'
# Find actor(s) whose First Name is NOT ("John" or "Ed")
curl https://us-east-2.aws.neurelo.app/rest/actor \
--url-query filter='{"NOT":{"OR":[{"first_name":"John"},{"first_name":"Ed"}]}}' \
--header 'X-API-KEY: <api-key>'
Get 10 Customers
curl https://us-east-2.aws.neurelo.app/rest/customer \
--url-query take='10' \
--header 'X-API-KEY: <api-key>'
Get Films & Actors
curl https://us-east-2.aws.neurelo.app/rest/film \
--url-query select='{"film_actor": {"actor":{"$scalars": true}}, "$scalars": true}' \
--header 'X-API-KEY: <api-key>'
Get Stores & Employees
curl https://us-east-2.aws.neurelo.app/rest/store \
--url-query select='{"staff":{"$scalars": true}, "$scalars": true}' \
--header 'X-API-KEY: <api-key>'
Get 5 Rentals and Films
curl https://us-east-2.aws.neurelo.app/rest/rental \
--url-query select='{"inventory":{"film": {"$scalars": true}}, "$scalars": true}&take=5' \
--header 'X-API-KEY: <api-key>'
Get 3 Films By Category
curl https://us-east-2.aws.neurelo.app/rest/category \
--url-query select='{"film_category":{"film": {"$scalars": true}}, "$scalars": true}&take=3' \
--header 'X-API-KEY: <api-key>'
POST endpoint examples
Create New Actor
curl https://us-east-2.aws.neurelo.app/rest/actor \
--header 'X-API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"first_name": "John",
"last_name": "Wayne"
}'
Create many Rentals
curl https://us-east-2.aws.neurelo.app/rest/rental \
--header 'X-API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data '[
{
"customer_id": 2,
"inventory_id": 1,
"rental_date": "2023-07-11T14:50:58.951Z",
"staff_id": 1
},
{
"customer_id": 524,
"inventory_id": 2,
"rental_date": "2023-07-11T14:50:58.951Z",
"staff_id": 1
}
]'
Create One Film & Related
curl https://us-east-2.aws.neurelo.app/rest/film \
--url-query select='{"$scalars": true, "language": {"$scalars": true}, "film_category": {"category": {"$scalars": true}}, "film_actor": {"actor": {"$scalars": true}}}' \
--header 'X-API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"title": "Shrek 3",
"language": {
"connect": {
"language_id": 2
}
},
"film_category": {
"create": {
"category": {
"create": {
"name": "Swamp"
}
}
}
},
"film_actor": {
"create": {
"actor": {
"create": {
"first_name": "Prince",
"last_name": "Arthur"
}
}
}
}
}'
PATCH endpoint examples
Update a film
curl --request PATCH https://us-east-2.aws.neurelo.app/rest/film/133 \
--header 'X-API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"description": "Book of Life"
}'
DELETE endpoint examples
Delete an actor
curl --request DELETE [https://us-east-2.aws.neurelo.app/rest/actor/201 \](https://us-east-2.aws.neurelo.app/openapi/actor/201?select=%7B%22%24scalars%22%3A%20true%2C%20%22%24related%22%3A%20true%7D)
--header 'X-API-KEY: <api-key>'
Delete films by name
curl --request DELETE [https://us-east-2.aws.neurelo.app/rest/film \
--url-quer](https://us-east-2.aws.neurelo.app/openapi/film?filter=%7B%22title%22%3A%20%7B%22contains%22%3A%20%22Shark%22%7D)y filter='{"title":{"contains":"Shark"}}' \
--header 'X-API-KEY: <api-key>'
Last updated