Endpoints

Entries

List

Return entries within a configured stream.

GET /api/streams/{stream}/entries

{
    "data": [
        {
            "title": "Hello World"
        }
    ],
    "links": {...},
    "meta": {...}
}

Create

Create a new entry.

POST /api/streams/{stream}/entries

curl --location --request POST '/api/streams/{stream}/entries' \
    -H 'Content-Type: application/json' \
    -d '{"id": "hello_world", "title": "Hello World"}'   

Return result:

{
    "data": [
        {
            "id": "hello_world",
            "title": "Hello World"
        }
    ],
    "links": {...},
    "meta": {...}
}

Show

Return a single entry.

GET /api/streams/{stream}/entries/{entry}

{
    "data": [
        {
            "title": "Hello World"
        }
    ],
    "links": {...},
    "meta": {...}
}

Update

To update select values of an entry, use patch.

PATCH /api/streams/{stream}/entries/{entry}

To replace the entry attributes entirely, use put.

PUT /api/streams/{stream}/entries/{entry}

curl --location --request PATCH '/api/streams/{stream}/entries/{entry}' \
    -H 'Content-Type: application/json' \
    -d '{"title": "New Title"}'

Return result:

{
    "data": [
        {
            "id": "hello_world",
            "title": "Hello World!"
        }
    ],
    "links": {...},
    "meta": {...}
}

Delete

Deletes an entry.

DELETE /api/streams/{stream}/entries/{entry}

Streams

List

Return configured streams.

GET /api/streams/{stream}

{
    "data": {...},
    "links": {...},
    "meta": {...}
}

Create

Create a new stream.

POST /api/streams

curl --location --request POST '/api/streams' \
    -H 'Content-Type: application/json' \
    -d '{"id": "contacts", "name": "Contacts", "fields": {...}}'   

Return result:

{
    "data": [
        {
            "id": "contacts",
            "name": "Contacts"
        }
    ],
    "links": {...},
    "meta": {...}
}

Show

Return a single stream.

GET /api/streams/{stream}

{
    "data": [
        {
            "name": "Contacts"
        }
    ],
    "links": {...},
    "meta": {...}
}

Update

To update select values of a stream, use patch.

PATCH /api/streams/{stream}

To replace the attributes entirely, use put.

PUT /api/streams/{stream}

curl --location --request PATCH '/api/streams/{stream}' \
    -H 'Content-Type: application/json' \
    -d '{"description": "A simple contacts listing."}'   

Return result:

{
    "data": [
        {
            "title": "Contacts",
            "description": "A simple contacts listing."
        }
    ],
    "links": {...},
    "meta": {...}
}

Delete

Deletes an stream.

DELETE /api/streams/{stream}

{
    "data": [],
    "links": {...},
    "meta": {...}
}

Querying

You can manipulate the query using criteria parameters in the URI.

Filtering

curl --location --request GET '/api/streams' \
    -H 'Content-Type: application/json' \
    -d '{"query": [{"where": ["id", "LIKE", "%doc%"]}]}'

Sorting

curl --location --request GET '/api/streams/docs/entries' \
    -H 'Content-Type: application/json' \
    -d '{"query": [{"where": ["enabled", true]}]}'