Skip to main content
GET
/
api
/
posts
/
slug
/
:slug
Get Post by Slug
curl --request GET \
  --url https://api.example.com/api/posts/slug/:slug
{
  "403": {},
  "404": {},
  "500": {},
  "id": "<string>",
  "userId": "<string>",
  "title": "<string>",
  "slug": "<string>",
  "content": "<string>",
  "excerpt": "<string>",
  "coverImage": "<string>",
  "published": true,
  "publishedAt": "<string>",
  "views": 123,
  "shares": 123,
  "createdAt": "<string>",
  "updatedAt": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/subratomandal/dyeink/llms.txt

Use this file to discover all available pages before exploring further.

Authentication

Optional authentication. Public can view published posts; authenticated users can view their own unpublished posts.

Path Parameters

slug
string
required
The URL-friendly slug of the post

Query Parameters

userId
string
Optional user ID to scope the slug lookup. Useful when multiple users might have the same slug.

Response

id
string
Unique identifier for the post
userId
string
ID of the user who created the post
title
string
Post title
slug
string
URL-friendly slug
content
string
Post content (HTML)
excerpt
string
Brief summary of the post
coverImage
string
URL of the cover image
published
boolean
Whether the post is published
publishedAt
string
ISO 8601 timestamp of when the post was published (null if unpublished)
views
number
Number of views
shares
number
Number of shares
createdAt
string
ISO 8601 timestamp of post creation
updatedAt
string
ISO 8601 timestamp of last update

Example

cURL
curl -X GET https://api.dyeink.com/api/posts/slug/my-first-post
JavaScript
const response = await fetch('https://api.dyeink.com/api/posts/slug/my-first-post');
const post = await response.json();

Response Example

{
  "id": "65abc123def456789",
  "userId": "auth0|123456789",
  "title": "My First Post",
  "slug": "my-first-post",
  "content": "<p>This is my first blog post!</p>",
  "excerpt": "An introduction to my blog",
  "coverImage": "https://r2.dev/images/cover.jpg",
  "published": true,
  "publishedAt": "2024-01-15T10:30:00Z",
  "views": 42,
  "shares": 5,
  "createdAt": "2024-01-15T10:00:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}

Error Responses

404
object
Post not found
{
  "error": "Post not found"
}
403
object
Access denied to unpublished post
{
  "error": "Access denied"
}
500
object
Server error
{
  "error": "Failed to get post"
}
This endpoint is useful for fetching posts by their human-readable URL slug. If you need to query by database ID, use the Get Post by ID endpoint instead.