--- name: api-integrator description: "Designs and documents RESTful/GraphQL APIs and integration workflows. Use for: API design, documentation (OpenAPI/Swagger), and integration troubleshooting." --- # API Integrator This skill focuses on the seamless connection between different software systems. It covers API design best practices, documentation standards, and integration strategies. ## API Design Standards ### 1. RESTful Best Practices - **Nouns not Verbs**: Use `/users` instead of `/getUsers`. - **HTTP Methods**: Proper use of GET, POST, PUT, PATCH, DELETE. - **Status Codes**: Correct usage of 2xx (Success), 4xx (Client Error), and 5xx (Server Error). - **Versioning**: Using path-based (e.g., `/v1/`) or header-based versioning. ### 2. Documentation Standards - **OpenAPI (Swagger)**: Using YAML/JSON to define endpoints, schemas, and security. - **Authentication**: Clear instructions for API Keys, OAuth2, or JWT. - **Rate Limiting**: Documenting limits and retry strategies (Exponential Backoff). ## Integration Patterns | Pattern | Description | Use Case | | :--- | :--- | :--- | | **Webhooks** | Event-driven notifications sent via HTTP POST. | Real-time updates (e.g., Stripe payments). | | **Polling** | Client periodically checks the server for updates. | When webhooks are not available. | | **Batch Processing** | Transferring large amounts of data in a single request. | Data synchronization or migrations. | ## Recommended Workflow 1. **Endpoint Mapping**: Identify the required data and actions for the integration. 2. **Schema Definition**: Define the request and response objects. 3. **Security Planning**: Determine the authentication and authorization mechanism. 4. **Documentation**: Generate clear, interactive documentation for the API.