SkillAgentSearch skills...

endpoints

Custom REST API endpoints with authentication and helpers

Install / Use

npx skills add sanjayguwaju/himalayascontinental

Installs into whichever agent you are using.

About this skill
📐

Cursor Rules

Cursor IDE rules (v2)

Quality Score

59/100

Supported Platforms

Cursor

Our assessment of endpoints

endpoints scores 59/100 on our quality scale, 4131st of 4,617 Development & Engineering skills we index.

Its Cursor Rules is 4.8 KB long, well organised into 12 sections with 9 code examples: a solid amount of guidance for an agent.

It has no GitHub stars yet, so there is no community track record; judge it on its content.

Substance
26/30
Structure
20/20
Description
8/15
Adoption
0/20
Freshness
5/15

Maintenance, license and trust

  • We could not determine when the repository was last updated.
  • Our last check on 2026-10-20 found the source still online.
  • No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
  • Its trust signals score 68/100, with 3 cautions from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

Safety scan

No issues found

Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.

AI review by kimi-k2.7-code on 2026-09-24. Automated pattern scan on 2026-09-24. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.

endpoints compared with similar skills

All 4 of these similar skills score higher than endpoints; compare them before choosing.

SkillScoreStarsUpdatedFormat
endpoints (this skill)by sanjayguwaju590—Cursor Rules
taste-skillby Leonxlnx100110.6ktodayCLAUDE.md
Agent-Reachby Panniantong100109.2ktodayCLAUDE.md
headroomby headroomlabs-ai10078.9ktodayCLAUDE.md
ai-job-searchby ai-job-search-dev10069.8ktodayCLAUDE.md

Frequently asked questions

How do I install endpoints?
Run npx skills add sanjayguwaju/himalayascontinental. The install tabs above show the steps for each supported agent.
Which AI agents does endpoints work with?
It is written for Cursor, as a Cursor Rules file. Other agents that read the same format can often use it too.
Is endpoints safe to use?
Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It declares no license and scores 68/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is endpoints still maintained?
We could not determine when the repository was last updated.

title: Custom Endpoints description: Custom REST API endpoints with authentication and helpers tags: [payload, endpoints, api, routes, webhooks]

Payload Custom Endpoints

Basic Endpoint Pattern

Custom endpoints are not authenticated by default. Always check req.user.

import { APIError } from "payload";
import type { Endpoint } from "payload";

export const protectedEndpoint: Endpoint = {
  path: "/protected",
  method: "get",
  handler: async (req) => {
    if (!req.user) {
      throw new APIError("Unauthorized", 401);
    }

    // Use req.payload for database operations
    const data = await req.payload.find({
      collection: "posts",
      where: { author: { equals: req.user.id } },
    });

    return Response.json(data);
  },
};

Route Parameters

export const trackingEndpoint: Endpoint = {
  path: "/:id/tracking",
  method: "get",
  handler: async (req) => {
    const { id } = req.routeParams;

    const tracking = await getTrackingInfo(id);

    if (!tracking) {
      return Response.json({ error: "not found" }, { status: 404 });
    }

    return Response.json(tracking);
  },
};

Request Body Handling

// Manual JSON parsing
export const createEndpoint: Endpoint = {
  path: "/create",
  method: "post",
  handler: async (req) => {
    const data = await req.json();

    const result = await req.payload.create({
      collection: "posts",
      data,
    });

    return Response.json(result);
  },
};

// Using helper (handles JSON + files)
import { addDataAndFileToRequest } from "payload";

export const uploadEndpoint: Endpoint = {
  path: "/upload",
  method: "post",
  handler: async (req) => {
    await addDataAndFileToRequest(req);

    // req.data contains parsed body
    // req.file contains uploaded file (if multipart)

    const result = await req.payload.create({
      collection: "media",
      data: req.data,
      file: req.file,
    });

    return Response.json(result);
  },
};

Query Parameters

export const searchEndpoint: Endpoint = {
  path: "/search",
  method: "get",
  handler: async (req) => {
    const url = new URL(req.url);
    const query = url.searchParams.get("q");
    const limit = parseInt(url.searchParams.get("limit") || "10");

    const results = await req.payload.find({
      collection: "posts",
      where: {
        title: {
          contains: query,
        },
      },
      limit,
    });

    return Response.json(results);
  },
};

CORS Headers

import { headersWithCors } from "payload";

export const corsEndpoint: Endpoint = {
  path: "/public-data",
  method: "get",
  handler: async (req) => {
    const data = await fetchPublicData();

    return Response.json(data, {
      headers: headersWithCors({
        headers: new Headers(),
        req,
      }),
    });
  },
};

Error Handling

import { APIError } from "payload";

export const validateEndpoint: Endpoint = {
  path: "/validate",
  method: "post",
  handler: async (req) => {
    const data = await req.json();

    if (!data.email) {
      throw new APIError("Email is required", 400);
    }

    return Response.json({ valid: true });
  },
};

Endpoint Placement

Collection Endpoints

Mounted at /api/{collection-slug}/{path}.

export const Orders: CollectionConfig = {
  slug: "orders",
  endpoints: [
    {
      path: "/:id/tracking",
      method: "get",
      handler: async (req) => {
        // Available at: /api/orders/:id/tracking
        const orderId = req.routeParams.id;
        return Response.json({ orderId });
      },
    },
  ],
};

Global Endpoints

Mounted at /api/globals/{global-slug}/{path}.

export const Settings: GlobalConfig = {
  slug: "settings",
  endpoints: [
    {
      path: "/clear-cache",
      method: "post",
      handler: async (req) => {
        // Available at: /api/globals/settings/clear-cache
        await clearCache();
        return Response.json({ message: "Cache cleared" });
      },
    },
  ],
};

Root Endpoints

Mounted at /api/{path}.

export default buildConfig({
  endpoints: [
    {
      path: "/hello",
      method: "get",
      handler: () => {
        // Available at: /api/hello
        return Response.json({ message: "Hello!" });
      },
    },
  ],
});

Best Practices

  1. Always check authentication - Custom endpoints are not authenticated by default
  2. Use req.payload for operations - Ensures access control and hooks execute
  3. Use helpers for common tasks - addDataAndFileToRequest, headersWithCors
  4. Throw APIError for errors - Provides consistent error responses
  5. Return Web API Response - Use Response.json() for consistent responses
  6. Validate input - Check required fields, validate types
  7. Log errors - Use req.payload.logger for debugging

Related Skills

View on GitHub
GitHub Stars0
CategoryDevelopment
UpdatedNaNy ago
Forks0

Trust signals

68/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

2 medium1 low