scripts
table, associated with a specific folder and the authenticated user. This endpoint requires at least a ‘Basic’ plan.
Authentication & Authorization
This endpoint requires authentication via bearer token representing a valid user session managed by Supabase Auth (cookies).Plan Restriction: Access is restricted to users with a ‘Basic’ or ‘Pro’ plan. Users on the ‘Free’ plan will receive a 403 Forbidden error.Testing Note: Requires user session and paid plan.
Request
Bearer token for authentication. Format:
Bearer YOUR_JWT_TOKEN
The name of the script.
The content/body of the script.
The ID of the folder where the script should be placed.
Response
HTTP status code (e.g., 200).
A descriptive message about the result (e.g., “Script created successfully”).
The created script data object from the
scripts
table.Error Codes
Status Code | Description | Example Message |
---|---|---|
400 | Missing required fields (name , text , folder_id ). | ”Missing required fields” |
401 | Invalid or missing authentication token. | ”Unauthorized” |
403 | User is on the ‘Free’ plan. | ”Please upgrade your plan to access this feature.” |
500 | Internal server error during processing. | ”Failed to create script” |
500 | Database error during insert. | Specific DB error |
Notes
- Creates a new script entry associated with the authenticated user.
- Requires the user to be on a paid plan (‘Basic’ or ‘Pro’).
- Assumes a
scripts
table exists.
Code Examples
Headers
Bearer token for authentication (JWT)
Body
application/json