Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 0.3.1

- Bumped `ApifyClientVersion.ApiSpecVersion` to the Apify OpenAPI spec `v2-2026-08-14T072928Z`.
- Corrected the publish/unpublish permission wording in `TaskClient.PublishAsync`/`UnpublishAsync`,
`docs/tasks.md`, and the `TaskPublishUnpublish` integration test comment: publishing/unpublishing
requires write permission to the task's Actor only, not to the task itself.
- `TaskClient.PublishAsync`'s doc comment and `docs/tasks.md` now state the concrete publish
preconditions from the spec (Actor public, `publicConfig.inputSchemaFields` and
`publicConfig.datasetView` set, Actor has fewer than 50 published tasks).
- Noted in `TaskPublicConfig.Categorization`'s doc comment and `docs/models.md` that the field is
not part of the documented schema and is kept only for parity with the reference JS client.

## 0.3.0

Breaking: `RequestQueueClient` methods that previously returned a raw `JsonObject`/took an untyped
Expand Down
2 changes: 1 addition & 1 deletion docs/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ An entry returned when browsing the Apify Store.
| `PublishedAt` | `string?` | ISO 8601 timestamp the task was published, or `null` if unpublished. Read-only. |
| `SeoTitle` | `string?` | Name to display for search engines. |
| `SeoDescription` | `string?` | Description to display for search engines. |
| `Categorization` | `string?` | The task's category on its public landing page. |
| `Categorization` | `string?` | The task's category on its public landing page. Not part of the documented `TaskPublicConfig` schema; kept for parity with the reference JS client. |
| `InputSchemaFields` | `IReadOnlyList<string>?` | Input schema fields shown on the public landing page. |
| `DatasetName` | `string?` | Name of the dataset shown on the public landing page. |
| `DatasetView` | `string?` | View of the dataset shown on the public landing page. |
Expand Down
17 changes: 11 additions & 6 deletions docs/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ a specific task with `client.Task(id)`.

- `GetAsync()` → `ActorTask?`; `UpdateAsync(object newFields)` → `ActorTask`; `DeleteAsync()`.
- `PublishAsync()` → `ActorTask` — publishes the task on its public landing page in Apify Store
(sets `isPublic: true`). The task's Actor must be public and the task must already have
`PublicConfig` set up. Requires write permission to both the task and its Actor. Publishing an
already published task does nothing.
(sets `isPublic: true`). The task's Actor must be public, `PublicConfig.InputSchemaFields` and
`PublicConfig.DatasetView` must already be set, and the Actor must have fewer than 50 published
tasks. Requires write permission to the task's Actor. Publishing an already published task does
nothing.
- `UnpublishAsync()` → `ActorTask` — unpublishes the task (sets `isPublic: false`); `PublicConfig` is
preserved so the task can be published again without re-entering it. Requires write permission to
both the task and its Actor. Unpublishing a task that is not published does nothing.
the task's Actor. Unpublishing a task that is not published does nothing.
- `StartAsync(object? input = null, TaskStartOptions? options = null)` → `ActorRun`.
- `CallAsync(object? input = null, TaskStartOptions? options = null, int? waitSecs = null, Action<string>? log = null)`
→ `ActorRun` (`log`, if set, redirects the run's live log to that sink for the duration of the wait).
Expand Down Expand Up @@ -50,11 +51,15 @@ var run = await client.Task(task.Id!).CallAsync(null, null, 120);
Console.WriteLine(run.Status);
```

Publishing a task requires its Actor to be public and the task to have `PublicConfig` set up first:
Publishing a task requires its Actor to be public and `publicConfig.inputSchemaFields` /
`publicConfig.datasetView` to already be set:

```csharp
var taskClient = client.Task(task.Id!);
await taskClient.UpdateAsync(new { publicConfig = new { seoTitle = "My task" } });
await taskClient.UpdateAsync(new
{
publicConfig = new { seoTitle = "My task", inputSchemaFields = new[] { "url" }, datasetView = "overview" },
});
var published = await taskClient.PublishAsync();
Console.WriteLine(published.IsPublic == true);

Expand Down
2 changes: 1 addition & 1 deletion src/Apify.Client/Apify.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<!-- NuGet package metadata (see the publish workflow). -->
<PackageId>Apify.Client</PackageId>
<Version>0.3.0</Version>
<Version>0.3.1</Version>
<Authors>Apify</Authors>
<Company>Apify</Company>
<Product>Apify API client for .NET</Product>
Expand Down
4 changes: 2 additions & 2 deletions src/Apify.Client/ApifyClientVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ public static class ApifyClientVersion
/// The semantic version of this client library (see https://semver.org/). Changes to the public
/// interface other than additive ones are considered breaking changes.
/// </summary>
public const string ClientVersion = "0.3.0";
public const string ClientVersion = "0.3.1";

/// <summary>
/// The version of the Apify OpenAPI specification this client was generated and verified against.
/// Corresponds to the <c>info.version</c> field of the Apify OpenAPI document.
/// </summary>
public const string ApiSpecVersion = "v2-2026-08-05T133145Z";
public const string ApiSpecVersion = "v2-2026-08-14T072928Z";
}
6 changes: 5 additions & 1 deletion src/Apify.Client/Models/TaskPublicConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ public TaskPublicConfig(JsonObject data)
/// <summary>Description to display for search engines such as Google.</summary>
public string? SeoDescription => GetString("seoDescription");

/// <summary>The task's category on its public landing page.</summary>
/// <summary>
/// The task's category on its public landing page. Not part of the documented OpenAPI schema for
/// this resource; kept for parity with the reference JS client, which exposes the same
/// undocumented field.
/// </summary>
public string? Categorization => GetString("categorization");

/// <summary>The input schema fields shown on the public landing page.</summary>
Expand Down
11 changes: 6 additions & 5 deletions src/Apify.Client/Resources/TaskClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ public async Task<ActorTask> UpdateAsync(object newFields, CancellationToken can
/// through <see cref="UpdateAsync"/>.
/// </summary>
/// <remarks>
/// The task's Actor must be public and the task must already have its public display
/// configuration (<see cref="ActorTask.PublicConfig"/>) set up. Requires write permission to both
/// the task and its Actor. Publishing an already published task does nothing.
/// The task's Actor must be public, <see cref="ActorTask.PublicConfig"/>'s <c>InputSchemaFields</c>
/// and <c>DatasetView</c> must already be set, and the Actor must have fewer than 50 published
/// tasks. Requires write permission to the task's Actor. Publishing an already published task
/// does nothing.
/// </remarks>
/// <param name="cancellationToken">A token to cancel the request.</param>
public Task<ActorTask> PublishAsync(CancellationToken cancellationToken = default) =>
Expand All @@ -68,8 +69,8 @@ public Task<ActorTask> PublishAsync(CancellationToken cancellationToken = defaul
/// </summary>
/// <remarks>
/// The public display configuration (<see cref="ActorTask.PublicConfig"/>) is preserved, so the
/// task can be published again without re-entering it. Requires write permission to both the task
/// and its Actor. Unpublishing a task that is not published does nothing.
/// task can be published again without re-entering it. Requires write permission to the task's
/// Actor. Unpublishing a task that is not published does nothing.
/// </remarks>
/// <param name="cancellationToken">A token to cancel the request.</param>
public Task<ActorTask> UnpublishAsync(CancellationToken cancellationToken = default) =>
Expand Down
4 changes: 2 additions & 2 deletions tests/Apify.Client.Tests/Integration/TaskIntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public async Task TaskPublishUnpublish()
Assert.Equal(task.Id, unpublished.Id);
Assert.True(unpublished.IsPublic != true);

// Publishing requires write permission to both the task and its Actor (apify/hello-world),
// which the test account does not have, so this is expected to fail rather than succeed.
// Publishing requires write permission to the task's Actor (apify/hello-world), which the
// test account does not have, so this is expected to fail rather than succeed.
var ex = await Assert.ThrowsAsync<ApifyApiException>(() => tc.PublishAsync());
Assert.True(ex.StatusCode is 400 or 403);
}
Expand Down
Loading