{
    "url": "https://delaparra-services.nl/skills/api-design-principles",
    "locale": "en",
    "title": "API Design Principles | DeLaParra Services",
    "description": "Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use when designing new APIs, reviewing API specifications, or establishing API design standards.",
    "alternates": {
        "en": "https://delaparra-services.nl/skills/api-design-principles",
        "nl": "https://delaparra-services.nl/nl/skills/api-design-principles"
    },
    "formats": {
        "csv": "https://delaparra-services.nl/skills/api-design-principles.csv",
        "md": "https://delaparra-services.nl/skills/api-design-principles.md",
        "json": "https://delaparra-services.nl/skills/api-design-principles.json",
        "zip": "https://delaparra-services.nl/skills/api-design-principles.zip",
        "pdf": "https://delaparra-services.nl/skills/api-design-principles.pdf"
    },
    "downloads": [
        {
            "url": "https://delaparra-services.nl/skills/api-design-principles.csv",
            "encodingFormat": "text/csv",
            "name": "api-design-principles.csv"
        },
        {
            "url": "https://delaparra-services.nl/skills/api-design-principles.json",
            "encodingFormat": "application/json",
            "name": "api-design-principles.json"
        },
        {
            "url": "https://delaparra-services.nl/skills/api-design-principles.md",
            "encodingFormat": "text/markdown",
            "name": "api-design-principles.md"
        },
        {
            "url": "https://delaparra-services.nl/skills/api-design-principles.pdf",
            "encodingFormat": "application/pdf",
            "name": "api-design-principles.pdf"
        },
        {
            "url": "https://delaparra-services.nl/skills/api-design-principles.zip",
            "encodingFormat": "application/zip",
            "name": "api-design-principles.zip"
        },
        {
            "url": "https://delaparra-services.nl/skills/api-design-principles/download",
            "encodingFormat": "application/zip",
            "name": "api-design-principles-files.zip"
        }
    ],
    "markdown": "# API Design Principles\n\n \n\nMaster REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use when designing new APIs, reviewing API specifications, or establishing API design standards.\n\n \n\n**Licence** MIT\n\n \n\n**Source** wshobson/agents\n\n \n\n**This skill contains executable scripts.**\n\n [Download zip](<https://delaparra-services.nl/skills/api-design-principles/download>)   \n\n# API Design Principles\n\n \n\nMaster REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers and stand the test of time.\n\n \n\n## When to Use This Skill\n\n \n\n- Designing new REST or GraphQL APIs \n- Refactoring existing APIs for better usability \n- Establishing API design standards for your team \n- Reviewing API specifications before implementation \n- Migrating between API paradigms (REST to GraphQL, etc.) \n- Creating developer-friendly API documentation \n- Optimizing APIs for specific use cases (mobile, third-party integrations)\n\n \n\n## Core Concepts\n\n \n\n### 1. RESTful Design Principles\n\n \n\n**Resource-Oriented Architecture**\n\n \n\n- Resources are nouns (users, orders, products), not verbs \n- Use HTTP methods for actions (GET, POST, PUT, PATCH, DELETE) \n- URLs represent resource hierarchies \n- Consistent naming conventions\n\n \n\n**HTTP Methods Semantics:**\n\n \n\n- ` GET `: Retrieve resources (idempotent, safe) \n- ` POST `: Create new resources \n- ` PUT `: Replace entire resource (idempotent) \n- ` PATCH `: Partial resource updates \n- ` DELETE `: Remove resources (idempotent)\n\n \n\n### 2. GraphQL Design Principles\n\n \n\n**Schema-First Development**\n\n \n\n- Types define your domain model \n- Queries for reading data \n- Mutations for modifying data \n- Subscriptions for real-time updates\n\n \n\n**Query Structure:**\n\n \n\n- Clients request exactly what they need \n- Single endpoint, multiple operations \n- Strongly typed schema \n- Introspection built-in\n\n \n\n### 3. API Versioning Strategies\n\n \n\n**URL Versioning:**\n\n \n\n```\n/api/v1/users\n/api/v2/users\n```\n\n \n\n**Header Versioning:**\n\n \n\n```\nAccept: application/vnd.api+json; version=1\n```\n\n \n\n**Query Parameter Versioning:**\n\n \n\n```\n/api/users?version=1\n```\n\n \n\n## Detailed patterns and worked examples\n\n \n\nDetailed pattern documentation lives in ` references/details.md `. Read that file when the navigation tier above is insufficient.\n\n \n\n## Best Practices\n\n \n\n### REST APIs\n\n \n\n1. **Consistent Naming**: Use plural nouns for collections (` /users `, not ` /user `) \n1. **Stateless**: Each request contains all necessary information \n1. **Use HTTP Status Codes Correctly**: 2xx success, 4xx client errors, 5xx server errors \n1. **Version Your API**: Plan for breaking changes from day one \n1. **Pagination**: Always paginate large collections \n1. **Rate Limiting**: Protect your API with rate limits \n1. **Documentation**: Use OpenAPI/Swagger for interactive docs\n\n \n\n### GraphQL APIs\n\n \n\n1. **Schema First**: Design schema before writing resolvers \n1. **Avoid N+1**: Use DataLoaders for efficient data fetching \n1. **Input Validation**: Validate at schema and resolver levels \n1. **Error Handling**: Return structured errors in mutation payloads \n1. **Pagination**: Use cursor-based pagination (Relay spec) \n1. **Deprecation**: Use ` @deprecated ` directive for gradual migration \n1. **Monitoring**: Track query complexity and execution time\n\n \n\n## Common Pitfalls\n\n \n\n- **Over-fetching/Under-fetching (REST)**: Fixed in GraphQL but requires DataLoaders \n- **Breaking Changes**: Version APIs or use deprecation strategies \n- **Inconsistent Error Formats**: Standardize error responses \n- **Missing Rate Limits**: APIs without limits are vulnerable to abuse \n- **Poor Documentation**: Undocumented APIs frustrate developers \n- **Ignoring HTTP Semantics**: POST for idempotent operations breaks expectations \n- **Tight Coupling**: API structure shouldn't mirror database schema\n\n \n\n## Files\n\n \n\n- ` LICENSE ` \n- ` SKILL.md ` \n- ` SOURCE.md ` \n- ` assets/api-design-checklist.md ` \n- ` assets/rest-api-template.py ` \n- ` references/details.md ` \n- ` references/graphql-schema-design.md ` \n- ` references/rest-best-practices.md `\n\n \n\n## Related terms\n\n \n\n- [200 OK](<https://delaparra-services.nl/knowledge-hub/200-ok>) \n- [201 Created](<https://delaparra-services.nl/knowledge-hub/201-created>) \n- [204 No Content](<https://delaparra-services.nl/knowledge-hub/204-no-content>) \n- [206 Partial Content](<https://delaparra-services.nl/knowledge-hub/206-partial-content>) \n- [301 Moved Permanently](<https://delaparra-services.nl/knowledge-hub/301-moved-permanently>) \n- [302 Found](<https://delaparra-services.nl/knowledge-hub/302-found>) \n- [304 Not Modified](<https://delaparra-services.nl/knowledge-hub/304-not-modified>) \n- [400 Bad Request](<https://delaparra-services.nl/knowledge-hub/400-bad-request>) \n- [404 Not Found](<https://delaparra-services.nl/knowledge-hub/404-not-found>) \n- [405 Method Not Allowed](<https://delaparra-services.nl/knowledge-hub/405-method-not-allowed>) \n- [409 Conflict](<https://delaparra-services.nl/knowledge-hub/409-conflict>) \n- [422 Unprocessable Entity](<https://delaparra-services.nl/knowledge-hub/422-unprocessable-entity>) \n- [429 Too Many Requests](<https://delaparra-services.nl/knowledge-hub/429-too-many-requests>) \n- [Access-Control-Allow-Credentials](<https://delaparra-services.nl/knowledge-hub/access-control-allow-credentials>) \n- [Access-Control-Allow-Headers](<https://delaparra-services.nl/knowledge-hub/access-control-allow-headers>) \n- [Access-Control-Allow-Methods](<https://delaparra-services.nl/knowledge-hub/access-control-allow-methods>) \n- [Access-Control-Allow-Origin](<https://delaparra-services.nl/knowledge-hub/access-control-allow-origin>) \n- [Access-Control-Max-Age](<https://delaparra-services.nl/knowledge-hub/access-control-max-age>) \n- [API (Application Programming Interface)](<https://delaparra-services.nl/knowledge-hub/api-application-programming-interface>) \n- [Cache-Control](<https://delaparra-services.nl/knowledge-hub/cache-control>) \n- [Endpoint](<https://delaparra-services.nl/knowledge-hub/endpoint>) \n- [ETag](<https://delaparra-services.nl/knowledge-hub/etag>) \n- [Expires](<https://delaparra-services.nl/knowledge-hub/expires>) \n- [GraphQL](<https://delaparra-services.nl/knowledge-hub/graphql>) \n- [If-Match](<https://delaparra-services.nl/knowledge-hub/if-match>) \n- [If-Modified-Since](<https://delaparra-services.nl/knowledge-hub/if-modified-since>) \n- [If-None-Match](<https://delaparra-services.nl/knowledge-hub/if-none-match>) \n- [JSON (JavaScript Object Notation)](<https://delaparra-services.nl/knowledge-hub/json-javascript-object-notation>) \n- [Last-Modified](<https://delaparra-services.nl/knowledge-hub/last-modified>) \n- [Origin](<https://delaparra-services.nl/knowledge-hub/origin>) \n- [Payload](<https://delaparra-services.nl/knowledge-hub/payload>) \n- [Polling](<https://delaparra-services.nl/knowledge-hub/polling>) \n- [REST (Representational State Transfer)](<https://delaparra-services.nl/knowledge-hub/rest-representational-state-transfer>) \n- [Vary](<https://delaparra-services.nl/knowledge-hub/vary>) \n- [Webhook](<https://delaparra-services.nl/knowledge-hub/webhook>) \n- [WebSocket](<https://delaparra-services.nl/knowledge-hub/websocket>) \n- [YAML (YAML Ain't Markup Language)](<https://delaparra-services.nl/knowledge-hub/yaml-yaml-aint-markup-language>)\n\n \n\n[Installing an agent skill in Claude Code, Codex, Cursor and Copilot](<https://delaparra-services.nl/manuals/een-skill-installeren-in-je-ai-assistent>)\n\n[HTML version](https://delaparra-services.nl/skills/api-design-principles)\n",
    "structured_data": {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "Organization",
                "@id": "https://delaparra-services.nl/#practice",
                "logo": "https://delaparra-services.nl/logo.png",
                "name": "DeLaParra Services",
                "legalName": "DeLaParra Services",
                "url": "https://delaparra-services.nl/",
                "description": "Bespoke software, web applications and mobile apps, developed in Laravel by a single developer in Groningen. Fixed price agreed in advance, full source code provided upon delivery.",
                "email": "info@delaparra-services.nl",
                "address": {
                    "@type": "PostalAddress",
                    "addressLocality": "Groningen",
                    "addressRegion": "Groningen",
                    "addressCountry": "NL"
                },
                "areaServed": "Groningen, the Netherlands",
                "knowsLanguage": [
                    "en",
                    "nl"
                ],
                "knowsAbout": [
                    "Web design and development",
                    "App development",
                    "Custom software and web applications",
                    "OpenSpec",
                    "AI code review",
                    "Your own coding agent"
                ],
                "founder": {
                    "@id": "https://delaparra-services.nl/#person"
                }
            },
            {
                "@type": "WebPage",
                "@id": "https://delaparra-services.nl/skills/api-design-principles#webpage",
                "url": "https://delaparra-services.nl/skills/api-design-principles",
                "name": "API Design Principles | DeLaParra Services",
                "description": "Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use when designing new APIs, reviewing API specifications, or establishing API design standards.",
                "isPartOf": {
                    "@id": "https://delaparra-services.nl/#website"
                },
                "about": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "inLanguage": "en",
                "breadcrumb": {
                    "@id": "https://delaparra-services.nl/skills/api-design-principles#breadcrumb"
                }
            },
            {
                "@type": "BreadcrumbList",
                "@id": "https://delaparra-services.nl/skills/api-design-principles#breadcrumb",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "position": 1,
                        "name": "Home",
                        "item": "https://delaparra-services.nl/"
                    },
                    {
                        "@type": "ListItem",
                        "position": 2,
                        "name": "API Design Principles"
                    }
                ]
            },
            {
                "@type": "Person",
                "@id": "https://delaparra-services.nl/#person",
                "name": "Reinier de la Parra",
                "url": "https://delaparra-services.nl/about"
            },
            {
                "@type": "SoftwareSourceCode",
                "@id": "https://delaparra-services.nl/skills/api-design-principles#skill",
                "url": "https://delaparra-services.nl/skills/api-design-principles",
                "name": "API Design Principles",
                "description": "Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use when designing new APIs, reviewing API specifications, or establishing API design standards.",
                "inLanguage": "en",
                "license": "https://spdx.org/licenses/MIT.html",
                "subjectOf": {
                    "@id": "https://delaparra-services.nl/skills/api-design-principles#dataset"
                }
            },
            {
                "@type": "Dataset",
                "@id": "https://delaparra-services.nl/skills/api-design-principles#dataset",
                "name": "API Design Principles",
                "description": "Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use when designing new APIs, reviewing API specifications, or establishing API design standards.",
                "url": "https://delaparra-services.nl/skills/api-design-principles",
                "identifier": "https://delaparra-services.nl/skills/api-design-principles#dataset",
                "about": {
                    "@id": "https://delaparra-services.nl/skills/api-design-principles#skill"
                },
                "creditText": "wshobson/agents",
                "publisher": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "license": "https://spdx.org/licenses/MIT.html",
                "isAccessibleForFree": true,
                "inLanguage": "en",
                "dateModified": "2026-11-28T14:00:10+00:00",
                "isPartOf": {
                    "@type": "Dataset",
                    "@id": "https://delaparra-services.nl/knowledge-hub#skills",
                    "name": "Skills for AI coding assistants",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "includedInDataCatalog": {
                    "@type": "DataCatalog",
                    "@id": "https://delaparra-services.nl/knowledge-hub#catalog",
                    "name": "Knowledge hub data catalog",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "distribution": [
                    {
                        "@type": "DataDownload",
                        "name": "api-design-principles.csv",
                        "encodingFormat": "text/csv",
                        "contentUrl": "https://delaparra-services.nl/skills/api-design-principles.csv",
                        "inLanguage": "en",
                        "dateModified": "2026-11-28T14:00:10+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "api-design-principles.json",
                        "encodingFormat": "application/json",
                        "contentUrl": "https://delaparra-services.nl/skills/api-design-principles.json",
                        "inLanguage": "en",
                        "dateModified": "2026-11-28T14:00:10+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "api-design-principles.md",
                        "encodingFormat": "text/markdown",
                        "contentUrl": "https://delaparra-services.nl/skills/api-design-principles.md",
                        "inLanguage": "en",
                        "dateModified": "2026-11-28T14:00:10+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "api-design-principles.pdf",
                        "encodingFormat": "application/pdf",
                        "contentUrl": "https://delaparra-services.nl/skills/api-design-principles.pdf",
                        "inLanguage": "en",
                        "dateModified": "2026-11-28T14:00:10+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "api-design-principles.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/skills/api-design-principles.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-28T14:00:10+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "api-design-principles-files.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/skills/api-design-principles/download",
                        "inLanguage": "en",
                        "dateModified": "2026-11-28T14:00:10+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    }
                ]
            }
        ]
    }
}