Posts

Blog post articles containing title, body, user association, created dates, and full-text search indexing. All mutations persist in your isolated session overlay.

List All Posts

Retrieve a paginated list of posts. Results merge shared global posts with session sandbox overlays (newly created posts appear at the top).

Request Endpoint
GEThttps://playground.nileslabs.com/api/v1/posts
Parameters
ParameterTypeDescription
pageintegerPage number (1-indexed).
limitintegerNumber of records per page (default 10, max 200).
user_idintegerFilter posts authored by user ID (e.g. user_id=1).
qstringFull-text search query term across title and body.
_sortstringField name to sort results by (title, id, created_at).
_orderstringSort direction: asc or desc.
1
{
2
"data": [
3
{
4
"id": "local-b2c3d4e5-f6a7-8901-bcde-f12345678901",
5
"user_id": 1,
6
"title": "Getting Started with Playground API",
7
"body": "Playground API provides instant sandboxed mock endpoints...",
8
"_sandbox": "created"
9
},
10
{
11
"id": 1,
12
"user_id": 1,
13
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
14
"body": "quia et suscipit suscipit recusandae consequuntur expedita et cum..."
15
}
16
],
17
"pagination": {
18
"page": 1,
19
"limit": 10,
20
"total": 100,
21
"totalPages": 10,
22
"hasNextPage": true,
23
"hasPrevPage": false
24
}
25
}

Get Single Post

Retrieve details of a specific post by integer ID or local sandbox string ID.

Request Endpoint
GEThttps://playground.nileslabs.com/api/v1/posts/:id
Parameters
ParameterTypeDescription
idstring | integerPost ID (global integer or local-<uuid>).
1
{
2
"id": 1,
3
"user_id": 1,
4
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
5
"body": "quia et suscipit suscipit recusandae consequuntur expedita et cum reprehenderit molestiae ut ut quas totam nostrum rerum est autem sunt rem eveniet architecto"
6
}

Create Post

Create a new post in your session overlay. Capped at 30 custom created records per session.

Request Endpoint
POSThttps://playground.nileslabs.com/api/v1/posts
Request Body Example
1
{
2
"user_id": 1,
3
"title": "Getting Started with Playground API",
4
"body": "Playground API provides instant sandboxed mock endpoints with per-session mutation overlays."
5
}
1
{
2
"id": "local-b2c3d4e5-f6a7-8901-bcde-f12345678901",
3
"user_id": 1,
4
"title": "Getting Started with Playground API",
5
"body": "Playground API provides instant sandboxed mock endpoints with per-session mutation overlays.",
6
"_sandbox": "created"
7
}

Replace Post (PUT)

Replace an existing post record in the session overlay while preserving global baseline position.

Request Endpoint
PUThttps://playground.nileslabs.com/api/v1/posts/:id
Request Body Example
1
{
2
"user_id": 1,
3
"title": "Getting Started with Playground API (Updated Edition)",
4
"body": "Full replacement content body text."
5
}
1
{
2
"id": 1,
3
"user_id": 1,
4
"title": "Getting Started with Playground API (Updated Edition)",
5
"body": "Full replacement content body text.",
6
"_sandbox": "updated"
7
}

Partial Post Update (PATCH)

Update specific fields (such as title or body text) of an existing post.

Request Endpoint
PATCHhttps://playground.nileslabs.com/api/v1/posts/:id
Request Body Example
1
{
2
"title": "Getting Started with Playground API (Patched)"
3
}
1
{
2
"id": 1,
3
"user_id": 1,
4
"title": "Getting Started with Playground API (Patched)",
5
"body": "quia et suscipit suscipit recusandae consequuntur expedita et cum reprehenderit molestiae...",
6
"_sandbox": "updated"
7
}

Delete Post

Remove a post record from your session overlay view.

Request Endpoint
DELETEhttps://playground.nileslabs.com/api/v1/posts/:id
1
204 No Content

Get Post Comments Sub-Resource

Retrieve all comments linked relationally to a specific blog post.

Request Endpoint
GEThttps://playground.nileslabs.com/api/v1/posts/:postId/comments
Parameters
ParameterTypeDescription
postIdstring | integerTarget post ID (e.g. 1 or local-<uuid>).
pageintegerPage number (1-indexed).
limitintegerNumber of comments per page.
qstringSearch term across comment body.
1
{
2
"data": [
3
{
4
"id": 1,
5
"post_id": 1,
6
"name": "id labore ex et quam laborum",
7
"email": "Eliseo@gardner.biz",
8
"body": "laudantium enim quasi est quidem magnam voluptate ipsam eos"
9
}
10
],
11
"pagination": {
12
"page": 1,
13
"limit": 10,
14
"total": 3,
15
"totalPages": 1,
16
"hasNextPage": false,
17
"hasPrevPage": false
18
}
19
}
Playground API — Free Stateful Mock REST & GraphQL Service