Skip to content

Check if a slug exists

POST
/api/items/checkSlug
curl --request POST \
--url https://example.com/api/items/checkSlug \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "repositoryId": "repo-123", "slug": "my-article", "packageName": "example" }'

Checks whether a given slug already exists in the repository

Media typeapplication/json
object
repositoryId
required

Repository ID to check slug in

string
Example
repo-123
slug
required

URL slug to check for existence

string
Example
my-article
packageName

Package name if checking within a package

string | null

Slug check result

Media typeapplication/json
object
slugExists
required

Whether the slug already exists in the repository

boolean
id

ID of existing item with this slug, if found

string
Examplegenerated
{
"slugExists": true,
"id": "example"
}

Error checking slug

Media typeapplication/json
object
error
required

Indicates an error occurred

boolean
message
required

Error message describing what went wrong

string
Example
{
"error": true,
"message": "Item not found"
}