strapi_rest
Execute REST API calls to Strapi CMS for content management. Read data using populate, filters, and pagination. Write operations (POST, PUT, DELETE) require setting userAuthorized to true after user consent.
Instructions
Execute REST API requests against Strapi endpoints. IMPORTANT: All write operations (POST, PUT, DELETE) require explicit user authorization via the userAuthorized parameter.
Reading Data
params: { populate: ['SEO'] } // Populate a component params: { populate: { SEO: { fields: ['Title', 'seoDescription'] } } } // With field selection params: { filters: { title: { $contains: 'search' } } } // Filter results params: { sort: ['createdAt:desc'] } // Sort results params: { pagination: { page: 1, pageSize: 10 } } // Pagination
Writing Data (REQUIRES userAuthorized: true)
body: { data: { componentName: { Title: 'value' }, // Single component componentName: [{ field: 'value' }] // Repeatable component } }
Debugging Guide
404 Error: Check plural/singular form, use documentId not numeric id
400 Error: Check if data wrapper is present in body
405 Error: Check endpoint format (/articles not /article)
URL Errors: Validate URLs with webtools first
ID Problems: Use documentId for Strapi v5
Strapi v5 Specifics
Use documentId instead of numeric id
Direct attribute access (no nested attributes)
No data wrapper in GET responses
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server | Yes | The name of the server to connect to | |
| endpoint | Yes | The API endpoint (e.g., 'api/articles') | |
| method | No | HTTP method to use | GET |
| params | No | Optional query parameters for GET requests. For components, use populate: ['componentName'] or populate: { componentName: { fields: ['field1'] } } | |
| body | No | Request body for POST/PUT requests. For components, use: { data: { componentName: { field: 'value' } } } for single components or { data: { componentName: [{ field: 'value' }] } } for repeatable components | |
| userAuthorized | No | REQUIRED for POST/PUT/DELETE operations. Client MUST obtain explicit user authorization before setting this to true. |