-
Notifications
You must be signed in to change notification settings - Fork 2
docs: enhance task creation authentication details #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,7 +78,15 @@ | |
| } | ||
| }, | ||
| "post": { | ||
| "description": "Create a new scheduled task. All fields are required. The response shape matches the GET endpoint (an array containing the created task).", | ||
| "description": "Create a new scheduled task. Authentication is required. The effective account identity must be derived from credentials on the server; client-provided account_id must not be blindly trusted. If account_id is provided and is not within the caller's authorized scope, return 403 Forbidden. The response shape matches the GET endpoint (an array containing the created task).", | ||
| "security": [ | ||
| { | ||
| "apiKeyAuth": [] | ||
| }, | ||
| { | ||
| "bearerAuth": [] | ||
| } | ||
| ], | ||
|
Comment on lines
+81
to
+89
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep the POST Line 81 says 🛠️ Suggested contract alignment- "description": "Create a new scheduled task. Authentication is required. The effective account identity must be derived from credentials on the server; client-provided account_id must not be blindly trusted. If account_id is provided and is not within the caller's authorized scope, return 403 Forbidden. The response shape matches the GET endpoint (an array containing the created task).",
+ "description": "Create a new scheduled task. Authentication is required. The server must derive the caller identity from credentials and authorize any provided account_id override. If an account_id outside the caller's authorized scope is supplied, return 403 Forbidden. The response shape matches the GET endpoint (`TasksResponse`, with the created task in the `tasks` array).",
...
"CreateTaskRequest": {
"type": "object",
"required": [
"title",
"prompt",
"schedule",
- "account_id",
"artist_account_id"
],
"properties": {
"account_id": {
"type": "string",
"format": "uuid",
- "description": "UUID of the associated account",
+ "description": "Optional UUID of the target account. If omitted, the server derives it from the authenticated credentials. If provided, it must be within the caller's authorized scope.",🤖 Prompt for AI Agents |
||
| "requestBody": { | ||
| "description": "Task to create", | ||
| "required": true, | ||
|
|
@@ -102,7 +110,37 @@ | |
| } | ||
| }, | ||
| "400": { | ||
| "description": "Bad request", | ||
| "description": "Bad request - missing required fields or invalid body", | ||
| "content": { | ||
| "application/json": { | ||
| "schema": { | ||
| "$ref": "#/components/schemas/Error" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "401": { | ||
| "description": "Unauthorized - missing or invalid credentials", | ||
| "content": { | ||
| "application/json": { | ||
| "schema": { | ||
| "$ref": "#/components/schemas/Error" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "403": { | ||
| "description": "Forbidden - account_id is outside caller authorization scope", | ||
| "content": { | ||
| "application/json": { | ||
| "schema": { | ||
| "$ref": "#/components/schemas/Error" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "500": { | ||
| "description": "Internal server error", | ||
| "content": { | ||
| "application/json": { | ||
| "schema": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,3 +2,9 @@ | |||||||||||||||||||
| title: 'Create Task' | ||||||||||||||||||||
| openapi: 'POST /api/tasks' | ||||||||||||||||||||
| --- | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Creates a scheduled task. | ||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Keep API reference MDX pages frontmatter-only; move this endpoint text into Prompt for AI agents |
||||||||||||||||||||
|
|
||||||||||||||||||||
| Authentication is required (`x-api-key` or `Authorization: Bearer <token>`). The server must resolve the effective account identity from auth context; do not treat client-provided `account_id` as ownership proof. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| If `account_id` is provided and is outside the caller's authorized scope, the API returns `403`. | ||||||||||||||||||||
|
Comment on lines
+6
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep API reference pages frontmatter-only. This body content should not be in Suggested minimal change ---
title: 'Create Task'
openapi: 'POST /api/tasks'
---
-
-Creates a scheduled task.
-
-Authentication is required (`x-api-key` or `Authorization: Bearer <token>`). The server must resolve the effective account identity from auth context; do not treat client-provided `account_id` as ownership proof.
-
-If `account_id` is provided and is outside the caller's authorized scope, the API returns `403`.As per coding guidelines, 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: The description says "If account_id is provided…" implying it's optional, but
CreateTaskRequeststill listsaccount_idin therequiredarray. This inconsistency will cause generated SDKs and docs to contradict each other. Either removeaccount_idfromrequired(and update its property description to say it's optional/server-derived), or reword this description to reflect that it is always required.Also, "an array containing the created task" is inaccurate —
TasksResponseis an object with atasksarray, not a bare array. Consider:The response shape matches the GET endpoint (TasksResponse, with the created task in the tasks array).Prompt for AI agents