---
title: "Validate or reject an harvest source"
method: POST
path: "/harvest/source/{source}/validate/"
tags: ["harvest"]
---

# Validate or reject an harvest source

`POST /harvest/source/{source}/validate/`

## Request

- Base URL: `https://dados.gov.pt/api/1`
- URL: `https://dados.gov.pt/api/1/harvest/source/{source}/validate/`
- Auth: none declared

## Headers

- `X-Fields` string, mask

## Request body

- HarvestSourceValidation
  - `by` UserReference
    - `class` string, required: The object class
    - `id` string, required: The object unique identifier
    - `avatar` string: The user avatar URL
    - `avatar_thumbnail` string: The user avatar thumbnail URL. This is the square (500x500) and cropped version.
    - `first_name` string: The user first name
    - `last_name` string: The user larst name
    - `page` string: The user web page URL
    - `slug` string: The user permalink string
    - `uri` string: The API URI for this user
  - `comment` string: A comment about the validation. Required on rejection
  - `on` string, date-time: Date date on which validation was performed
  - `state` 'pending' | 'accepted' | 'refused', required: Is it validated or not

## Response `200`

Success

- HarvestSource
  - `active` boolean, required: Is this source active
  - `autoarchive` boolean, required: If enabled, datasets not present on the remote source will be automatically archived
  - `backend` 'ckan' | 'ckanpt' | 'csw-dcat' | 'csw-iso-19139' | 'cswudata' | 'dcat' | 'dgt' | 'dkan' | 'ine' | 'inehvd' | 'odspt' | 'ogc', required: The source backend
  - `config` object: The configuration as key-value pairs, served only to readers who may edit the source
  - `created_at` string, date-time, required: The source creation date
  - `datasets_count` integer: Number of datasets harvested by this source
  - `deleted` string, date-time: The source deletion date
  - `description` string, markdown: The source description
  - `id` string: The source unique identifier
  - `last_job` HarvestJob
    - `created` string, date-time, required: The job creation date
    - `ended` string, date-time: The job end date
    - `errors` HarvestError[]: The job initialization errors
      - `level` string, required
      - `message` string, required
    - `id` string, required: The job execution ID
    - `items` HarvestItem[]: The job collected items
      - `args` string[]: The item positional arguments
      - `created` string, date-time, required: The item creation date
      - `dataservice` DataserviceReference
        - `class` string, required: The object class
        - `id` string, required: The object unique identifier
        - `self_api_url` string: Link to the API endpoint for this dataservice
        - `self_web_url` string: Link to the udata web page for this dataservice
        - `title` string, required
      - `dataset` DatasetReference
        - `class` string, required: The object class
        - `id` string, required: The object unique identifier
      - `ended` string, date-time: The item end date
      - `errors` HarvestError[]: The item errors
        - `level` string, required
        - `message` string, required
      - `kwargs` object: The item keyword arguments
      - `logs` HarvestError[]: The item logs
        - `level` string, required
        - `message` string, required
      - `remote_id` string, required: The item remote ID to process
      - `remote_url` string: The item remote url (if available)
      - `started` string, date-time: The item start date
      - `status` 'pending' | 'started' | 'done' | 'failed' | 'skipped' | 'archived', required: The item status
    - `source` string, required: The source owning the job
    - `started` string, date-time: The job start date
    - `status` 'pending' | 'initializing' | 'initialized' | 'processing' | 'done' | 'done-errors' | 'failed', required: The job status
  - `name` string, required: The source display name
  - `organization` OrganizationReference
    - `class` string, required: The object class
    - `id` string, required: The object unique identifier
    - `acronym` string: The organization acronym
    - `badges` BadgeRead[]: The organization badges
      - `kind` string, required
    - `logo` string: The organization logo URL
    - `logo_thumbnail` string: The organization logo thumbnail URL. This is the square (100x100) and cropped version.
    - `name` string: The organization name
    - `page` string: The organization web page URL
    - `permissions` OrganizationPermissions
      - `delete` boolean
      - `edit` boolean
      - `harvest` boolean
      - `members` boolean
      - `private` boolean
    - `slug` string: The organization string used as permalink
    - `uri` string: The API URI for this organization
  - `owner` UserReference
    - `class` string, required: The object class
    - `id` string, required: The object unique identifier
    - `avatar` string: The user avatar URL
    - `avatar_thumbnail` string: The user avatar thumbnail URL. This is the square (500x500) and cropped version.
    - `first_name` string: The user first name
    - `last_name` string: The user larst name
    - `page` string: The user web page URL
    - `slug` string: The user permalink string
    - `uri` string: The API URI for this user
  - `permissions` HarvestSourcePermissions
    - `delete` boolean
    - `edit` boolean
    - `preview` boolean
    - `run` boolean
    - `schedule` boolean
    - `validate` boolean
  - `schedule` string: The source schedule (interval or cron expression)
  - `url` string, required: The source base URL
  - `validation` HarvestSourceValidation
    - `by` UserReference
      - `class` string, required: The object class
      - `id` string, required: The object unique identifier
      - `avatar` string: The user avatar URL
      - `avatar_thumbnail` string: The user avatar thumbnail URL. This is the square (500x500) and cropped version.
      - `first_name` string: The user first name
      - `last_name` string: The user larst name
      - `page` string: The user web page URL
      - `slug` string: The user permalink string
      - `uri` string: The API URI for this user
    - `comment` string: A comment about the validation. Required on rejection
    - `on` string, date-time: Date date on which validation was performed
    - `state` 'pending' | 'accepted' | 'refused', required: Is it validated or not

## Changes

- **2026-09-11** `1175d034be00`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/dados/apis/udata-api/changes/harvest/source/:source/validate/post.md)

---

[API](https://skmtc.dev/dados/apis/udata-api.md) - [All operations](https://skmtc.dev/dados/apis/udata-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dados/apis/udata-api/revisions/77edaf8a00ea?raw)
