Content

Package: agentrouter.content.v1 Service: ContentService

Endpoints

List content versions

Changed in v0.9.0 (new features): Announcements and sign-in page content can be managed through the API, and the published content can be read without signing in. Reading the versions and changing them need the admin scope or a new Platform Content Creator, Editor or Deleter role. A newly published version can take up to 30 seconds to show. A sign-in page file (CSS, JS or an image) can take up to five and a half minutes, because browsers and shared caches keep it for five minutes.

What it does: Returns the versions of a kind, newest first.

Request fields:

FieldRequiredDescription
kindyesThe kind of content. Required.
page_sizenoPage size, 1 to 100. 0 selects 20.
page_tokennoThe next_page_token of the previous page. Empty for the first page.

Response fields:

FieldRequiredDescription
versionsnoThe versions, newest first.
next_page_tokennoEmpty on the last page.
{"signatures":{"go":"c.Content().ListContentVersions(ctx, \u0026contentv1.ListContentVersionsRequest{...})","python":"client.content.listcontentversions(...)","typescript":"client.content.listcontentversions({...})","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/content/versions?kind=CONTENT_KIND_ANNOUNCEMENT\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"examples":{"go":"// No Go SDK wrapper for ContentService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for ContentService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for ContentService yet -- use the CLI or curl example below.","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/content/versions?kind=CONTENT_KIND_ANNOUNCEMENT\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"persona":"Admin","httpVerb":"GET","httpPath":"/v1/content/versions","slug":"list-content-versions"}

Get a content version

Changed in v0.9.0 (new features): Announcements and sign-in page content can be managed through the API, and the published content can be read without signing in. Reading the versions and changing them need the admin scope or a new Platform Content Creator, Editor or Deleter role. A newly published version can take up to 30 seconds to show. A sign-in page file (CSS, JS or an image) can take up to five and a half minutes, because browsers and shared caches keep it for five minutes.

What it does: Returns one version.

Request fields:

FieldRequiredDescription
kindyesThe kind of content. Required.
idyesUUID of the version.

Response fields:

FieldRequiredDescription
versionnoThe version.
{"signatures":{"go":"c.Content().GetContentVersion(ctx, \u0026contentv1.GetContentVersionRequest{...})","python":"client.content.getcontentversion(...)","typescript":"client.content.getcontentversion({...})","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/content/versions/01H...?kind=CONTENT_KIND_ANNOUNCEMENT\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"examples":{"go":"// No Go SDK wrapper for ContentService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for ContentService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for ContentService yet -- use the CLI or curl example below.","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/content/versions/01H...?kind=CONTENT_KIND_ANNOUNCEMENT\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"persona":"Admin","httpVerb":"GET","httpPath":"/v1/content/versions/{id}","slug":"get-a-content-version"}

Create a content version

Changed in v0.9.0 (new features): Announcements and sign-in page content can be managed through the API, and the published content can be read without signing in. Reading the versions and changing them need the admin scope or a new Platform Content Creator, Editor or Deleter role. A newly published version can take up to 30 seconds to show. A sign-in page file (CSS, JS or an image) can take up to five and a half minutes, because browsers and shared caches keep it for five minutes.

What it does: Adds a version that is not published.

Request fields:

FieldRequiredDescription
versionyesThe new version, not yet published. kind and the body are required.

Response fields:

FieldRequiredDescription
versionnoThe new version.
{"signatures":{"go":"c.Content().CreateContentVersion(ctx, \u0026contentv1.CreateContentVersionRequest{...})","python":"client.content.createcontentversion(...)","typescript":"client.content.createcontentversion({...})","curl":"curl -X POST \"${AGENTROUTER_BASE_URL}/v1/content/versions\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"version\": {}\n  }'"},"examples":{"go":"// No Go SDK wrapper for ContentService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for ContentService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for ContentService yet -- use the CLI or curl example below.","curl":"curl -X POST \"${AGENTROUTER_BASE_URL}/v1/content/versions\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"version\": {}\n  }'"},"persona":"Admin","httpVerb":"POST","httpPath":"/v1/content/versions","slug":"create-a-content-version"}

Update a content version

Changed in v0.9.0 (new features): Announcements and sign-in page content can be managed through the API, and the published content can be read without signing in. Reading the versions and changing them need the admin scope or a new Platform Content Creator, Editor or Deleter role. A newly published version can take up to 30 seconds to show. A sign-in page file (CSS, JS or an image) can take up to five and a half minutes, because browsers and shared caches keep it for five minutes.

What it does: Replaces the body of a version.

Request fields:

FieldRequiredDescription
versionyesThe version to replace, by kind and id, with its new body. The body replaces the stored body. Publication does not change.
idyesUUID of the version.

Response fields:

FieldRequiredDescription
versionnoThe changed version.
{"signatures":{"go":"c.Content().UpdateContentVersion(ctx, \u0026contentv1.UpdateContentVersionRequest{...})","python":"client.content.updatecontentversion(...)","typescript":"client.content.updatecontentversion({...})","curl":"curl -X PATCH \"${AGENTROUTER_BASE_URL}/v1/content/versions/01H...\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"version\": {}\n  }'"},"examples":{"go":"// No Go SDK wrapper for ContentService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for ContentService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for ContentService yet -- use the CLI or curl example below.","curl":"curl -X PATCH \"${AGENTROUTER_BASE_URL}/v1/content/versions/01H...\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"version\": {}\n  }'"},"persona":"Admin","httpVerb":"PATCH","httpPath":"/v1/content/versions/{id}","slug":"update-a-content-version"}

Publish a content version

Changed in v0.9.0 (new features): Announcements and sign-in page content can be managed through the API, and the published content can be read without signing in. Reading the versions and changing them need the admin scope or a new Platform Content Creator, Editor or Deleter role. A newly published version can take up to 30 seconds to show. A sign-in page file (CSS, JS or an image) can take up to five and a half minutes, because browsers and shared caches keep it for five minutes.

What it does: Publishes a version, and unpublishes the version of the same kind that was published, in one step.

Request fields:

FieldRequiredDescription
kindyesThe kind of content. Required.
idyesUUID of the version.

Response fields:

FieldRequiredDescription
versionnoThe version, now published.
{"signatures":{"go":"c.Content().PublishContentVersion(ctx, \u0026contentv1.PublishContentVersionRequest{...})","python":"client.content.publishcontentversion(...)","typescript":"client.content.publishcontentversion({...})","curl":"curl -X POST \"${AGENTROUTER_BASE_URL}/v1/content/versions/01H...:publish\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"kind\": \"...\"\n  }'"},"examples":{"go":"// No Go SDK wrapper for ContentService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for ContentService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for ContentService yet -- use the CLI or curl example below.","curl":"curl -X POST \"${AGENTROUTER_BASE_URL}/v1/content/versions/01H...:publish\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"kind\": \"...\"\n  }'"},"persona":"Admin","httpVerb":"POST","httpPath":"/v1/content/versions/{id}:publish","slug":"publish-a-content-version"}

Unpublish a content version

Changed in v0.9.0 (new features): Announcements and sign-in page content can be managed through the API, and the published content can be read without signing in. Reading the versions and changing them need the admin scope or a new Platform Content Creator, Editor or Deleter role. A newly published version can take up to 30 seconds to show. A sign-in page file (CSS, JS or an image) can take up to five and a half minutes, because browsers and shared caches keep it for five minutes.

What it does: Unpublishes a version. Then no content of its kind shows.

Request fields:

FieldRequiredDescription
kindyesThe kind of content. Required.
idyesUUID of the version.

Response fields:

FieldRequiredDescription
versionnoThe version, now not published.
{"signatures":{"go":"c.Content().UnpublishContentVersion(ctx, \u0026contentv1.UnpublishContentVersionRequest{...})","python":"client.content.unpublishcontentversion(...)","typescript":"client.content.unpublishcontentversion({...})","curl":"curl -X POST \"${AGENTROUTER_BASE_URL}/v1/content/versions/01H...:unpublish\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"kind\": \"...\"\n  }'"},"examples":{"go":"// No Go SDK wrapper for ContentService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for ContentService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for ContentService yet -- use the CLI or curl example below.","curl":"curl -X POST \"${AGENTROUTER_BASE_URL}/v1/content/versions/01H...:unpublish\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"kind\": \"...\"\n  }'"},"persona":"Admin","httpVerb":"POST","httpPath":"/v1/content/versions/{id}:unpublish","slug":"unpublish-a-content-version"}

Delete a content version

Changed in v0.9.0 (new features): Announcements and sign-in page content can be managed through the API, and the published content can be read without signing in. Reading the versions and changing them need the admin scope or a new Platform Content Creator, Editor or Deleter role. A newly published version can take up to 30 seconds to show. A sign-in page file (CSS, JS or an image) can take up to five and a half minutes, because browsers and shared caches keep it for five minutes.

What it does: Deletes a version that is not published. A published version returns FAILED_PRECONDITION.

Request fields:

FieldRequiredDescription
kindyesThe kind of content. Required.
idyesUUID of the version.
{"signatures":{"go":"c.Content().DeleteContentVersion(ctx, \u0026contentv1.DeleteContentVersionRequest{...})","python":"client.content.deletecontentversion(...)","typescript":"client.content.deletecontentversion({...})","curl":"curl -X DELETE \"${AGENTROUTER_BASE_URL}/v1/content/versions/01H...?kind=CONTENT_KIND_ANNOUNCEMENT\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"examples":{"go":"// No Go SDK wrapper for ContentService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for ContentService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for ContentService yet -- use the CLI or curl example below.","curl":"curl -X DELETE \"${AGENTROUTER_BASE_URL}/v1/content/versions/01H...?kind=CONTENT_KIND_ANNOUNCEMENT\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"persona":"Admin","httpVerb":"DELETE","httpPath":"/v1/content/versions/{id}","slug":"delete-a-content-version"}

Get the published content

Changed in v0.9.0 (new features): Announcements and sign-in page content can be managed through the API, and the published content can be read without signing in. Reading the versions and changing them need the admin scope or a new Platform Content Creator, Editor or Deleter role. A newly published version can take up to 30 seconds to show. A sign-in page file (CSS, JS or an image) can take up to five and a half minutes, because browsers and shared caches keep it for five minutes.

What it does: Returns the published version of a kind, or one file of the published sign-in content. It needs no credential: the sign-in page shows it before anyone signs in.

Request fields:

FieldRequiredDescription
kindyesThe kind of content. Required.
file_namenoFor sign-in content: return only this file of the published version.

Response fields:

FieldRequiredDescription
versionnoThe published version. Absent when no version of the kind is published, and when the request names a file.
filenoThe file the request names. A file that the published version does not have returns NOT_FOUND.
{"signatures":{"go":"c.Content().GetPublishedContent(ctx, \u0026contentv1.GetPublishedContentRequest{...})","python":"client.content.getpublishedcontent(...)","typescript":"client.content.getpublishedcontent({...})","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/content/published?kind=CONTENT_KIND_ANNOUNCEMENT\""},"examples":{"go":"// No Go SDK wrapper for ContentService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for ContentService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for ContentService yet -- use the CLI or curl example below.","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/content/published?kind=CONTENT_KIND_ANNOUNCEMENT\""},"persona":"Public (no credential required)","httpVerb":"GET","httpPath":"/v1/content/published","slug":"get-the-published-content"}