curl --request PUT \
--url https://api.nohead.io/v1/records/{record_id}/schedule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"publish_at": "2023-11-07T05:31:56Z",
"unpublish_at": "2023-11-07T05:31:56Z"
}
'import { Nohead } from "@nohead/sdk"
const nohead = new Nohead()
const result = await nohead.records.schedule("rec_01J9ZQ3F8X", {
publish_at: "2027-01-01T00:00:00Z",
})
from nohead import Nohead
nohead = Nohead()
result = nohead.records.schedule("rec_01J9ZQ3F8X", publish_at="2027-01-01T00:00:00Z")
require "nohead"
nohead = Nohead::Client.new
result = nohead.records.schedule("rec_01J9ZQ3F8X", publish_at: Time.utc(2027, 1, 1))
{
"object": "schedule",
"record_id": "<string>",
"publish_at": "2023-11-07T05:31:56Z",
"unpublish_at": "2023-11-07T05:31:56Z",
"last_error": "<string>"
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"request_id": "req_01J9ZQ3F8X5W2K7M4N6P0R1S2T",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>",
"usage": 123,
"limit": 123,
"current_revision": 123,
"record_id": "<string>",
"draft_id": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"request_id": "req_01J9ZQ3F8X5W2K7M4N6P0R1S2T",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>",
"usage": 123,
"limit": 123,
"current_revision": 123,
"record_id": "<string>",
"draft_id": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"request_id": "req_01J9ZQ3F8X5W2K7M4N6P0R1S2T",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>",
"usage": 123,
"limit": 123,
"current_revision": 123,
"record_id": "<string>",
"draft_id": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"request_id": "req_01J9ZQ3F8X5W2K7M4N6P0R1S2T",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>",
"usage": 123,
"limit": 123,
"current_revision": 123,
"record_id": "<string>",
"draft_id": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"request_id": "req_01J9ZQ3F8X5W2K7M4N6P0R1S2T",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>",
"usage": 123,
"limit": 123,
"current_revision": 123,
"record_id": "<string>",
"draft_id": "<string>"
}
]
}
}{
"error": {
"type": "validation_error",
"message": "Record validation failed",
"request_id": "req_01J9ZQ3F8X5W2K7M4N6P0R1S2T",
"details": [
{
"field": "title",
"code": "required",
"message": "is required"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"request_id": "req_01J9ZQ3F8X5W2K7M4N6P0R1S2T",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>",
"usage": 123,
"limit": 123,
"current_revision": 123,
"record_id": "<string>",
"draft_id": "<string>"
}
]
}
}Schedule publishing or unpublishing
Publishes (publish_at) or unpublishes (unpublish_at) the record at
a future time (records:write). The change is made within a minute of
the time, like a manual publish from the scheduler: it has its own
revision (via: scheduler), webhooks and audit event. publish_at
needs an unpublished record; unpublish_at needs a published record or a
publish_at before it. Setting or cancelling a schedule is audited but
makes no revision. 409 with detail code deleted while the record is
soft-deleted.
Replaces the whole schedule: a time left out, or null, is none, so
both left out cancel it as DELETE does. Setting the schedule the
record already has changes nothing and records no event. Publishing
the record by hand clears publish_at, and unpublishing it clears
unpublish_at.
A scheduled change that can’t be made when it is due (the record is
live with a pending draft, say) is dropped: its time is cleared, the
schedule’s last_error says why, and record.schedule_failed is
recorded. One due while a field migration runs on the collection is
made once the migration finishes.
curl --request PUT \
--url https://api.nohead.io/v1/records/{record_id}/schedule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"publish_at": "2023-11-07T05:31:56Z",
"unpublish_at": "2023-11-07T05:31:56Z"
}
'import { Nohead } from "@nohead/sdk"
const nohead = new Nohead()
const result = await nohead.records.schedule("rec_01J9ZQ3F8X", {
publish_at: "2027-01-01T00:00:00Z",
})
from nohead import Nohead
nohead = Nohead()
result = nohead.records.schedule("rec_01J9ZQ3F8X", publish_at="2027-01-01T00:00:00Z")
require "nohead"
nohead = Nohead::Client.new
result = nohead.records.schedule("rec_01J9ZQ3F8X", publish_at: Time.utc(2027, 1, 1))
{
"object": "schedule",
"record_id": "<string>",
"publish_at": "2023-11-07T05:31:56Z",
"unpublish_at": "2023-11-07T05:31:56Z",
"last_error": "<string>"
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"request_id": "req_01J9ZQ3F8X5W2K7M4N6P0R1S2T",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>",
"usage": 123,
"limit": 123,
"current_revision": 123,
"record_id": "<string>",
"draft_id": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"request_id": "req_01J9ZQ3F8X5W2K7M4N6P0R1S2T",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>",
"usage": 123,
"limit": 123,
"current_revision": 123,
"record_id": "<string>",
"draft_id": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"request_id": "req_01J9ZQ3F8X5W2K7M4N6P0R1S2T",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>",
"usage": 123,
"limit": 123,
"current_revision": 123,
"record_id": "<string>",
"draft_id": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"request_id": "req_01J9ZQ3F8X5W2K7M4N6P0R1S2T",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>",
"usage": 123,
"limit": 123,
"current_revision": 123,
"record_id": "<string>",
"draft_id": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"request_id": "req_01J9ZQ3F8X5W2K7M4N6P0R1S2T",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>",
"usage": 123,
"limit": 123,
"current_revision": 123,
"record_id": "<string>",
"draft_id": "<string>"
}
]
}
}{
"error": {
"type": "validation_error",
"message": "Record validation failed",
"request_id": "req_01J9ZQ3F8X5W2K7M4N6P0R1S2T",
"details": [
{
"field": "title",
"code": "required",
"message": "is required"
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"request_id": "req_01J9ZQ3F8X5W2K7M4N6P0R1S2T",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>",
"usage": 123,
"limit": 123,
"current_revision": 123,
"record_id": "<string>",
"draft_id": "<string>"
}
]
}
}Authorizations
Project-scoped API key, e.g. nohead_sk_k7fz0a9c3m2q_<secret>, or
nohead_pk_… for a published-only key. Used by servers, CI, the CLI
and coding agents.
Headers
A unique value (1-255 printable ASCII characters) that makes retrying
this request safe. The first response (below 500) is stored for 24
hours per user or API key; retries with the same key and the same
request get it again with an Idempotent-Replayed: true header. The
same key with a different request is refused with 400; a retry while
the first request is still running gets 409.
1 - 255First-party client identifier recorded in history (e.g. cli/0.3.1). Informational only.
Path Parameters
Body
Response
The record's schedule.
When the record publishes or unpublishes on its own (within a minute of
the time), set with PUT /v1/records/{record_id}/schedule. A time is
cleared once it has run, or once the record is published or
unpublished by hand or deleted. last_error explains the last
scheduled change that could not be made, until a new schedule is set
or a scheduled change is made.