diff --git a/apify-api/openapi/components/schemas/actor-tasks/CreateTaskRequest.yaml b/apify-api/openapi/components/schemas/actor-tasks/CreateTaskRequest.yaml index 0d985ef897..447e31b63a 100644 --- a/apify-api/openapi/components/schemas/actor-tasks/CreateTaskRequest.yaml +++ b/apify-api/openapi/components/schemas/actor-tasks/CreateTaskRequest.yaml @@ -23,3 +23,8 @@ properties: anyOf: - $ref: ../actors/ActorStandby.yaml - type: "null" + publicConfig: + description: | + Configuration that controls how the published task appears on its public landing page. + Editing this object requires write permission to the Actor that the task belongs to. + $ref: ./TaskPublicConfig.yaml diff --git a/apify-api/openapi/components/schemas/actor-tasks/Task.yaml b/apify-api/openapi/components/schemas/actor-tasks/Task.yaml index eff273d7e9..d9df867f5d 100644 --- a/apify-api/openapi/components/schemas/actor-tasks/Task.yaml +++ b/apify-api/openapi/components/schemas/actor-tasks/Task.yaml @@ -55,3 +55,12 @@ properties: standbyUrl: type: [string, "null"] format: uri + isPublic: + type: boolean + description: | + Whether the task is published. Based on the `publicConfig.publishedAt` field. + examples: [false] + publicConfig: + anyOf: + - $ref: ./TaskPublicConfig.yaml + - type: "null" diff --git a/apify-api/openapi/components/schemas/actor-tasks/TaskPublicConfig.yaml b/apify-api/openapi/components/schemas/actor-tasks/TaskPublicConfig.yaml new file mode 100644 index 0000000000..42e8e474a9 --- /dev/null +++ b/apify-api/openapi/components/schemas/actor-tasks/TaskPublicConfig.yaml @@ -0,0 +1,45 @@ +title: TaskPublicConfig +type: object +description: | + Public-facing configuration of a published task, used by the task's public landing page. + The task's publication state is determined by `publishedAt` - a task is published when + `publishedAt` is set and unpublished when it is `null`. +properties: + publishedAt: + type: [string, "null"] + format: date-time + readOnly: true + description: | + Time when the task was published, or `null` if the task isn't published. + This field is server-controlled. To publish or unpublish a task, use the + [Update task](/api/v2/actor-task-put) endpoint and set `isPublic`. + examples: ["2025-06-16T09:20:45.777Z"] + seoTitle: + type: [string, "null"] + maxLength: 60 + description: | + Name of the Actor task to display by search engines such as Google. Defaults to the task + title. At most 60 characters. + examples: [Scrape data from a website] + seoDescription: + type: [string, "null"] + maxLength: 160 + description: | + Description of the Actor task to display by search engines such as Google. Defaults to the + task description. At most 160 characters. + inputSchemaFields: + type: [array, "null"] + description: Names of the task input fields displayed on the public task page. + items: + type: string + datasetName: + type: [string, "null"] + description: | + Name of the dataset from the Actor's dataset schema whose results are displayed. When + `null`, the Actor's default dataset is used. That is, the only dataset the Actor declares, + or the one named `default` when it declares several. + datasetView: + type: [string, "null"] + description: | + Key of the dataset view from the Actor's dataset schema used to display results. Must be + one of the views declared on the resolved dataset. You can't publish a task without it. diff --git a/apify-api/openapi/components/schemas/actor-tasks/UpdateTaskRequest.yaml b/apify-api/openapi/components/schemas/actor-tasks/UpdateTaskRequest.yaml index d12c85c191..f8f2b7a295 100644 --- a/apify-api/openapi/components/schemas/actor-tasks/UpdateTaskRequest.yaml +++ b/apify-api/openapi/components/schemas/actor-tasks/UpdateTaskRequest.yaml @@ -18,3 +18,18 @@ properties: anyOf: - $ref: ../actors/ActorStandby.yaml - type: "null" + publicConfig: + description: | + Configuration that controls how the published task appears on its public landing page. + Editing this object requires write permission to the Actor that the task belongs to. + + The fields you send are merged into the stored configuration, so you only need to include + the ones you're changing. To clear a field, set it to `null`. Sending `publicConfig: null` + is rejected, so the object as a whole can't be cleared. + $ref: ./TaskPublicConfig.yaml + isPublic: + type: boolean + description: | + Set to `true` to publish the task on its public landing page, or `false` to unpublish it. + Sending the value the task already has does nothing. + examples: [true] diff --git a/apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}.yaml b/apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}.yaml index 4b2d8acde8..0343cd5cb5 100644 --- a/apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}.yaml +++ b/apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}.yaml @@ -52,6 +52,20 @@ put: If the object does not define a specific property, its value is not updated. + The `publicConfig` field carries the display configuration of the task's public + landing page, and `isPublic` publishes or unpublishes the task itself. Both require + write permission to the task's Actor. + + To publish a task, its Actor must be public, `publicConfig.inputSchemaFields` and + `publicConfig.datasetView` must be set, and the Actor must have fewer than 50 published + tasks. If the task isn't ready to be published, the whole update fails and none of it + is applied. + + Publishing lists the task among the Actor's examples and makes its input public, so anyone + can view and copy it. The landing page itself is shown only while `publicConfig` still + validates against the Actor's current build, so a new build can stop the page from being + offered while the task stays published and copyable. + The response is the full task object as returned by the [Get task](/api/v2/actor-task-get) endpoint.