diff --git a/.redocly.lint-ignore.yaml b/.redocly.lint-ignore.yaml new file mode 100644 index 0000000..827bfe1 --- /dev/null +++ b/.redocly.lint-ignore.yaml @@ -0,0 +1,6 @@ +# This file instructs Redocly's linter to ignore the rules contained for specific parts of your API. +# See https://redocly.com/docs/cli/ for more information. +dist/oas.yaml: + operation-4xx-response: + - '#/paths/~1server~1ping/get/responses' + - '#/paths/~1server~1health/get/responses' diff --git a/openapi/components/parameters.yaml b/openapi/components/parameters.yaml index bbde743..6fe539c 100644 --- a/openapi/components/parameters.yaml +++ b/openapi/components/parameters.yaml @@ -103,8 +103,7 @@ Export: - yaml Version: name: version - description: >- - Retrieve an item's state from a specific Content Version. The value corresponds to the "key" of the Content Version. + description: Retrieve an item's state from a specific Content Version. The value corresponds to the "key" of the Content Version. in: query required: false schema: @@ -118,11 +117,148 @@ ConcurrentIndexCreation: type: boolean default: false Backlink: - name: backlink description: >- Retrieve relational items excluding reverse relations when using wildcard fields. + name: backlink in: query required: false schema: type: boolean default: true +Aggregate: + description: >- + Aggregate functions allow you to perform calculations on a set of values. Accepts one or more of `count`, `countDistinct`, `countAll`, `sum`, `sumDistinct`, `avg`, `avgDistinct`, `min`, `max`. + name: aggregate + in: query + required: false + content: + application/json: + schema: + type: object + properties: + count: + type: array + items: + type: string + description: Count the number of items. Use `['*']` to count all items. + countDistinct: + type: array + items: + type: string + description: Count the number of unique values in the specified fields. + countAll: + type: array + items: + type: string + description: Count all items including related items (used with groupBy). + sum: + type: array + items: + type: string + description: Sum the values of the specified fields. + sumDistinct: + type: array + items: + type: string + description: Sum the unique values of the specified fields. + avg: + type: array + items: + type: string + description: Calculate the average of the specified fields. + avgDistinct: + type: array + items: + type: string + description: Calculate the average of unique values in the specified fields. + min: + type: array + items: + type: string + description: Find the minimum value of the specified fields. + max: + type: array + items: + type: string + description: Find the maximum value of the specified fields. + example: + count: ['*'] + sum: ['price'] + avg: ['rating'] +Deep: + description: Deep allows you to set any of the other query parameters on a nested relational dataset. Use underscore-prefixed parameter names. + name: deep + in: query + required: false + content: + application/json: + schema: + type: object + additionalProperties: + type: object + description: Query parameters for the related field (prefixed with underscore). + properties: + _fields: + type: array + items: + type: string + _sort: + type: array + items: + type: string + _filter: + type: object + _limit: + type: integer + _offset: + type: integer + _page: + type: integer + _search: + type: string + _group: + type: array + items: + type: string + _aggregate: + type: object + example: + related_articles: + _limit: 3 + _sort: ['-date_created'] + _filter: + status: + _eq: 'published' +Alias: + description: Alias allows you to rename fields in the response payload. The key is the new name, the value is the original field name. + name: alias + in: query + required: false + content: + application/json: + schema: + type: object + additionalProperties: + type: string + example: + display_name: full_name + creation_date: date_created +Group: + description: >- + Grouping allows for running the aggregation functions based on a shared value. Accepts an array of field names. + name: group + in: query + required: false + explode: false + schema: + type: array + items: + type: string +VersionRaw: + description: Retrieve the raw delta of a Content Version item instead of the full merged item. + name: versionRaw + in: query + required: false + schema: + type: boolean + default: false diff --git a/openapi/components/responses.yaml b/openapi/components/responses.yaml index 1d6d39e..08d0845 100644 --- a/openapi/components/responses.yaml +++ b/openapi/components/responses.yaml @@ -1,3 +1,33 @@ +BadRequestError: + description: "Error: Bad request." + content: + application/json: + schema: + type: object + properties: + error: + type: object + properties: + code: + type: integer + format: int64 + message: + type: string +ForbiddenError: + description: "Error: Forbidden." + content: + application/json: + schema: + type: object + properties: + error: + type: object + properties: + code: + type: integer + format: int64 + message: + type: string NotFoundError: description: "Error: Not found." content: diff --git a/openapi/components/schemas/_index.yaml b/openapi/components/schemas/_index.yaml index 2fdade0..999350f 100644 --- a/openapi/components/schemas/_index.yaml +++ b/openapi/components/schemas/_index.yaml @@ -1,5 +1,7 @@ x-metadata: $ref: x-metadata.yaml +Access: + $ref: access.yaml Activity: $ref: activity.yaml Collections: @@ -8,6 +10,8 @@ Comments: $ref: comments.yaml Dashboards: $ref: dashboards.yaml +Deployments: + $ref: deployments.yaml Diff: $ref: diff.yaml Extensions: @@ -22,6 +26,10 @@ Folders: $ref: folders.yaml Items: $ref: items.yaml +JsonRpcRequest: + $ref: jsonrpc-request.yaml +JsonRpcResponse: + $ref: jsonrpc-response.yaml Notifications: $ref: notifications.yaml Operations: diff --git a/openapi/components/schemas/access.yaml b/openapi/components/schemas/access.yaml new file mode 100644 index 0000000..f795513 --- /dev/null +++ b/openapi/components/schemas/access.yaml @@ -0,0 +1,38 @@ +type: object +properties: + id: + description: Primary key of the access rule. + example: 8cbb43fe-4cdf-4991-8352-c461779cec02 + type: string + format: uuid + role: + description: The role this access rule applies to. Nullable if the rule applies directly to a user. Many-to-one to roles. + example: 8b4474c0-288d-4bb8-b62e-8330646bb6aa + nullable: true + type: string + oneOf: + - type: string + format: uuid + - $ref: roles.yaml + user: + description: The user this access rule applies to. Nullable if the rule applies to a role. Many-to-one to users. + example: 0bc7b36a-9ba9-4ce0-83f0-0a526f354e07 + nullable: true + type: string + oneOf: + - type: string + format: uuid + - $ref: users.yaml + policy: + description: The policy associated with this access rule. Many-to-one to policies. + example: 22640672-eef0-4ee9-ab04-591f3afb2886 + oneOf: + - type: string + format: uuid + - $ref: policies.yaml + sort: + description: Sort order of this access rule. + example: 1 + nullable: true + type: integer +x-collection: directus_access diff --git a/openapi/components/schemas/deployments.yaml b/openapi/components/schemas/deployments.yaml new file mode 100644 index 0000000..db86ef8 --- /dev/null +++ b/openapi/components/schemas/deployments.yaml @@ -0,0 +1,45 @@ +type: object +properties: + id: + description: Unique identifier for the deployment configuration. + example: 8cbb43fe-4cdf-4991-8352-c461779cec02 + type: string + format: uuid + provider: + description: The deployment provider. One of `vercel` or `netlify`. + example: vercel + type: string + enum: + - vercel + - netlify + credentials: + description: Provider-specific credentials (e.g. API token). Stored encrypted. + type: object + example: + token: abc123 + options: + description: Provider-specific configuration options. + nullable: true + type: object + example: + team_id: team_abc123 + webhook_ids: + description: IDs of webhooks registered with the provider for this config. + nullable: true + type: array + items: + type: string + webhook_secret: + description: Secret used to verify webhook payloads from the provider. + nullable: true + type: string + last_synced_at: + description: Timestamp of the last provider sync. + nullable: true + type: string + format: date-time + date_created: + description: When this deployment config was created. + type: string + format: date-time +x-collection: directus_deployments diff --git a/openapi/components/schemas/jsonrpc-request.yaml b/openapi/components/schemas/jsonrpc-request.yaml new file mode 100644 index 0000000..a07ef93 --- /dev/null +++ b/openapi/components/schemas/jsonrpc-request.yaml @@ -0,0 +1,23 @@ +type: object +description: A JSON-RPC 2.0 request or notification message. +required: + - jsonrpc + - method +properties: + jsonrpc: + description: JSON-RPC protocol version. Must be `"2.0"`. + type: string + enum: + - '2.0' + id: + description: >- + Request identifier. May be a string, integer, or null; omit for notifications. + oneOf: + - type: string + - type: integer + method: + description: MCP method name (e.g. `tools/list`, `tools/call`, `prompts/list`, `prompts/get`, `notifications/initialized`). + type: string + params: + description: Method-specific parameters. + type: object diff --git a/openapi/components/schemas/jsonrpc-response.yaml b/openapi/components/schemas/jsonrpc-response.yaml new file mode 100644 index 0000000..2ce3bd4 --- /dev/null +++ b/openapi/components/schemas/jsonrpc-response.yaml @@ -0,0 +1,28 @@ +type: object +description: A JSON-RPC 2.0 response message. +required: + - jsonrpc +properties: + jsonrpc: + description: JSON-RPC protocol version. Always `"2.0"`. + type: string + enum: + - '2.0' + id: + description: Echoes the `id` from the corresponding request. + oneOf: + - type: string + - type: integer + result: + description: Method-specific result. Present on success. + type: object + error: + description: Error details. Present on failure. + type: object + properties: + code: + type: integer + message: + type: string + data: + type: object diff --git a/openapi/components/schemas/settings.yaml b/openapi/components/schemas/settings.yaml index 4df48ca..03072ba 100644 --- a/openapi/components/schemas/settings.yaml +++ b/openapi/components/schemas/settings.yaml @@ -227,4 +227,85 @@ properties: description: Link to the feature request page. nullable: true type: string + ai_openai_api_key: + description: OpenAI API key used for AI features. Stored hashed. + nullable: true + type: string + ai_openai_allowed_models: + description: List of OpenAI model IDs permitted for use in the AI assistant. + nullable: true + type: array + items: + type: string + ai_anthropic_api_key: + description: Anthropic API key used for AI features. Stored hashed. + nullable: true + type: string + ai_anthropic_allowed_models: + description: List of Anthropic model IDs permitted for use in the AI assistant. + nullable: true + type: array + items: + type: string + ai_google_api_key: + description: Google AI API key used for AI features. Stored hashed. + nullable: true + type: string + ai_google_allowed_models: + description: List of Google model IDs permitted for use in the AI assistant. + nullable: true + type: array + items: + type: string + ai_system_prompt: + description: Custom system prompt prepended to all AI assistant conversations. + nullable: true + type: string + ai_openai_compatible_name: + description: Display name for a custom OpenAI-compatible provider. + nullable: true + type: string + ai_openai_compatible_base_url: + description: Base URL for a custom OpenAI-compatible API endpoint. + nullable: true + type: string + ai_openai_compatible_api_key: + description: API key for the custom OpenAI-compatible provider. Stored hashed. + nullable: true + type: string + ai_openai_compatible_headers: + description: Additional HTTP headers to include when calling the custom OpenAI-compatible provider. + nullable: true + type: array + items: + type: object + ai_openai_compatible_models: + description: List of model definitions available from the custom OpenAI-compatible provider. + nullable: true + type: array + items: + type: object + properties: + name: + type: string + mcp_enabled: + description: Whether the MCP (Model Context Protocol) endpoint is enabled. + nullable: true + type: boolean + mcp_allow_deletes: + description: Whether MCP clients are permitted to perform delete operations. + nullable: true + type: boolean + mcp_prompts_collection: + description: Collection used to store MCP prompt definitions. + nullable: true + type: string + mcp_system_prompt_enabled: + description: Whether the custom MCP system prompt is enabled. + nullable: true + type: boolean + mcp_system_prompt: + description: Custom system prompt injected into MCP sessions. + nullable: true + type: string x-collection: directus_settings diff --git a/openapi/index.yaml b/openapi/index.yaml index 50d1b15..6500a99 100644 --- a/openapi/index.yaml +++ b/openapi/index.yaml @@ -2,7 +2,7 @@ openapi: '3.0.1' info: title: Directus API Reference description: This is a dynamically generated API specification for all endpoints existing on the current project! - version: '11.1.0' + version: '11.17.3' license: name: Business Source License 1.1 (BUSL-1.1) url: https://github.com/directus/directus/blob/main/license @@ -11,19 +11,35 @@ servers: description: Your current Directus project. paths: + "/ai/chat": + $ref: paths/ai/chat/index.yaml + "/ai/object": + $ref: paths/ai/object/index.yaml + "/ai/files": + $ref: paths/ai/files/index.yaml + "/access": + $ref: paths/access/index.yaml + "/access‎": + $ref: paths/access/singular/index.yaml + "/access/{id}": + $ref: paths/access/_id/index.yaml "/activity": $ref: paths/activity/index.yaml "/activity/{id}": $ref: paths/activity/_id/index.yaml + "/assets/files": + $ref: paths/assets/files/index.yaml + "/assets/folder/{id}": + $ref: paths/assets/folder/_id/index.yaml "/assets/{id}": $ref: paths/assets/_id/index.yaml "/auth/login": $ref: paths/auth/login/index.yaml "/auth/logout": $ref: paths/auth/logout/index.yaml - "/auth/oauth": + "/auth": $ref: paths/auth/oauth/index.yaml - "/auth/oauth/{provider}": + "/auth/login/{provider}": $ref: paths/auth/oauth/_provider/index.yaml "/auth/password/request": $ref: paths/auth/password/request/index.yaml @@ -43,16 +59,44 @@ paths: $ref: paths/comments/_id/index.yaml "/dashboards": $ref: paths/dashboards/index.yaml + "/deployments": + $ref: paths/deployments/index.yaml + "/deployments/{provider}": + $ref: paths/deployments/_provider/index.yaml + "/deployments/{provider}/dashboard": + $ref: paths/deployments/_provider/dashboard/index.yaml + "/deployments/{provider}/projects": + $ref: paths/deployments/_provider/projects/index.yaml + "/deployments/{provider}/projects/{id}": + $ref: paths/deployments/_provider/projects/_id/index.yaml + "/deployments/{provider}/projects/{id}/deploy": + $ref: paths/deployments/_provider/projects/_id/deploy/index.yaml + "/deployments/{provider}/projects/{id}/runs": + $ref: paths/deployments/_provider/projects/_id/runs/index.yaml + "/deployments/{provider}/projects/{id}/runs/stats": + $ref: paths/deployments/_provider/projects/_id/runs/stats/index.yaml + "/deployments/{provider}/runs/{id}": + $ref: paths/deployments/_provider/runs/_id/index.yaml + "/deployments/{provider}/runs/{id}/cancel": + $ref: paths/deployments/_provider/runs/_id/cancel/index.yaml + "/deployments/webhooks/{provider}‎": + $ref: paths/deployments/webhooks/_provider/index.yaml "/dashboards‎": $ref: paths/dashboards/singular/index.yaml "/dashboards/{id}": $ref: paths/dashboards/_id/index.yaml "/extensions": $ref: paths/extensions/index.yaml - "/extensions/{bundle}/{name}": - $ref: paths/extensions/_bundle/_name/index.yaml - "/extensions/{name}": - $ref: paths/extensions/_name/index.yaml + "/extensions/{id}": + $ref: paths/extensions/_id/index.yaml + "/extensions/registry": + $ref: paths/extensions/registry/index.yaml + "/extensions/registry/install": + $ref: paths/extensions/registry/install/index.yaml + "/extensions/registry/reinstall": + $ref: paths/extensions/registry/reinstall/index.yaml + "/extensions/registry/uninstall/{id}": + $ref: paths/extensions/registry/uninstall/_id/index.yaml "/fields": $ref: paths/fields/index.yaml "/fields/{collection}": @@ -63,6 +107,10 @@ paths: $ref: paths/files/index.yaml "/files/import": $ref: paths/files/import/index.yaml + "/files/tus": + $ref: paths/files/tus/index.yaml + "/files/tus/{id}": + $ref: paths/files/tus/_id/index.yaml "/files/{id}": $ref: paths/files/_id/index.yaml "/flows": @@ -83,10 +131,12 @@ paths: $ref: paths/items/_collection/index.yaml "/items/{collection}‎": $ref: paths/items/_collection/singular/index.yaml - "/items/{collection}/singleton": - $ref: paths/items/_collection/singleton/index.yaml "/items/{collection}/{id}": $ref: paths/items/_collection/_id/index.yaml + "/items/{collection}‏": + $ref: paths/items/_collection/singleton/index.yaml + "/mcp": + $ref: paths/mcp/index.yaml "/metrics": $ref: paths/metrics/index.yaml "/notifications": @@ -217,6 +267,10 @@ paths: $ref: paths/utils/random/string/index.yaml "/utils/sort/{collection}": $ref: paths/utils/sort/_collection/index.yaml + "/utils/revert/{revision}": + $ref: paths/utils/revert/_revision/index.yaml + "/utils/translations/generate": + $ref: paths/utils/translations/generate/index.yaml "/versions": $ref: paths/versions/index.yaml "/versions‎": @@ -240,6 +294,13 @@ components: $ref: components/schemas/_index.yaml security: [] tags: + - name: AI + description: >- + AI endpoints provide access to language model capabilities including chat, structured object extraction, + and file uploads for multimodal models. All endpoints require `AI_ENABLED=true` and app-level authentication. + - name: Access + description: Access rules define which policies are assigned to a role or user. They are the junction between policies and the roles or users they apply to. + x-collection: directus_access - name: Activity description: All events that happen within Directus are tracked and stored in the activities collection. This gives you full accountability over everything that happens. x-collection: directus_activity @@ -255,6 +316,9 @@ tags: x-collection: directus_comments - name: Dashboards description: Dashboards within the Insights module organize different Panels into an at-a-glance view. They can be used to group data based on department, objective, business process or anything you choose. + - name: Deployments + description: Manage deployment provider configurations (Vercel, Netlify) and trigger deployments directly from Directus. Requires the deployment provider to be configured with valid credentials. + x-collection: directus_deployments - name: Extensions description: Directus can easily be extended through the addition of several types of extensions, including layouts, interfaces, and modules. x-collection: directus_extensions @@ -273,6 +337,10 @@ tags: - name: Items description: Items are individual pieces of data in your database. They can be anything, from articles, to IoT status checks. x-collection: directus_items + - name: MCP + description: >- + The Model Context Protocol (MCP) endpoint exposes Directus data and tools to AI assistants via JSON-RPC 2.0 over HTTP. + Requires both `MCP_ENABLED=true` and `mcp_enabled: true` in project settings. - name: Metrics description: To enable performance and error measurement of connected services, Directus can provide Prometheus metrics. - name: Operations diff --git a/openapi/paths/access/_id/deleteAccessRule.yaml b/openapi/paths/access/_id/deleteAccessRule.yaml new file mode 100644 index 0000000..1f6f2f7 --- /dev/null +++ b/openapi/paths/access/_id/deleteAccessRule.yaml @@ -0,0 +1,24 @@ +summary: Delete an Access Rule +description: Delete an existing access rule. +operationId: deleteAccessRule +responses: + '204': + description: The resource was deleted successfully. + '401': + $ref: ../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Access +parameters: +- $ref: ../../../components/parameters.yaml#/UUId +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/access/_id/getAccessRule.yaml b/openapi/paths/access/_id/getAccessRule.yaml new file mode 100644 index 0000000..fa657ef --- /dev/null +++ b/openapi/paths/access/_id/getAccessRule.yaml @@ -0,0 +1,33 @@ +summary: Retrieve an Access Rule +description: Retrieve a single access rule by unique identifier. +operationId: getAccessRule +parameters: +- $ref: ../../../components/parameters.yaml#/UUId +- $ref: ../../../components/parameters.yaml#/Fields +- $ref: ../../../components/parameters.yaml#/Meta +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + $ref: ../../../components/schemas/access.yaml + '401': + $ref: ../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Access +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/access/_id/index.yaml b/openapi/paths/access/_id/index.yaml new file mode 100644 index 0000000..0a16373 --- /dev/null +++ b/openapi/paths/access/_id/index.yaml @@ -0,0 +1,6 @@ +get: + $ref: getAccessRule.yaml +patch: + $ref: updateAccessRule.yaml +delete: + $ref: deleteAccessRule.yaml diff --git a/openapi/paths/access/_id/updateAccessRule.yaml b/openapi/paths/access/_id/updateAccessRule.yaml new file mode 100644 index 0000000..1254b3e --- /dev/null +++ b/openapi/paths/access/_id/updateAccessRule.yaml @@ -0,0 +1,57 @@ +summary: Update an Access Rule +description: Update an existing access rule. +operationId: updateAccessRule +parameters: +- $ref: ../../../components/parameters.yaml#/UUId +- $ref: ../../../components/parameters.yaml#/Fields +- $ref: ../../../components/parameters.yaml#/Meta +requestBody: + content: + application/json: + schema: + type: object + properties: + role: + type: string + format: uuid + nullable: true + description: The role this access rule applies to. + user: + type: string + format: uuid + nullable: true + description: The user this access rule applies to. + policy: + type: string + format: uuid + description: The policy associated with this access rule. + sort: + type: integer + nullable: true + description: Sort order of this access rule. +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + $ref: ../../../components/schemas/access.yaml + '401': + $ref: ../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Access +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/access/createAccessRules.yaml b/openapi/paths/access/createAccessRules.yaml new file mode 100644 index 0000000..aa96535 --- /dev/null +++ b/openapi/paths/access/createAccessRules.yaml @@ -0,0 +1,51 @@ +summary: Create Multiple Access Rules +description: Create multiple new access rules. +operationId: createAccessRules +parameters: +- $ref: ../../components/parameters.yaml#/Fields +- $ref: ../../components/parameters.yaml#/Limit +- $ref: ../../components/parameters.yaml#/Meta +- $ref: ../../components/parameters.yaml#/Offset +- $ref: ../../components/parameters.yaml#/Sort +- $ref: ../../components/parameters.yaml#/Filter +- $ref: ../../components/parameters.yaml#/Search +requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: ../../components/schemas/access.yaml +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: ../../components/schemas/access.yaml + meta: + $ref: ../../components/schemas/x-metadata.yaml + '401': + $ref: ../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Access +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/access/deleteAccessRules.yaml b/openapi/paths/access/deleteAccessRules.yaml new file mode 100644 index 0000000..7b61dd6 --- /dev/null +++ b/openapi/paths/access/deleteAccessRules.yaml @@ -0,0 +1,28 @@ +summary: Delete Multiple Access Rules +description: Delete multiple existing access rules. +operationId: deleteAccessRules +requestBody: + description: An array of access rule primary keys. + content: + application/json: + schema: + type: array + items: + type: string +responses: + '204': + description: The resource was deleted successfully. + '401': + $ref: ../../components/responses.yaml#/UnauthorizedError +security: [] +tags: +- Access +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/access/getAccessRules.yaml b/openapi/paths/access/getAccessRules.yaml new file mode 100644 index 0000000..da9de18 --- /dev/null +++ b/openapi/paths/access/getAccessRules.yaml @@ -0,0 +1,42 @@ +summary: List Access Rules +description: List all access rules that exist in Directus. +operationId: getAccessRules +parameters: +- $ref: ../../components/parameters.yaml#/Fields +- $ref: ../../components/parameters.yaml#/Limit +- $ref: ../../components/parameters.yaml#/Offset +- $ref: ../../components/parameters.yaml#/Meta +- $ref: ../../components/parameters.yaml#/Sort +- $ref: ../../components/parameters.yaml#/Filter +- $ref: ../../components/parameters.yaml#/Search +- $ref: ../../components/parameters.yaml#/Page +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: ../../components/schemas/access.yaml + meta: + $ref: ../../components/schemas/x-metadata.yaml + '401': + $ref: ../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Access +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/access/index.yaml b/openapi/paths/access/index.yaml new file mode 100644 index 0000000..ac57c3b --- /dev/null +++ b/openapi/paths/access/index.yaml @@ -0,0 +1,8 @@ +get: + $ref: getAccessRules.yaml +post: + $ref: createAccessRules.yaml +patch: + $ref: updateAccessRules.yaml +delete: + $ref: deleteAccessRules.yaml diff --git a/openapi/paths/access/singular/createAccessRule.yaml b/openapi/paths/access/singular/createAccessRule.yaml new file mode 100644 index 0000000..040947b --- /dev/null +++ b/openapi/paths/access/singular/createAccessRule.yaml @@ -0,0 +1,55 @@ +summary: Create an Access Rule +description: Create a new access rule. +operationId: createAccessRule +parameters: +- $ref: ../../../components/parameters.yaml#/Fields +- $ref: ../../../components/parameters.yaml#/Meta +requestBody: + content: + application/json: + schema: + type: object + properties: + role: + type: string + format: uuid + nullable: true + description: The role this access rule applies to. + user: + type: string + format: uuid + nullable: true + description: The user this access rule applies to. + policy: + type: string + format: uuid + description: The policy associated with this access rule. + sort: + type: integer + nullable: true + description: Sort order of this access rule. +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + $ref: ../../../components/schemas/access.yaml + '401': + $ref: ../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../components/responses.yaml#/NotFoundError +tags: +- Access +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/access/singular/index.yaml b/openapi/paths/access/singular/index.yaml new file mode 100644 index 0000000..2f10679 --- /dev/null +++ b/openapi/paths/access/singular/index.yaml @@ -0,0 +1,2 @@ +post: + $ref: createAccessRule.yaml diff --git a/openapi/paths/access/updateAccessRules.yaml b/openapi/paths/access/updateAccessRules.yaml new file mode 100644 index 0000000..ca1b0d9 --- /dev/null +++ b/openapi/paths/access/updateAccessRules.yaml @@ -0,0 +1,73 @@ +summary: Update Multiple Access Rules +description: Update multiple access rules at the same time. +security: [] +tags: +- Access +operationId: updateAccessRules +parameters: +- $ref: ../../components/parameters.yaml#/Fields +- $ref: ../../components/parameters.yaml#/Limit +- $ref: ../../components/parameters.yaml#/Meta +- $ref: ../../components/parameters.yaml#/Offset +- $ref: ../../components/parameters.yaml#/Sort +- $ref: ../../components/parameters.yaml#/Filter +- $ref: ../../components/parameters.yaml#/Search +requestBody: + content: + application/json: + schema: + type: object + required: + - keys + - data + properties: + keys: + type: array + items: + type: string + data: + type: object + properties: + role: + type: string + format: uuid + nullable: true + description: The role this access rule applies to. + user: + type: string + format: uuid + nullable: true + description: The user this access rule applies to. + policy: + type: string + format: uuid + description: The policy associated with this access rule. + sort: + type: integer + nullable: true + description: Sort order of this access rule. +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: ../../components/schemas/access.yaml + meta: + $ref: ../../components/schemas/x-metadata.yaml + '401': + $ref: ../../components/responses.yaml#/UnauthorizedError +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/ai/chat/aiChat.yaml b/openapi/paths/ai/chat/aiChat.yaml new file mode 100644 index 0000000..722f98b --- /dev/null +++ b/openapi/paths/ai/chat/aiChat.yaml @@ -0,0 +1,109 @@ +summary: AI Chat +description: >- + Send messages to an AI language model and receive a streamed response. + Requires `AI_ENABLED=true` and app-level authentication. + Streamed as Server-Sent Events. +operationId: aiChat +requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - provider + - model + - messages + - tools + properties: + provider: + description: AI provider to use. + type: string + enum: + - openai + - anthropic + - google + - openai-compatible + model: + description: Model ID for the selected provider. + type: string + messages: + description: Conversation history. Must contain at least one message. + type: array + items: + type: object + tools: + description: >- + List of tools available to the model. + Each entry is either a built-in tool name string or a custom tool definition object. + type: array + items: + oneOf: + - type: string + - type: object + required: + - name + - description + - inputSchema + properties: + name: + type: string + description: + type: string + inputSchema: + type: object + description: JSON Schema 7 definition for the tool input. + toolApprovals: + description: Per-tool approval mode. + type: object + additionalProperties: + type: string + enum: + - always + - ask + - disabled + context: + description: Contextual information for the session. + type: object + properties: + attachments: + description: Up to 10 context attachments (items, visual elements, or prompts). + type: array + maxItems: 10 + items: + type: object + page: + description: Current page context from the Data Studio. + type: object + properties: + path: + type: string + collection: + type: string + item: + oneOf: + - type: string + - type: integer + module: + type: string +responses: + '200': + description: Successful request + content: + text/event-stream: + schema: + type: string + '403': + $ref: ../../../components/responses.yaml#/UnauthorizedError +security: [] +tags: + - AI +x-codeSamples: + - label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK + - label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/ai/chat/index.yaml b/openapi/paths/ai/chat/index.yaml new file mode 100644 index 0000000..fd39d2e --- /dev/null +++ b/openapi/paths/ai/chat/index.yaml @@ -0,0 +1,2 @@ +post: + $ref: aiChat.yaml diff --git a/openapi/paths/ai/files/aiFileUpload.yaml b/openapi/paths/ai/files/aiFileUpload.yaml new file mode 100644 index 0000000..1b0e55e --- /dev/null +++ b/openapi/paths/ai/files/aiFileUpload.yaml @@ -0,0 +1,52 @@ +summary: Upload File for AI +description: >- + Upload a file to an AI provider for use in subsequent AI requests. + Requires `AI_ENABLED=true` and app-level authentication. + Supported providers are `openai`, `anthropic`, and `google`. Maximum file size is 50 MB. +operationId: aiFileUpload +requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + required: + - file + - provider + properties: + file: + description: The file to upload. + type: string + format: binary + provider: + description: Provider to upload the file to. + type: string + enum: + - openai + - anthropic + - google +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + type: object + description: Provider-specific file reference returned after upload. + '403': + $ref: ../../../components/responses.yaml#/UnauthorizedError +security: [] +tags: + - AI +x-codeSamples: + - label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK + - label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/ai/files/index.yaml b/openapi/paths/ai/files/index.yaml new file mode 100644 index 0000000..42a54c3 --- /dev/null +++ b/openapi/paths/ai/files/index.yaml @@ -0,0 +1,2 @@ +post: + $ref: aiFileUpload.yaml diff --git a/openapi/paths/ai/object/aiObject.yaml b/openapi/paths/ai/object/aiObject.yaml new file mode 100644 index 0000000..e67c9e4 --- /dev/null +++ b/openapi/paths/ai/object/aiObject.yaml @@ -0,0 +1,60 @@ +summary: AI Object Extraction +description: >- + Generate a structured object from a prompt using an AI language model. + Requires `AI_ENABLED=true` and app-level authentication. + Streams a JSON object matching the provided output schema. +operationId: aiObject +requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - provider + - model + - prompt + - outputSchema + properties: + provider: + description: AI provider to use. + type: string + enum: + - openai + - anthropic + - google + - openai-compatible + model: + description: Model ID for the selected provider. + type: string + prompt: + description: Prompt describing the object to generate. + type: string + outputSchema: + description: JSON Schema 7 definition for the output object. + type: object + maxOutputTokens: + description: Maximum number of tokens in the model output. Minimum 256. + type: integer + minimum: 256 +responses: + '200': + description: Successful request + content: + text/plain: + schema: + type: string + '403': + $ref: ../../../components/responses.yaml#/UnauthorizedError +security: [] +tags: + - AI +x-codeSamples: + - label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK + - label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/ai/object/index.yaml b/openapi/paths/ai/object/index.yaml new file mode 100644 index 0000000..3220d4f --- /dev/null +++ b/openapi/paths/ai/object/index.yaml @@ -0,0 +1,2 @@ +post: + $ref: aiObject.yaml diff --git a/openapi/paths/assets/_id/getAsset.yaml b/openapi/paths/assets/_id/getAsset.yaml index 6499429..c515285 100644 --- a/openapi/paths/assets/_id/getAsset.yaml +++ b/openapi/paths/assets/_id/getAsset.yaml @@ -47,4 +47,5 @@ x-codeSamples: const result = await client.request(readAssetRaw('', { key: '' })); - label: GraphQL lang: GraphQL - source: Not available in Directus SDK/GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/assets/files/downloadFiles.yaml b/openapi/paths/assets/files/downloadFiles.yaml new file mode 100644 index 0000000..15d9e9f --- /dev/null +++ b/openapi/paths/assets/files/downloadFiles.yaml @@ -0,0 +1,61 @@ +summary: Download Files as ZIP +description: Download multiple files as a ZIP archive. +operationId: downloadFiles +requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - ids + properties: + ids: + description: File UUIDs to include in the archive. + type: array + minItems: 1 + items: + type: string + format: uuid + example: + - 8cbb43fe-4cdf-4991-8352-c461779cec02 + - b6ac6b72-3c6d-4bd8-9f0f-3e29b6e8b321 +responses: + '200': + description: ZIP archive of the requested files. + headers: + Content-Disposition: + description: Attachment filename for the ZIP archive. + schema: + type: string + example: attachment; filename="files-2024-01-15_12-00-00.zip" + content: + application/zip: + schema: + type: string + format: binary + '401': + $ref: ../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Assets +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, downloadFilesZip } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + const result = await client.request( + downloadFilesZip([ + '8cbb43fe-4cdf-4991-8352-c461779cec02', + 'b6ac6b72-3c6d-4bd8-9f0f-3e29b6e8b321', + ]) + ); +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/assets/files/index.yaml b/openapi/paths/assets/files/index.yaml new file mode 100644 index 0000000..30e9f45 --- /dev/null +++ b/openapi/paths/assets/files/index.yaml @@ -0,0 +1,2 @@ +post: + $ref: downloadFiles.yaml diff --git a/openapi/paths/assets/folder/_id/downloadFolder.yaml b/openapi/paths/assets/folder/_id/downloadFolder.yaml new file mode 100644 index 0000000..c6defe5 --- /dev/null +++ b/openapi/paths/assets/folder/_id/downloadFolder.yaml @@ -0,0 +1,48 @@ +summary: Download Folder as ZIP +description: Download a folder's contents as a ZIP archive. +operationId: downloadFolder +parameters: +- name: id + in: path + description: Unique identifier of the folder to download. + required: true + schema: + type: string + format: uuid + example: 8cbb43fe-4cdf-4991-8352-c461779cec02 +responses: + '200': + description: ZIP archive of the folder contents. + headers: + Content-Disposition: + description: Attachment filename for the ZIP archive. + schema: + type: string + example: attachment; filename="folder-my-assets-2024-01-15_12-00-00.zip" + content: + application/zip: + schema: + type: string + format: binary + '401': + $ref: ../../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Assets +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, downloadFolderZip } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + const result = await client.request( + downloadFolderZip('8cbb43fe-4cdf-4991-8352-c461779cec02') + ); +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/assets/folder/_id/index.yaml b/openapi/paths/assets/folder/_id/index.yaml new file mode 100644 index 0000000..82a69c6 --- /dev/null +++ b/openapi/paths/assets/folder/_id/index.yaml @@ -0,0 +1,2 @@ +post: + $ref: downloadFolder.yaml diff --git a/openapi/paths/auth/oauth/_provider/oauthProvider.yaml b/openapi/paths/auth/oauth/_provider/oauthProvider.yaml index 824227d..b058192 100644 --- a/openapi/paths/auth/oauth/_provider/oauthProvider.yaml +++ b/openapi/paths/auth/oauth/_provider/oauthProvider.yaml @@ -35,3 +35,12 @@ responses: security: [] tags: - Authentication +x-codeSamples: + - label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK + - label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/auth/oauth/oauth.yaml b/openapi/paths/auth/oauth/oauth.yaml index 516cad3..c0a257b 100644 --- a/openapi/paths/auth/oauth/oauth.yaml +++ b/openapi/paths/auth/oauth/oauth.yaml @@ -15,12 +15,20 @@ responses: public: type: boolean data: - type: array - example: - - github - - facebook - items: - type: string + type: object + properties: + name: + type: string + example: google + label: + type: string + example: Google + driver: + type: string + example: openid + icon: + type: string + example: google '401': $ref: ../../../components/responses.yaml#/UnauthorizedError x-codeSamples: @@ -34,4 +42,5 @@ x-codeSamples: const result = await client.request(readProviders()); - label: GraphQL lang: GraphQL - source: Not available in GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/deployments/_provider/dashboard/getDeploymentDashboard.yaml b/openapi/paths/deployments/_provider/dashboard/getDeploymentDashboard.yaml new file mode 100644 index 0000000..cbd4d53 --- /dev/null +++ b/openapi/paths/deployments/_provider/dashboard/getDeploymentDashboard.yaml @@ -0,0 +1,54 @@ +summary: Get Deployment Dashboard +description: Retrieve dashboard stats for all selected projects of a deployment provider. Includes latest run status per project. Defaults to the last 24 hours. +operationId: getDeploymentDashboard +parameters: +- name: provider + in: path + description: The deployment provider name (e.g. `vercel`, `netlify`). + required: true + schema: + type: string + enum: + - vercel + - netlify +- name: range + in: query + description: >- + Time range for statistics. Accepts a duration string (e.g. `24h`, `7d`, `30m`). + Defaults to `24h`. + required: false + schema: + type: string + pattern: '^\d+(ms|s|m|h|d|w|y)$' + example: 24h +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + type: object + description: Dashboard stats keyed by project, including latest deployment status and run history. + '401': + $ref: ../../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Deployments +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, readDeploymentDashboard } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + const result = await client.request(readDeploymentDashboard('vercel', { range: '24h' })); +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/deployments/_provider/dashboard/index.yaml b/openapi/paths/deployments/_provider/dashboard/index.yaml new file mode 100644 index 0000000..c1df1d1 --- /dev/null +++ b/openapi/paths/deployments/_provider/dashboard/index.yaml @@ -0,0 +1,2 @@ +get: + $ref: getDeploymentDashboard.yaml diff --git a/openapi/paths/deployments/_provider/deleteDeployment.yaml b/openapi/paths/deployments/_provider/deleteDeployment.yaml new file mode 100644 index 0000000..a68bcd3 --- /dev/null +++ b/openapi/paths/deployments/_provider/deleteDeployment.yaml @@ -0,0 +1,36 @@ +summary: Delete Deployment Configuration +description: Delete a deployment provider configuration by provider name. +operationId: deleteDeployment +parameters: +- name: provider + in: path + description: The deployment provider name (e.g. `vercel`, `netlify`). + required: true + schema: + type: string + enum: + - vercel + - netlify +responses: + '204': + description: No Content + '401': + $ref: ../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Deployments +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, deleteDeployment } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + await client.request(deleteDeployment('vercel')); +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/deployments/_provider/getDeployment.yaml b/openapi/paths/deployments/_provider/getDeployment.yaml new file mode 100644 index 0000000..cc9d4bd --- /dev/null +++ b/openapi/paths/deployments/_provider/getDeployment.yaml @@ -0,0 +1,45 @@ +summary: Retrieve Deployment Configuration +description: Retrieve a deployment configuration by provider name. +operationId: getDeployment +parameters: +- name: provider + in: path + description: The deployment provider name (e.g. `vercel`, `netlify`). + required: true + schema: + type: string + enum: + - vercel + - netlify +- $ref: ../../../components/parameters.yaml#/Fields +- $ref: ../../../components/parameters.yaml#/Meta +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + $ref: ../../../components/schemas/deployments.yaml + '401': + $ref: ../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Deployments +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, readDeployment } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + const result = await client.request(readDeployment('vercel')); +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/deployments/_provider/index.yaml b/openapi/paths/deployments/_provider/index.yaml new file mode 100644 index 0000000..f533f88 --- /dev/null +++ b/openapi/paths/deployments/_provider/index.yaml @@ -0,0 +1,6 @@ +get: + $ref: getDeployment.yaml +patch: + $ref: updateDeployment.yaml +delete: + $ref: deleteDeployment.yaml diff --git a/openapi/paths/deployments/_provider/projects/_id/deploy/index.yaml b/openapi/paths/deployments/_provider/projects/_id/deploy/index.yaml new file mode 100644 index 0000000..93c8bcc --- /dev/null +++ b/openapi/paths/deployments/_provider/projects/_id/deploy/index.yaml @@ -0,0 +1,2 @@ +post: + $ref: triggerDeployment.yaml diff --git a/openapi/paths/deployments/_provider/projects/_id/deploy/triggerDeployment.yaml b/openapi/paths/deployments/_provider/projects/_id/deploy/triggerDeployment.yaml new file mode 100644 index 0000000..99e3c69 --- /dev/null +++ b/openapi/paths/deployments/_provider/projects/_id/deploy/triggerDeployment.yaml @@ -0,0 +1,86 @@ +summary: Trigger Deployment +description: Trigger a new deployment for a tracked project. +operationId: triggerDeployment +parameters: +- name: provider + in: path + description: The deployment provider name (e.g. `vercel`, `netlify`). + required: true + schema: + type: string + enum: + - vercel + - netlify +- name: id + in: path + description: Unique identifier of the tracked project. + required: true + schema: + type: string + format: uuid +requestBody: + content: + application/json: + schema: + type: object + properties: + preview: + description: When `true`, trigger a preview deployment instead of production. + type: boolean + default: false + clear_cache: + description: When `true`, clears the provider's build cache before deploying. + type: boolean + default: true +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + deployment_id: + description: Provider-side deployment identifier. + type: string + example: dpl_abc123 + status: + type: string + enum: + - building + - ready + - error + - canceled + example: building + url: + type: string + nullable: true + example: https://my-directus-app.vercel.app + created_at: + type: string + format: date-time + '401': + $ref: ../../../../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Deployments +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, triggerDeployment } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + const result = await client.request( + triggerDeployment('vercel', '8cbb43fe-4cdf-4991-8352-c461779cec02') + ); +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/deployments/_provider/projects/_id/getDeploymentProject.yaml b/openapi/paths/deployments/_provider/projects/_id/getDeploymentProject.yaml new file mode 100644 index 0000000..1837441 --- /dev/null +++ b/openapi/paths/deployments/_provider/projects/_id/getDeploymentProject.yaml @@ -0,0 +1,94 @@ +summary: Retrieve Deployment Project +description: Retrieve details of a single tracked deployment project, including latest deployment info fetched from the provider. +operationId: getDeploymentProject +parameters: +- name: provider + in: path + description: The deployment provider name (e.g. `vercel`, `netlify`). + required: true + schema: + type: string + enum: + - vercel + - netlify +- name: id + in: path + description: Unique identifier of the tracked project. + required: true + schema: + type: string + format: uuid +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + example: 8cbb43fe-4cdf-4991-8352-c461779cec02 + external_id: + type: string + example: prj_abc123 + name: + type: string + example: my-directus-app + url: + type: string + nullable: true + example: https://my-directus-app.vercel.app + framework: + type: string + nullable: true + example: nextjs + deployable: + type: boolean + example: true + latest_deployment: + description: Most recent deployment summary. + nullable: true + type: object + properties: + status: + type: string + enum: + - building + - ready + - error + - canceled + example: ready + created_at: + type: string + format: date-time + finished_at: + type: string + format: date-time + nullable: true + '401': + $ref: ../../../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Deployments +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, readDeploymentProject } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + const result = await client.request( + readDeploymentProject('vercel', '8cbb43fe-4cdf-4991-8352-c461779cec02') + ); +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/deployments/_provider/projects/_id/index.yaml b/openapi/paths/deployments/_provider/projects/_id/index.yaml new file mode 100644 index 0000000..3383050 --- /dev/null +++ b/openapi/paths/deployments/_provider/projects/_id/index.yaml @@ -0,0 +1,2 @@ +get: + $ref: getDeploymentProject.yaml diff --git a/openapi/paths/deployments/_provider/projects/_id/runs/getDeploymentRuns.yaml b/openapi/paths/deployments/_provider/projects/_id/runs/getDeploymentRuns.yaml new file mode 100644 index 0000000..701710b --- /dev/null +++ b/openapi/paths/deployments/_provider/projects/_id/runs/getDeploymentRuns.yaml @@ -0,0 +1,110 @@ +summary: List Deployment Runs +description: List deployment runs for a tracked project, sorted by most recent first. Defaults to the 10 most recent runs. +operationId: getDeploymentRuns +parameters: +- name: provider + in: path + description: The deployment provider name (e.g. `vercel`, `netlify`). + required: true + schema: + type: string + enum: + - vercel + - netlify +- name: id + in: path + description: Unique identifier of the tracked project. + required: true + schema: + type: string + format: uuid +- $ref: ../../../../../../components/parameters.yaml#/Limit +- $ref: ../../../../../../components/parameters.yaml#/Offset +- $ref: ../../../../../../components/parameters.yaml#/Meta +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + project: + type: string + format: uuid + external_id: + type: string + example: dpl_abc123 + status: + type: string + enum: + - building + - ready + - error + - canceled + example: ready + target: + description: Deployment target (e.g. `production`, `preview`). + type: string + example: production + url: + type: string + nullable: true + example: https://my-directus-app.vercel.app + date_created: + type: string + format: date-time + started_at: + type: string + format: date-time + nullable: true + completed_at: + type: string + format: date-time + nullable: true + user_created: + description: User who triggered the deployment (if triggered from Directus). + nullable: true + type: object + properties: + first_name: + type: string + nullable: true + last_name: + type: string + nullable: true + email: + type: string + nullable: true + meta: + $ref: ../../../../../../components/schemas/x-metadata.yaml + '401': + $ref: ../../../../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Deployments +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, readDeploymentRuns } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + const result = await client.request( + readDeploymentRuns('vercel', '8cbb43fe-4cdf-4991-8352-c461779cec02') + ); +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/deployments/_provider/projects/_id/runs/index.yaml b/openapi/paths/deployments/_provider/projects/_id/runs/index.yaml new file mode 100644 index 0000000..2ab2b6b --- /dev/null +++ b/openapi/paths/deployments/_provider/projects/_id/runs/index.yaml @@ -0,0 +1,2 @@ +get: + $ref: getDeploymentRuns.yaml diff --git a/openapi/paths/deployments/_provider/projects/_id/runs/stats/getDeploymentRunStats.yaml b/openapi/paths/deployments/_provider/projects/_id/runs/stats/getDeploymentRunStats.yaml new file mode 100644 index 0000000..6782df2 --- /dev/null +++ b/openapi/paths/deployments/_provider/projects/_id/runs/stats/getDeploymentRunStats.yaml @@ -0,0 +1,63 @@ +summary: Get Deployment Run Statistics +description: Retrieve aggregated statistics for deployment runs of a tracked project within a time range (defaults to last 7 days). +operationId: getDeploymentRunStats +parameters: +- name: provider + in: path + description: The deployment provider name (e.g. `vercel`, `netlify`). + required: true + schema: + type: string + enum: + - vercel + - netlify +- name: id + in: path + description: Unique identifier of the tracked project. + required: true + schema: + type: string + format: uuid +- name: range + in: query + description: >- + Time range for statistics. Accepts a duration string (e.g. `7d`, `24h`, `30m`). + Defaults to `7d`. + required: false + schema: + type: string + pattern: '^\d+(ms|s|m|h|d|w|y)$' + example: 7d +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + type: object + description: Aggregated run statistics for the given time range. + '401': + $ref: ../../../../../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../../../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Deployments +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, readDeploymentRunStats } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + const result = await client.request( + readDeploymentRunStats('vercel', '8cbb43fe-4cdf-4991-8352-c461779cec02', { range: '7d' }) + ); +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/deployments/_provider/projects/_id/runs/stats/index.yaml b/openapi/paths/deployments/_provider/projects/_id/runs/stats/index.yaml new file mode 100644 index 0000000..cf94332 --- /dev/null +++ b/openapi/paths/deployments/_provider/projects/_id/runs/stats/index.yaml @@ -0,0 +1,2 @@ +get: + $ref: getDeploymentRunStats.yaml diff --git a/openapi/paths/deployments/_provider/projects/getDeploymentProjects.yaml b/openapi/paths/deployments/_provider/projects/getDeploymentProjects.yaml new file mode 100644 index 0000000..a656ae1 --- /dev/null +++ b/openapi/paths/deployments/_provider/projects/getDeploymentProjects.yaml @@ -0,0 +1,77 @@ +summary: List Deployment Projects +description: List all projects available from the deployment provider, merged with locally tracked project data. +operationId: getDeploymentProjects +parameters: +- name: provider + in: path + description: The deployment provider name (e.g. `vercel`, `netlify`). + required: true + schema: + type: string + enum: + - vercel + - netlify +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + description: Internal project UUID (null if not yet tracked). + type: string + format: uuid + nullable: true + external_id: + description: Project ID from the deployment provider. + type: string + example: prj_abc123 + name: + description: Project name from the provider. + type: string + example: my-directus-app + url: + description: Production URL for the project. + type: string + nullable: true + example: https://my-directus-app.vercel.app + framework: + description: Framework detected by the provider. + type: string + nullable: true + example: nextjs + deployable: + description: Whether the project has a Git source and can trigger deployments. + type: boolean + example: true + selected: + description: Whether this project is currently tracked in Directus. + type: boolean + example: false + '401': + $ref: ../../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Deployments +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, readDeploymentProjects } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + const result = await client.request(readDeploymentProjects('vercel')); +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/deployments/_provider/projects/index.yaml b/openapi/paths/deployments/_provider/projects/index.yaml new file mode 100644 index 0000000..c0d56ad --- /dev/null +++ b/openapi/paths/deployments/_provider/projects/index.yaml @@ -0,0 +1,4 @@ +get: + $ref: getDeploymentProjects.yaml +patch: + $ref: updateDeploymentProjects.yaml diff --git a/openapi/paths/deployments/_provider/projects/updateDeploymentProjects.yaml b/openapi/paths/deployments/_provider/projects/updateDeploymentProjects.yaml new file mode 100644 index 0000000..b959ef0 --- /dev/null +++ b/openapi/paths/deployments/_provider/projects/updateDeploymentProjects.yaml @@ -0,0 +1,95 @@ +summary: Update Selected Deployment Projects +description: Add or remove projects from the tracked set for this deployment provider. Automatically syncs webhooks with the updated selection. +operationId: updateDeploymentProjects +parameters: +- name: provider + in: path + description: The deployment provider name (e.g. `vercel`, `netlify`). + required: true + schema: + type: string + enum: + - vercel + - netlify +requestBody: + content: + application/json: + schema: + type: object + properties: + create: + description: Projects to add to the tracked set. + type: array + items: + type: object + required: + - external_id + - name + properties: + external_id: + description: Project ID from the provider. + type: string + example: prj_abc123 + name: + description: Project name. + type: string + example: my-directus-app + delete: + description: Internal project UUIDs to remove from the tracked set. + type: array + items: + type: string + format: uuid +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + external_id: + type: string + name: + type: string + url: + type: string + nullable: true + framework: + type: string + nullable: true + deployable: + type: boolean + '401': + $ref: ../../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Deployments +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, updateDeploymentProjects } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + const result = await client.request( + updateDeploymentProjects('vercel', { + create: [{ external_id: 'prj_abc123', name: 'my-app' }], + delete: ['8cbb43fe-4cdf-4991-8352-c461779cec02'], + }) + ); +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/deployments/_provider/runs/_id/cancel/cancelDeploymentRun.yaml b/openapi/paths/deployments/_provider/runs/_id/cancel/cancelDeploymentRun.yaml new file mode 100644 index 0000000..83569b3 --- /dev/null +++ b/openapi/paths/deployments/_provider/runs/_id/cancel/cancelDeploymentRun.yaml @@ -0,0 +1,53 @@ +summary: Cancel Deployment Run +description: Cancel an in-progress deployment run. +operationId: cancelDeploymentRun +parameters: +- name: provider + in: path + description: The deployment provider name (e.g. `vercel`, `netlify`). + required: true + schema: + type: string + enum: + - vercel + - netlify +- name: id + in: path + description: Unique identifier of the deployment run. + required: true + schema: + type: string + format: uuid +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + type: object + description: Cancellation result from the provider. + '401': + $ref: ../../../../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Deployments +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, cancelDeployment } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + const result = await client.request( + cancelDeployment('vercel', '8cbb43fe-4cdf-4991-8352-c461779cec02') + ); +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/deployments/_provider/runs/_id/cancel/index.yaml b/openapi/paths/deployments/_provider/runs/_id/cancel/index.yaml new file mode 100644 index 0000000..cb97a01 --- /dev/null +++ b/openapi/paths/deployments/_provider/runs/_id/cancel/index.yaml @@ -0,0 +1,2 @@ +post: + $ref: cancelDeploymentRun.yaml diff --git a/openapi/paths/deployments/_provider/runs/_id/getDeploymentRun.yaml b/openapi/paths/deployments/_provider/runs/_id/getDeploymentRun.yaml new file mode 100644 index 0000000..9874279 --- /dev/null +++ b/openapi/paths/deployments/_provider/runs/_id/getDeploymentRun.yaml @@ -0,0 +1,103 @@ +summary: Retrieve Deployment Run +description: Retrieve details and logs for a single deployment run. Supports incremental log polling via the `since` parameter. +operationId: getDeploymentRun +parameters: +- name: provider + in: path + description: The deployment provider name (e.g. `vercel`, `netlify`). + required: true + schema: + type: string + enum: + - vercel + - netlify +- name: id + in: path + description: Unique identifier of the deployment run. + required: true + schema: + type: string + format: uuid +- name: since + in: query + description: ISO 8601 timestamp. When provided, only log entries after this time are returned (for incremental polling). + required: false + schema: + type: string + format: date-time +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + project_id: + type: string + format: uuid + status: + type: string + enum: + - building + - ready + - error + - canceled + example: building + url: + type: string + nullable: true + created_at: + type: string + format: date-time + finished_at: + type: string + format: date-time + nullable: true + error_message: + type: string + nullable: true + logs: + type: array + items: + type: object + properties: + timestamp: + type: string + format: date-time + type: + type: string + enum: + - stdout + - stderr + - info + message: + type: string + '401': + $ref: ../../../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Deployments +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, readDeploymentRun } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + const result = await client.request( + readDeploymentRun('vercel', '8cbb43fe-4cdf-4991-8352-c461779cec02') + ); +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/deployments/_provider/runs/_id/index.yaml b/openapi/paths/deployments/_provider/runs/_id/index.yaml new file mode 100644 index 0000000..e91e846 --- /dev/null +++ b/openapi/paths/deployments/_provider/runs/_id/index.yaml @@ -0,0 +1,2 @@ +get: + $ref: getDeploymentRun.yaml diff --git a/openapi/paths/deployments/_provider/updateDeployment.yaml b/openapi/paths/deployments/_provider/updateDeployment.yaml new file mode 100644 index 0000000..8b102c6 --- /dev/null +++ b/openapi/paths/deployments/_provider/updateDeployment.yaml @@ -0,0 +1,63 @@ +summary: Update Deployment Configuration +description: Update an existing deployment provider configuration. +operationId: updateDeployment +parameters: +- name: provider + in: path + description: The deployment provider name (e.g. `vercel`, `netlify`). + required: true + schema: + type: string + enum: + - vercel + - netlify +- $ref: ../../../components/parameters.yaml#/Fields +- $ref: ../../../components/parameters.yaml#/Meta +requestBody: + content: + application/json: + schema: + type: object + properties: + credentials: + description: Updated provider-specific credentials. + type: object + example: + token: new_token_abc + options: + description: Updated provider-specific configuration options. + type: object + example: + team_id: team_abc123 +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + $ref: ../../../components/schemas/deployments.yaml + '401': + $ref: ../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Deployments +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, updateDeployment } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + const result = await client.request( + updateDeployment('vercel', { credentials: { token: 'new_token' } }) + ); +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/deployments/createDeployment.yaml b/openapi/paths/deployments/createDeployment.yaml new file mode 100644 index 0000000..0394ebe --- /dev/null +++ b/openapi/paths/deployments/createDeployment.yaml @@ -0,0 +1,64 @@ +summary: Create Deployment Configuration +description: Create a new deployment provider configuration. +operationId: createDeployment +parameters: +- $ref: ../../components/parameters.yaml#/Fields +- $ref: ../../components/parameters.yaml#/Meta +requestBody: + content: + application/json: + schema: + type: object + required: + - provider + - credentials + properties: + provider: + description: The deployment provider. One of `vercel` or `netlify`. + type: string + enum: + - vercel + - netlify + example: vercel + credentials: + description: Provider-specific credentials (e.g. API token). + type: object + example: + token: abc123 + options: + description: Provider-specific configuration options. + type: object + example: + team_id: team_abc123 +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + $ref: ../../components/schemas/deployments.yaml + '401': + $ref: ../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Deployments +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, createDeployment } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + const result = await client.request( + createDeployment({ provider: 'vercel', credentials: { token: 'abc123' } }) + ); +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/deployments/getDeployments.yaml b/openapi/paths/deployments/getDeployments.yaml new file mode 100644 index 0000000..f4549a0 --- /dev/null +++ b/openapi/paths/deployments/getDeployments.yaml @@ -0,0 +1,46 @@ +summary: List Deployment Configurations +description: Returns a list of deployment configurations. +operationId: getDeployments +parameters: +- $ref: ../../components/parameters.yaml#/Fields +- $ref: ../../components/parameters.yaml#/Limit +- $ref: ../../components/parameters.yaml#/Offset +- $ref: ../../components/parameters.yaml#/Meta +- $ref: ../../components/parameters.yaml#/Sort +- $ref: ../../components/parameters.yaml#/Filter +- $ref: ../../components/parameters.yaml#/Search +- $ref: ../../components/parameters.yaml#/Page +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: ../../components/schemas/deployments.yaml + meta: + $ref: ../../components/schemas/x-metadata.yaml + '401': + $ref: ../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Deployments +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, readDeployments } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + const result = await client.request(readDeployments()); +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/deployments/index.yaml b/openapi/paths/deployments/index.yaml new file mode 100644 index 0000000..b0a6e89 --- /dev/null +++ b/openapi/paths/deployments/index.yaml @@ -0,0 +1,4 @@ +get: + $ref: getDeployments.yaml +post: + $ref: createDeployment.yaml diff --git a/openapi/paths/deployments/webhooks/_provider/index.yaml b/openapi/paths/deployments/webhooks/_provider/index.yaml new file mode 100644 index 0000000..db27e65 --- /dev/null +++ b/openapi/paths/deployments/webhooks/_provider/index.yaml @@ -0,0 +1,2 @@ +post: + $ref: receiveDeploymentWebhook.yaml diff --git a/openapi/paths/deployments/webhooks/_provider/receiveDeploymentWebhook.yaml b/openapi/paths/deployments/webhooks/_provider/receiveDeploymentWebhook.yaml new file mode 100644 index 0000000..0def01b --- /dev/null +++ b/openapi/paths/deployments/webhooks/_provider/receiveDeploymentWebhook.yaml @@ -0,0 +1,51 @@ +summary: Receive Deployment Webhook +description: >- + Public endpoint that receives webhook events from a deployment provider (e.g. Vercel, Netlify). + Payloads are verified using a provider-specific signature before being processed. + This endpoint does not require authentication - it is called by the deployment provider. +operationId: receiveDeploymentWebhook +parameters: +- name: provider + in: path + description: The deployment provider name (e.g. `vercel`, `netlify`). + required: true + schema: + type: string + enum: + - vercel + - netlify +- name: token + in: query + description: Optional token used by providers that pass secrets as query parameters instead of request headers. + required: false + schema: + type: string +requestBody: + description: Raw webhook payload from the provider. Format is provider-specific. + content: + application/json: + schema: + type: object +responses: + '200': + description: Webhook successfully received and processed. + '400': + description: Missing or malformed request body. + '401': + description: Webhook signature verification failed. + '404': + description: Provider not configured or project not tracked. + '410': + description: Project is no longer tracked (signals provider to stop sending events). +security: [] +tags: +- Deployments +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/extensions/_bundle/_name/index.yaml b/openapi/paths/extensions/_bundle/_name/index.yaml deleted file mode 100644 index 21c418d..0000000 --- a/openapi/paths/extensions/_bundle/_name/index.yaml +++ /dev/null @@ -1,2 +0,0 @@ -patch: - $ref: updateExtensionBundle.yaml diff --git a/openapi/paths/extensions/_bundle/_name/updateExtensionBundle.yaml b/openapi/paths/extensions/_bundle/_name/updateExtensionBundle.yaml deleted file mode 100644 index 7f379b1..0000000 --- a/openapi/paths/extensions/_bundle/_name/updateExtensionBundle.yaml +++ /dev/null @@ -1,61 +0,0 @@ -summary: Update an Extension Bundle -description: Update an existing extension bundle. -operationId: updateExtensionBundle -parameters: -- in: path - name: bundle - required: true - schema: - type: string -- in: path - name: name - required: true - schema: - type: string -requestBody: - content: - application/json: - schema: - type: object - properties: - meta: - type: object - description: Directus metadata for the extension. Where the configuration - for the extension in the current project is stored. - properties: - enabled: - type: boolean - description: Whether or not the extension is enabled. - example: true -responses: - '200': - content: - application/json: - schema: - type: object - properties: - data: - $ref: ../../../../components/schemas/extensions.yaml - description: Successful request - '401': - $ref: ../../../../components/responses.yaml#/UnauthorizedError - '404': - $ref: ../../../../components/responses.yaml#/NotFoundError -security: [] -tags: -- Extensions -x-codeSamples: - - label: Directus SDK - lang: JavaScript - source: | - import { createDirectus, rest, updateExtension } from '@directus/sdk'; - - const client = createDirectus('directus_project_url').with(rest()); - - const result = await client.request(updateExtension(bundle, name, partial_extension_object)); - - label: GraphQL - lang: GraphQL - source: | - type Mutation { - update_extensions_item(bundle: String, name: String!, data: update_directus_extensions_input!): directus_extensions - } diff --git a/openapi/paths/extensions/_id/deleteExtension.yaml b/openapi/paths/extensions/_id/deleteExtension.yaml new file mode 100644 index 0000000..6ba9ffc --- /dev/null +++ b/openapi/paths/extensions/_id/deleteExtension.yaml @@ -0,0 +1,28 @@ +summary: Delete an Extension +description: Delete an installed extension by its unique identifier. +operationId: deleteExtension +parameters: + - $ref: ../../../components/parameters.yaml#/UUId +responses: + "204": + description: No Content + "401": + $ref: ../../../components/responses.yaml#/UnauthorizedError + "404": + $ref: ../../../components/responses.yaml#/NotFoundError +security: [] +tags: + - Extensions +x-codeSamples: + - label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, deleteExtension } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + await client.request(deleteExtension('extension_id')); + - label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/extensions/_id/index.yaml b/openapi/paths/extensions/_id/index.yaml new file mode 100644 index 0000000..a29c006 --- /dev/null +++ b/openapi/paths/extensions/_id/index.yaml @@ -0,0 +1,4 @@ +patch: + $ref: updateExtension.yaml +delete: + $ref: deleteExtension.yaml diff --git a/openapi/paths/extensions/_name/updateExtensions.yaml b/openapi/paths/extensions/_id/updateExtension.yaml similarity index 66% rename from openapi/paths/extensions/_name/updateExtensions.yaml rename to openapi/paths/extensions/_id/updateExtension.yaml index 8963852..ab93016 100644 --- a/openapi/paths/extensions/_name/updateExtensions.yaml +++ b/openapi/paths/extensions/_id/updateExtension.yaml @@ -1,12 +1,8 @@ summary: Update an Extension -description: Update an existing extension. -operationId: updateExtensions +description: Update the configuration of an installed extension (e.g. enable or disable it). +operationId: updateExtension parameters: -- in: path - name: name - required: true - schema: - type: string + - $ref: ../../../components/parameters.yaml#/UUId requestBody: content: application/json: @@ -15,15 +11,15 @@ requestBody: properties: meta: type: object - description: Directus metadata for the extension. Where the configuration - for the extension in the current project is stored. + description: Directus metadata for the extension. Where the configuration for the extension in the current project is stored. properties: enabled: type: boolean description: Whether or not the extension is enabled. example: true responses: - '200': + "200": + description: Successful request content: application/json: schema: @@ -31,14 +27,13 @@ responses: properties: data: $ref: ../../../components/schemas/extensions.yaml - description: Successful request - '401': + "401": $ref: ../../../components/responses.yaml#/UnauthorizedError - '404': + "404": $ref: ../../../components/responses.yaml#/NotFoundError security: [] tags: -- Extensions + - Extensions x-codeSamples: - label: Directus SDK lang: JavaScript @@ -47,12 +42,8 @@ x-codeSamples: const client = createDirectus('directus_project_url').with(rest()); - const result = await client.request(updateExtension(bundle, name, partial_extension_object)); + const result = await client.request(updateExtension('extension_id', { meta: { enabled: true } })); - label: GraphQL lang: GraphQL source: | - POST /graphql/system - - type Mutation { - update_extensions_item(bundle: String, name: String!, data: update_directus_extensions_input!): directus_extensions - } + // Not supported in GraphQL diff --git a/openapi/paths/extensions/_name/index.yaml b/openapi/paths/extensions/_name/index.yaml deleted file mode 100644 index 1b969eb..0000000 --- a/openapi/paths/extensions/_name/index.yaml +++ /dev/null @@ -1,2 +0,0 @@ -patch: - $ref: updateExtensions.yaml diff --git a/openapi/paths/extensions/registry/index.yaml b/openapi/paths/extensions/registry/index.yaml new file mode 100644 index 0000000..b64006f --- /dev/null +++ b/openapi/paths/extensions/registry/index.yaml @@ -0,0 +1,2 @@ +get: + $ref: listRegistryExtensions.yaml diff --git a/openapi/paths/extensions/registry/install/index.yaml b/openapi/paths/extensions/registry/install/index.yaml new file mode 100644 index 0000000..e91b9bf --- /dev/null +++ b/openapi/paths/extensions/registry/install/index.yaml @@ -0,0 +1,2 @@ +post: + $ref: installRegistryExtension.yaml diff --git a/openapi/paths/extensions/registry/install/installRegistryExtension.yaml b/openapi/paths/extensions/registry/install/installRegistryExtension.yaml new file mode 100644 index 0000000..1beb540 --- /dev/null +++ b/openapi/paths/extensions/registry/install/installRegistryExtension.yaml @@ -0,0 +1,43 @@ +summary: Install Extension from Registry +description: Install an extension from the Directus marketplace registry by its ID and version. Admin only. +operationId: installRegistryExtension +requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - extension + - version + properties: + extension: + description: Registry extension UUID. + type: string + format: uuid + example: 8cbb43fe-4cdf-4991-8352-c461779cec02 + version: + description: Version string to install (e.g. `1.2.3`). + type: string + example: 1.2.3 +responses: + "200": + description: Extension installed successfully. + "401": + $ref: ../../../../components/responses.yaml#/UnauthorizedError +security: [] +tags: + - Extensions +x-codeSamples: + - label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, installRegistryExtension } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + await client.request(installRegistryExtension('extension_id', '1.2.3')); + - label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/extensions/registry/listRegistryExtensions.yaml b/openapi/paths/extensions/registry/listRegistryExtensions.yaml new file mode 100644 index 0000000..576b772 --- /dev/null +++ b/openapi/paths/extensions/registry/listRegistryExtensions.yaml @@ -0,0 +1,40 @@ +summary: List Registry Extensions +description: Search the Directus extension marketplace registry. Admin only. +operationId: listRegistryExtensions +parameters: + - $ref: ../../../components/parameters.yaml#/Search + - $ref: ../../../components/parameters.yaml#/Limit + - $ref: ../../../components/parameters.yaml#/Offset + - $ref: ../../../components/parameters.yaml#/Sort + - $ref: ../../../components/parameters.yaml#/Filter +responses: + "200": + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + description: Registry extension listing. + "401": + $ref: ../../../components/responses.yaml#/UnauthorizedError +security: [] +tags: + - Extensions +x-codeSamples: + - label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, readRegistryExtensions } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + const result = await client.request(readRegistryExtensions({ search: 'charts', limit: 10 })); + - label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/extensions/registry/reinstall/index.yaml b/openapi/paths/extensions/registry/reinstall/index.yaml new file mode 100644 index 0000000..0e63e57 --- /dev/null +++ b/openapi/paths/extensions/registry/reinstall/index.yaml @@ -0,0 +1,2 @@ +post: + $ref: reinstallRegistryExtension.yaml diff --git a/openapi/paths/extensions/registry/reinstall/reinstallRegistryExtension.yaml b/openapi/paths/extensions/registry/reinstall/reinstallRegistryExtension.yaml new file mode 100644 index 0000000..397ecb6 --- /dev/null +++ b/openapi/paths/extensions/registry/reinstall/reinstallRegistryExtension.yaml @@ -0,0 +1,40 @@ +summary: Reinstall Extension from Registry +description: Reinstall a previously installed registry extension, fetching the latest files for its current version. Admin only. +operationId: reinstallRegistryExtension +requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - extension + properties: + extension: + description: Registry extension UUID. + type: string + format: uuid + example: 8cbb43fe-4cdf-4991-8352-c461779cec02 +responses: + "200": + description: Extension reinstalled successfully. + "401": + $ref: ../../../../components/responses.yaml#/UnauthorizedError + "404": + $ref: ../../../../components/responses.yaml#/NotFoundError +security: [] +tags: + - Extensions +x-codeSamples: + - label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, reinstallRegistryExtension } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + await client.request(reinstallRegistryExtension('extension_id')); + - label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/extensions/registry/uninstall/_id/index.yaml b/openapi/paths/extensions/registry/uninstall/_id/index.yaml new file mode 100644 index 0000000..7a2b411 --- /dev/null +++ b/openapi/paths/extensions/registry/uninstall/_id/index.yaml @@ -0,0 +1,2 @@ +delete: + $ref: uninstallRegistryExtension.yaml diff --git a/openapi/paths/extensions/registry/uninstall/_id/uninstallRegistryExtension.yaml b/openapi/paths/extensions/registry/uninstall/_id/uninstallRegistryExtension.yaml new file mode 100644 index 0000000..2ed2b77 --- /dev/null +++ b/openapi/paths/extensions/registry/uninstall/_id/uninstallRegistryExtension.yaml @@ -0,0 +1,28 @@ +summary: Uninstall Extension from Registry +description: Uninstall a registry-installed extension by its unique identifier. Admin only. +operationId: uninstallRegistryExtension +parameters: + - $ref: ../../../../../components/parameters.yaml#/UUId +responses: + "204": + description: No Content + "401": + $ref: ../../../../../components/responses.yaml#/UnauthorizedError + "404": + $ref: ../../../../../components/responses.yaml#/NotFoundError +security: [] +tags: + - Extensions +x-codeSamples: + - label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, uninstallRegistryExtension } from '@directus/sdk'; + + const client = createDirectus('directus_project_url').with(rest()); + + await client.request(uninstallRegistryExtension('extension_id')); + - label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/files/tus/_id/deleteTusUpload.yaml b/openapi/paths/files/tus/_id/deleteTusUpload.yaml new file mode 100644 index 0000000..539f858 --- /dev/null +++ b/openapi/paths/files/tus/_id/deleteTusUpload.yaml @@ -0,0 +1,37 @@ +summary: Cancel TUS Upload +description: Cancel an in-progress TUS upload session. Requires `TUS_ENABLED=true`. +operationId: deleteTusUpload +parameters: +- name: id + in: path + description: TUS upload session identifier. + required: true + schema: + type: string +- name: Tus-Resumable + in: header + description: TUS protocol version. Must be `1.0.0`. + required: true + schema: + type: string + enum: + - 1.0.0 +responses: + '204': + description: Upload session deleted. + '401': + $ref: ../../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Files +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/files/tus/_id/getTusUploadStatus.yaml b/openapi/paths/files/tus/_id/getTusUploadStatus.yaml new file mode 100644 index 0000000..20acc33 --- /dev/null +++ b/openapi/paths/files/tus/_id/getTusUploadStatus.yaml @@ -0,0 +1,51 @@ +summary: Get TUS Upload Status +description: >- + Returns the current byte offset of a TUS upload session. Use the offset to resume an interrupted upload. + Requires `TUS_ENABLED=true`. +operationId: getTusUploadStatus +parameters: +- name: id + in: path + description: TUS upload session identifier. + required: true + schema: + type: string +- name: Tus-Resumable + in: header + description: TUS protocol version. Must be `1.0.0`. + required: true + schema: + type: string + enum: + - 1.0.0 +responses: + '200': + description: Upload status retrieved. + headers: + Upload-Offset: + description: Bytes uploaded so far. + schema: + type: integer + Upload-Length: + description: Total size of the file in bytes. + schema: + type: integer + Tus-Resumable: + schema: + type: string + '401': + $ref: ../../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Files +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/files/tus/_id/index.yaml b/openapi/paths/files/tus/_id/index.yaml new file mode 100644 index 0000000..36e92d6 --- /dev/null +++ b/openapi/paths/files/tus/_id/index.yaml @@ -0,0 +1,6 @@ +patch: + $ref: uploadTusChunk.yaml +delete: + $ref: deleteTusUpload.yaml +head: + $ref: getTusUploadStatus.yaml diff --git a/openapi/paths/files/tus/_id/uploadTusChunk.yaml b/openapi/paths/files/tus/_id/uploadTusChunk.yaml new file mode 100644 index 0000000..ebae366 --- /dev/null +++ b/openapi/paths/files/tus/_id/uploadTusChunk.yaml @@ -0,0 +1,70 @@ +summary: Upload TUS Chunk +description: >- + Upload a chunk of a file as part of a resumable TUS upload session. Requires `TUS_ENABLED=true`. + Send chunks sequentially using the `Upload-Offset` from the previous response. +operationId: uploadTusChunk +parameters: +- name: id + in: path + description: TUS upload session identifier. + required: true + schema: + type: string +- name: Upload-Offset + in: header + description: Byte offset at which this chunk begins within the file. + required: true + schema: + type: integer + example: 0 +- name: Tus-Resumable + in: header + description: TUS protocol version. Must be `1.0.0`. + required: true + schema: + type: string + enum: + - 1.0.0 +- name: Content-Type + in: header + description: Must be `application/offset+octet-stream`. + required: true + schema: + type: string + enum: + - application/offset+octet-stream +requestBody: + description: Raw binary chunk of the file. + required: true + content: + application/offset+octet-stream: + schema: + type: string + format: binary +responses: + '204': + description: Chunk accepted. The `Upload-Offset` header reflects the new byte position. + headers: + Upload-Offset: + description: New byte offset after this chunk. + schema: + type: integer + Tus-Resumable: + schema: + type: string + '401': + $ref: ../../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Files +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/files/tus/createTusUpload.yaml b/openapi/paths/files/tus/createTusUpload.yaml new file mode 100644 index 0000000..23db11e --- /dev/null +++ b/openapi/paths/files/tus/createTusUpload.yaml @@ -0,0 +1,57 @@ +summary: Create TUS Upload +description: >- + Initiate a resumable file upload session using the TUS protocol. Returns an upload URL + in the `Location` response header. Requires `TUS_ENABLED=true`. +operationId: createTusUpload +parameters: +- name: Upload-Length + in: header + description: Total size of the file in bytes. Required unless the server supports deferred length. + required: true + schema: + type: integer + example: 1048576 +- name: Upload-Metadata + in: header + description: >- + Comma-separated key-value pairs of file metadata, base64-encoded. Supported keys include + `filename`, `filetype`, and any `directus_files` field name (e.g. `title`, `folder`). + To replace an existing file, include `id` with the existing file UUID. + required: false + schema: + type: string + example: filename dGVzdC50eHQ=,filetype dGV4dC9wbGFpbg== +- name: Tus-Resumable + in: header + description: TUS protocol version. Must be `1.0.0`. + required: true + schema: + type: string + enum: + - 1.0.0 +responses: + '201': + description: Upload session created. The `Location` header contains the URL for uploading chunks. + headers: + Location: + description: URL for subsequent chunk uploads. + schema: + type: string + Tus-Resumable: + description: Confirmed TUS protocol version. + schema: + type: string + '401': + $ref: ../../../components/responses.yaml#/UnauthorizedError +security: [] +tags: +- Files +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/files/tus/index.yaml b/openapi/paths/files/tus/index.yaml new file mode 100644 index 0000000..acc00e5 --- /dev/null +++ b/openapi/paths/files/tus/index.yaml @@ -0,0 +1,2 @@ +post: + $ref: createTusUpload.yaml diff --git a/openapi/paths/items/_collection/_id/deleteItem.yaml b/openapi/paths/items/_collection/_id/deleteItem.yaml index e5e0887..f811390 100644 --- a/openapi/paths/items/_collection/_id/deleteItem.yaml +++ b/openapi/paths/items/_collection/_id/deleteItem.yaml @@ -1,4 +1,4 @@ -summary: Delete an item +summary: Delete an Item description: Delete an existing item. operationId: deleteItem parameters: diff --git a/openapi/paths/items/_collection/_id/updateItem.yaml b/openapi/paths/items/_collection/_id/updateItem.yaml index 868f21c..8e1941f 100644 --- a/openapi/paths/items/_collection/_id/updateItem.yaml +++ b/openapi/paths/items/_collection/_id/updateItem.yaml @@ -1,4 +1,4 @@ -summary: Update an item +summary: Update an Item description: Update an existing item. operationId: updateItem parameters: @@ -15,8 +15,7 @@ requestBody: content: application/json: schema: - anyOf: - - $ref: ../../../../components/schemas/items.yaml + $ref: ../../../../components/schemas/items.yaml responses: '200': description: Successful request diff --git a/openapi/paths/items/_collection/deleteItems.yaml b/openapi/paths/items/_collection/deleteItems.yaml index 9462ec4..caaf164 100644 --- a/openapi/paths/items/_collection/deleteItems.yaml +++ b/openapi/paths/items/_collection/deleteItems.yaml @@ -14,19 +14,18 @@ requestBody: content: application/json: schema: - anyOf: - - type: array - description: Primary keys of items to be deleted. - items: - type: string + oneOf: - type: object - description: Object containing either `keys` or `query` to selected what items to update. + description: Delete by primary keys. properties: keys: type: array items: type: string - items: + - type: object + description: Delete by query. + properties: + query: type: object responses: '204': @@ -44,13 +43,11 @@ x-codeSamples: source: | import { createDirectus, rest, deleteItems } from '@directus/sdk'; - const client = createDirectus('https://directus.example.com').with(rest()); - - const result = await client.request(deleteItems(collection_name, item_id_array)); + const client = createDirectus('directus_project_url').with(rest()); - //or + const resultByKeys = await client.request(deleteItems(collection_name, item_id_array)); - const result = await client.request(deleteItems(collection_name, query_object)); + const resultByQuery = await client.request(deleteItems(collection_name, query_object)); - label: GraphQL lang: GraphQL source: | diff --git a/openapi/paths/items/_collection/getCollectionItems.yaml b/openapi/paths/items/_collection/getCollectionItems.yaml index 92f802b..2613b2a 100644 --- a/openapi/paths/items/_collection/getCollectionItems.yaml +++ b/openapi/paths/items/_collection/getCollectionItems.yaml @@ -1,4 +1,4 @@ -summary: List all items in a collection +summary: List Items in a Collection description: Returns a list of the items in the given collection. operationId: getCollectionItems parameters: @@ -11,11 +11,19 @@ parameters: - $ref: ../../../components/parameters.yaml#/Fields - $ref: ../../../components/parameters.yaml#/Limit - $ref: ../../../components/parameters.yaml#/Offset +- $ref: ../../../components/parameters.yaml#/Page - $ref: ../../../components/parameters.yaml#/Meta - $ref: ../../../components/parameters.yaml#/Sort - $ref: ../../../components/parameters.yaml#/Filter - $ref: ../../../components/parameters.yaml#/Search +- $ref: ../../../components/parameters.yaml#/Export +- $ref: ../../../components/parameters.yaml#/Version +- $ref: ../../../components/parameters.yaml#/VersionRaw - $ref: ../../../components/parameters.yaml#/Backlink +- $ref: ../../../components/parameters.yaml#/Aggregate +- $ref: ../../../components/parameters.yaml#/Group +- $ref: ../../../components/parameters.yaml#/Deep +- $ref: ../../../components/parameters.yaml#/Alias responses: '200': description: Successful request diff --git a/openapi/paths/items/_collection/singleton/getSingleton.yaml b/openapi/paths/items/_collection/singleton/getSingleton.yaml index b21c6c3..fa5a451 100644 --- a/openapi/paths/items/_collection/singleton/getSingleton.yaml +++ b/openapi/paths/items/_collection/singleton/getSingleton.yaml @@ -1,14 +1,17 @@ -summary: Retrieve a Singleton +summary: Retrieve a Singleton Item description: | - Retrieves a singleton of a given collection. + Retrieve the singleton item from the given collection. - The REST and GraphQL requests for singletons are the same as those used to Get Items but in contrast the response consists of a plain item object (the singleton) instead of an array of items. + Unlike regular collections, a singleton returns a plain item object rather than an array of items. operationId: getSingleton parameters: - $ref: ../../../../components/parameters.yaml#/Collection -- $ref: ../../../../components/parameters.yaml#/Version - $ref: ../../../../components/parameters.yaml#/Fields - $ref: ../../../../components/parameters.yaml#/Meta +- $ref: ../../../../components/parameters.yaml#/Version +- $ref: ../../../../components/parameters.yaml#/VersionRaw +- $ref: ../../../../components/parameters.yaml#/Deep +- $ref: ../../../../components/parameters.yaml#/Alias responses: '200': description: Successful request @@ -34,7 +37,7 @@ x-codeSamples: const client = createDirectus('directus_project_url').with(rest()); - const result = await client.request(readSingleton(collection_name)); + const result = await client.request(readSingleton('collection_name', query_object)); - label: GraphQL lang: GraphQL source: | diff --git a/openapi/paths/items/_collection/singleton/updateSingleton.yaml b/openapi/paths/items/_collection/singleton/updateSingleton.yaml index 8993ee6..fa99843 100644 --- a/openapi/paths/items/_collection/singleton/updateSingleton.yaml +++ b/openapi/paths/items/_collection/singleton/updateSingleton.yaml @@ -1,8 +1,8 @@ -summary: Update Singleton +summary: Update a Singleton Item description: | - Update a singleton item. + Update the singleton item in the given collection. - The REST and GraphQL requests for singletons are the same as those used to Update Multiple Items but in contrast the request should consist of the plain item object. + Unlike batch updates for regular collections, the request body should be a plain item object rather than a keyed batch payload. operationId: updateSingleton parameters: - $ref: ../../../../components/parameters.yaml#/Collection @@ -12,8 +12,7 @@ requestBody: content: application/json: schema: - anyOf: - - $ref: ../../../../components/schemas/items.yaml + $ref: ../../../../components/schemas/items.yaml responses: '200': description: Successful request @@ -32,17 +31,17 @@ security: [] tags: - Items x-codeSamples: -- label: Directus SDK - lang: JavaScript - source: | - import { createDirectus, rest, updateSingleton } from '@directus/sdk'; + - label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, updateSingleton } from '@directus/sdk'; - const client = createDirectus('directus_project_url').with(rest()); + const client = createDirectus('directus_project_url').with(rest()); - const result = await client.request(updateSingleton(collection_name, partial_item_object)); -- label: GraphQL - lang: GraphQL - source: | - type Mutation { - update__items(data: [update__input]): [] - } + const result = await client.request(updateSingleton('collection_name', partial_item_object)); + - label: GraphQL + lang: GraphQL + source: | + type Mutation { + update_(data: update__input!): + } diff --git a/openapi/paths/items/_collection/singular/createItem.yaml b/openapi/paths/items/_collection/singular/createItem.yaml index 67c6fed..b584fa4 100644 --- a/openapi/paths/items/_collection/singular/createItem.yaml +++ b/openapi/paths/items/_collection/singular/createItem.yaml @@ -1,4 +1,4 @@ -summary: Create an item +summary: Create an Item description: Create a new item in the given collection. operationId: createItem parameters: @@ -9,8 +9,7 @@ requestBody: content: application/json: schema: - anyOf: - - $ref: ../../../../components/schemas/items.yaml + $ref: ../../../../components/schemas/items.yaml responses: '200': description: Successful request diff --git a/openapi/paths/items/_collection/updateItems.yaml b/openapi/paths/items/_collection/updateItems.yaml index c47becb..e37384c 100644 --- a/openapi/paths/items/_collection/updateItems.yaml +++ b/openapi/paths/items/_collection/updateItems.yaml @@ -1,4 +1,3 @@ - summary: Update Multiple Items description: Update multiple items at the same time. operationId: updateItems @@ -15,17 +14,29 @@ requestBody: content: application/json: schema: - type: object - required: - - data - - keys - properties: - data: - $ref: ../../../components/schemas/items.yaml - keys: - type: array - items: - type: string + oneOf: + - type: object + description: Update by primary keys. + required: + - keys + - data + properties: + keys: + type: array + items: + type: string + data: + $ref: ../../../components/schemas/items.yaml + - type: object + description: Update by query. + required: + - query + - data + properties: + query: + type: object + data: + $ref: ../../../components/schemas/items.yaml responses: '200': description: Successful request @@ -55,10 +66,12 @@ x-codeSamples: const client = createDirectus('directus_project_url').with(rest()); - const result = await client.request(updateItems(collection_name, item_id_array, partial_item_object)); + const resultByKeys = await client.request(updateItems(collection_name, item_id_array, partial_item_object)); + + const resultByQuery = await client.request(updateItems(collection_name, query_object, partial_item_object)); - label: GraphQL lang: GraphQL source: | type Mutation { - update__items(ids: [ID!]!, data: [update__input]): [] + update__items(ids: [ID!]!, data: update__input!): [] } diff --git a/openapi/paths/mcp/getMcp.yaml b/openapi/paths/mcp/getMcp.yaml new file mode 100644 index 0000000..c04973f --- /dev/null +++ b/openapi/paths/mcp/getMcp.yaml @@ -0,0 +1,37 @@ +summary: MCP Endpoint (GET) +description: >- + Model Context Protocol (MCP) endpoint accepting JSON-RPC 2.0 messages via GET. + Requires `MCP_ENABLED=true` and `mcp_enabled: true` in project settings. + Only `application/json` is supported; SSE transport is not available. +operationId: getMcp +requestBody: + required: true + content: + application/json: + schema: + $ref: ../../components/schemas/jsonrpc-request.yaml +responses: + '200': + description: Successful JSON-RPC response. + content: + application/json: + schema: + $ref: ../../components/schemas/jsonrpc-response.yaml + '202': + description: Notification acknowledged (no response body). + '403': + $ref: ../../components/responses.yaml#/UnauthorizedError + '405': + description: Request does not accept `application/json`. +security: [] +tags: + - MCP +x-codeSamples: + - label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK + - label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/mcp/index.yaml b/openapi/paths/mcp/index.yaml new file mode 100644 index 0000000..0eb4fc8 --- /dev/null +++ b/openapi/paths/mcp/index.yaml @@ -0,0 +1,4 @@ +get: + $ref: getMcp.yaml +post: + $ref: postMcp.yaml diff --git a/openapi/paths/mcp/postMcp.yaml b/openapi/paths/mcp/postMcp.yaml new file mode 100644 index 0000000..5a78cad --- /dev/null +++ b/openapi/paths/mcp/postMcp.yaml @@ -0,0 +1,37 @@ +summary: MCP Endpoint (POST) +description: >- + Model Context Protocol (MCP) endpoint accepting JSON-RPC 2.0 messages via POST. + Requires `MCP_ENABLED=true` and `mcp_enabled: true` in project settings. + Supported methods are `tools/list`, `tools/call`, `prompts/list`, `prompts/get`, and `notifications/initialized`. +operationId: postMcp +requestBody: + required: true + content: + application/json: + schema: + $ref: ../../components/schemas/jsonrpc-request.yaml +responses: + '200': + description: Successful JSON-RPC response. + content: + application/json: + schema: + $ref: ../../components/schemas/jsonrpc-response.yaml + '202': + description: Notification acknowledged (no response body). + '403': + $ref: ../../components/responses.yaml#/UnauthorizedError + '405': + description: Request does not accept `application/json`. +security: [] +tags: + - MCP +x-codeSamples: + - label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK + - label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/schema/apply/schemaApply.yaml b/openapi/paths/schema/apply/schemaApply.yaml index c12b0f6..7f16c48 100644 --- a/openapi/paths/schema/apply/schemaApply.yaml +++ b/openapi/paths/schema/apply/schemaApply.yaml @@ -3,6 +3,13 @@ description: Update the instance's schema by passing the diff previously retriev via `/schema/diff` endpoint in the JSON request body or a JSON/YAML file. This endpoint is only available to admin users. operationId: schemaApply +parameters: +- name: force + in: query + description: When `true`, bypasses the hash check and applies the diff regardless of whether the current schema matches the snapshot it was generated from. + required: false + schema: + type: boolean requestBody: required: true content: @@ -31,7 +38,7 @@ x-codeSamples: source: | import { createDirectus, rest, schemaApply } from '@directus/sdk'; - const client = createDirectus('https://directus.example.com').with(rest()); + const client = createDirectus('directus_project_url').with(rest()); const result = await client.request( schemaApply({ diff --git a/openapi/paths/utils/cache/clear/clear-cache.yaml b/openapi/paths/utils/cache/clear/clear-cache.yaml index 8da4563..78833b0 100644 --- a/openapi/paths/utils/cache/clear/clear-cache.yaml +++ b/openapi/paths/utils/cache/clear/clear-cache.yaml @@ -10,6 +10,8 @@ parameters: responses: '200': description: Successful request + '403': + $ref: ../../../../components/responses.yaml#/ForbiddenError security: [] tags: - Utilities diff --git a/openapi/paths/utils/export/_collection/export.yaml b/openapi/paths/utils/export/_collection/export.yaml index 72b87a8..e3de66b 100644 --- a/openapi/paths/utils/export/_collection/export.yaml +++ b/openapi/paths/utils/export/_collection/export.yaml @@ -12,6 +12,7 @@ requestBody: content: application/json: schema: + type: object properties: format: type: string @@ -33,6 +34,10 @@ requestBody: responses: '200': description: Successful request + '400': + $ref: ../../../../components/responses.yaml#/BadRequestError + '403': + $ref: ../../../../components/responses.yaml#/ForbiddenError security: [] tags: - Utilities diff --git a/openapi/paths/utils/hash/generate/hash-generate.yaml b/openapi/paths/utils/hash/generate/hash-generate.yaml index c19ce7b..d2c1844 100644 --- a/openapi/paths/utils/hash/generate/hash-generate.yaml +++ b/openapi/paths/utils/hash/generate/hash-generate.yaml @@ -1,10 +1,11 @@ -summary: Generate a Hash. +summary: Generate a Hash description: Generate a hash for a given string. operationId: hash-generate requestBody: content: application/json: schema: + type: object properties: string: type: string @@ -23,6 +24,8 @@ responses: example: $argon2i$v=19$m=4096,t=3,p=1$pOyIa/zmRAjCVLb2f7kOyg$DasoO6LzMM+6iKfzCDq6JbsYsZWLSm33p7i9NxL9mDc description: Successful request + '400': + $ref: ../../../../components/responses.yaml#/BadRequestError security: [] tags: - Utilities diff --git a/openapi/paths/utils/hash/verify/hash-verify.yaml b/openapi/paths/utils/hash/verify/hash-verify.yaml index 1e10e83..22cac03 100644 --- a/openapi/paths/utils/hash/verify/hash-verify.yaml +++ b/openapi/paths/utils/hash/verify/hash-verify.yaml @@ -1,10 +1,11 @@ -summary: Verify a Hash. +summary: Verify a Hash description: Verify a string with a hash. operationId: hash-verify requestBody: content: application/json: schema: + type: object properties: string: type: string @@ -26,6 +27,8 @@ responses: type: boolean example: true description: Successful request + '400': + $ref: ../../../../components/responses.yaml#/BadRequestError security: [] tags: - Utilities diff --git a/openapi/paths/utils/import/_collection/import.yaml b/openapi/paths/utils/import/_collection/import.yaml index 477cb4d..5c2e632 100644 --- a/openapi/paths/utils/import/_collection/import.yaml +++ b/openapi/paths/utils/import/_collection/import.yaml @@ -20,6 +20,23 @@ requestBody: responses: '200': description: Successful request + '403': + $ref: ../../../../components/responses.yaml#/ForbiddenError + '415': + description: "Error: Unsupported media type." + content: + application/json: + schema: + type: object + properties: + error: + type: object + properties: + code: + type: integer + format: int64 + message: + type: string security: [] tags: - Utilities diff --git a/openapi/paths/utils/random/string/random.yaml b/openapi/paths/utils/random/string/random.yaml index 1a8bffe..f74c0de 100644 --- a/openapi/paths/utils/random/string/random.yaml +++ b/openapi/paths/utils/random/string/random.yaml @@ -19,6 +19,8 @@ responses: type: string example: 1>M3+4oh.S description: Successful request + '400': + $ref: ../../../../components/responses.yaml#/BadRequestError security: [] tags: - Utilities diff --git a/openapi/paths/utils/revert/_revision/index.yaml b/openapi/paths/utils/revert/_revision/index.yaml new file mode 100644 index 0000000..b764871 --- /dev/null +++ b/openapi/paths/utils/revert/_revision/index.yaml @@ -0,0 +1,2 @@ +post: + $ref: revert.yaml diff --git a/openapi/paths/utils/revert/_revision/revert.yaml b/openapi/paths/utils/revert/_revision/revert.yaml new file mode 100644 index 0000000..d3bc5c2 --- /dev/null +++ b/openapi/paths/utils/revert/_revision/revert.yaml @@ -0,0 +1,29 @@ +summary: Revert to a Revision +description: Revert an item to its state at the given revision. +operationId: revert +parameters: +- description: Unique identifier of the revision to revert to. + in: path + name: revision + required: true + schema: + type: string +responses: + '200': + description: Successful request + '401': + $ref: ../../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../../components/responses.yaml#/NotFoundError +security: [] +tags: +- Utilities +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/utils/sort/_collection/sort.yaml b/openapi/paths/utils/sort/_collection/sort.yaml index 4ac99c5..e098f4e 100644 --- a/openapi/paths/utils/sort/_collection/sort.yaml +++ b/openapi/paths/utils/sort/_collection/sort.yaml @@ -12,6 +12,7 @@ requestBody: content: application/json: schema: + type: object properties: item: type: number @@ -22,6 +23,10 @@ requestBody: responses: '200': description: Successful request + '400': + $ref: ../../../../components/responses.yaml#/BadRequestError + '403': + $ref: ../../../../components/responses.yaml#/ForbiddenError security: [] tags: - Utilities diff --git a/openapi/paths/utils/translations/generate/generateTranslations.yaml b/openapi/paths/utils/translations/generate/generateTranslations.yaml new file mode 100644 index 0000000..dff63c7 --- /dev/null +++ b/openapi/paths/utils/translations/generate/generateTranslations.yaml @@ -0,0 +1,91 @@ +summary: Set Up Translations +description: >- + Scaffold a translations collection, languages collection, fields, and relations for a given collection. + Admin only. +operationId: generateTranslations +requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - collection + - fields + properties: + collection: + description: Collection to enable translations on. + type: string + example: articles + fields: + description: One or more field names to create on the translations collection. + type: array + minItems: 1 + items: + type: string + example: + - title + - body + translationsCollection: + description: Name for the translations collection. Defaults to `{collection}_translations`. + type: string + example: articles_translations + languagesCollection: + description: Name of the languages collection to use or create. Defaults to `languages`. + type: string + example: languages + parentFkField: + description: Foreign key field on the translations collection pointing to the parent. Defaults to `{collection}_id`. + type: string + example: articles_id + languageFkField: + description: Foreign key field on the translations collection pointing to the language. Defaults to `languages_code`. + type: string + example: languages_code + createLanguagesCollection: + description: Create the languages collection if it does not exist. Defaults to `true`. + type: boolean + default: true + seedLanguages: + description: Seed the languages collection with default language entries. Defaults to `true`. + type: boolean + default: true +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + created: + description: Whether a new translations collection was created. + type: boolean + translationsCollection: + description: Name of the translations collection. + type: string + languagesCollection: + description: Name of the languages collection (only present when a new translations collection was created). + type: string + fields: + description: Names of the fields created on the translations collection. + type: array + items: + type: string + '401': + $ref: ../../../../components/responses.yaml#/UnauthorizedError +security: [] +tags: +- Utilities +x-codeSamples: +- label: Directus SDK + lang: JavaScript + source: | + // Not supported in Directus SDK +- label: GraphQL + lang: GraphQL + source: | + // Not supported in GraphQL diff --git a/openapi/paths/utils/translations/generate/index.yaml b/openapi/paths/utils/translations/generate/index.yaml new file mode 100644 index 0000000..779e792 --- /dev/null +++ b/openapi/paths/utils/translations/generate/index.yaml @@ -0,0 +1,2 @@ +post: + $ref: generateTranslations.yaml