Check if a slug exists
POST
/api/items/checkSlug
const url = 'https://example.com/api/items/checkSlug';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"repositoryId":"repo-123","slug":"my-article","packageName":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
repositoryId
required
Repository ID to check slug in
string
Example
repo-123slug
required
URL slug to check for existence
string
Example
my-articlepackageName
Package name if checking within a package
string | null
Responses
Section titled “Responses”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"}