/dataset/record/public - Change a record’s public status

View as Markdown
Changes the public status of a dataset record. By default, calling this endpoint immediately makes the record public. An optional `public_date` parameter can be used to schedule a future publish date, or to set the record back to "not public". ## Authentication A pre-request script automatically fetches a bearer token before each request: 1. POSTs to `{{url}}/token` with `{{apiuser}}` and `{{apipass}}` credentials 2. Stores the returned token in `{{token}}` 3. The token is sent as a `Bearer` token in the `Authorization` header ## Request Body (form-data) | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `user_email` | string | Yes | Email address of the user performing the action | | `dataset_uuid` | string | Yes | UUID of the dataset that contains the record | | `record_uuid` | string | Yes | UUID of the record whose public status is being changed | | `public_date` | string | No | ISO 8601 / parseable date string. If provided, sets the record's public date to this value. If omitted, the record is made public immediately. Pass a date in the past or a special "not public" value to unpublish the record. | ## Behavior The server resolves the public date using the following logic: ``` php // Calculate the Public Date if (isset($data['public_date'])) { $public_date = new \DateTime($data['public_date']); } else { $public_date = new \DateTime(); } ``` - If `public_date` is **not provided**, the record is made public immediately (current date/time). - If `public_date` **is provided**, the record's public date is set to that value — this can be used to schedule future publication or to revert a record to a non-public state. ## Example Request ``` POST {{url}}/dataset/record/public Authorization: Bearer {{token}} Content-Type: multipart/form-data user_email=nate@opendatarepository.org dataset_uuid=97cc0e66113bffe821be19ee27ef record_uuid=be6224d42961852bcdd6c5899970 ``` ## Response A successful request returns HTTP `200 OK`. The response body confirms the updated public status of the record.

Request

This endpoint expects a multipart form.
user_emailstringRequired
dataset_uuidstringRequired
record_uuidstringRequired

Response headers

Access-Control-Allow-OriginstringOptional
Access-Control-Allow-MethodsstringOptional
Access-Control-Allow-HeadersstringOptional
Access-Control-Expose-HeadersstringOptional
Access-Control-Max-AgestringOptional
Cache-ControlstringOptional
X-Debug-TokenstringOptional
Keep-AlivestringOptional

Response

OK
database_uuidstring
internal_idinteger
record_nameinteger
record_uuidstring
template_uuidstring
metadata_for_uuidstring
_record_metadataobject
fieldslist of objects
recordslist of objects