PDC tracks every modification that was made through any of the API end-points. This provides an auditable trail of who changed what and when.

Each request to the API creates one Changeset, which contains one or more Changes.

Each ChangeSet carries metadata about author and date. Optionally, there can also be a comment, which is an arbitrary string. It is extracted from the PDC-Change-Comment HTTP header in the request.

A Change has information about which database model was changed, its primary key and old and new value (provided as a JSON). If both the values are provided, the Change represents an update in some of the fields. If only new value is provided, the Change represents creation of new entity. If only old value is non-null, an entity was deleted.

This page shows the usage of the Changeset API, please see the following for more details. The access to this data is read-only. It is possible to either request all changesets satisfying given criteria, or view detail of a particular changeset.

Documents & examples

Method: GET

URL: /rest_api/v1/changesets/

Query Params:

  • author (string)
  • changed_since (string)
  • changed_until (string)
  • comment (string, substring match)
  • resource (string)
  • ordering (string) Comma separated list of fields for ordering results.
    • To sort by a field in descending order, prefix its name with minus (e.g. -name).
    • Use double underscores for nested field names (e.g. parent__child for {"parent": {"child": ...}}).

Following filters can be used to show only specific fields. This can make response time faster. Format is list or single value (JSON: {"fields": ["a","b"]} or {"fields": "a"}, in URL: ?fields=a&fields=b).

  • fields (list | string) Fields to display (other fields will be hidden).
  • exclude_fields: (list | string) Fields NOT to display (overrules fields).

The dates for changed_since and changed_until should have one these formats:

Format               | Example
---------------------+---------------------------
%Y-%m-%d %H:%M:%S    | 2006-10-25 14:30:59
%Y-%m-%d %H:%M:%S.%f | 2006-10-25 14:30:59.000200
%Y-%m-%d %H:%M       | 2006-10-25 14:30
%Y-%m-%d             | 2006-10-25

Resource names for resource should be specified in all lower case.

Response: a paged list of following objects

{
    "author (read-only)": "string", 
    "changes (read-only)": [
        {
            "new_value": "string", 
            "old_value": "string", 
            "resource": "string", 
            "resource_id": "string"
        }
    ], 
    "comment (optional, default=null, nullable)": "string", 
    "committed_on (read-only)": "datetime", 
    "duration (read-only)": "data", 
    "id (read-only)": "int", 
    "requested_on": "datetime"
}

The unit for duration is second.

Example:

curl -H "Content-Type: application/json"  -X GET https://pdc.fedoraproject.org/rest_api/v1/changesets/
# output
{
    "count": 84,
    "next": "https://pdc.fedoraproject.org/rest_api/v1/changesets/?page=2",
    "previous": null,
    "results": [
        {
            {
                "author": "xxx",
                "requested_on": "2015-02-03T05:50:49.387Z",
                "committed_on": "2015-02-03T05:51:17.262Z",
                "duration": "27.875",
                "changes": [
                    {
                        "id": 1
                        "resource": "person",
                        "resource_id": "2",
                        "old_value": "old",
                        "new_value": "new"
                    }
                ],
                "comment": "xxx"
            }
        },
        ...
    ]
}

With query params:

curl -H "Content-Type: application/json"  -G https://pdc.fedoraproject.org/rest_api/v1/changesets/ --data-urlencode "resource=test"
# output
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
            {
                "id": 1
                "author": "xxx",
                "requested_on": "2015-02-03T05:50:49.387Z",
                "committed_on": "2015-02-03T05:51:17.262Z",
                "duration": "27.875",
                "changes": [
                    {
                        "resource": "person",
                        "resource_id": "2",
                        "old_value": "old",
                        "new_value": "new"
                    }
                ],
                "comment": "xxx"
            }
    ]
}

Method: GET

URL: /rest_api/v1/changesets/{instance_pk}/

Response:

{
    "author (read-only)": "string", 
    "changes (read-only)": [
        {
            "new_value": "string", 
            "old_value": "string", 
            "resource": "string", 
            "resource_id": "string"
        }
    ], 
    "comment (optional, default=null, nullable)": "string", 
    "committed_on (read-only)": "datetime", 
    "duration (read-only)": "data", 
    "id (read-only)": "int", 
    "requested_on": "datetime"
}

The unit for duration is second.

Example:

curl -H "Content-Type: application/json" https://pdc.fedoraproject.org/rest_api/v1/changesets/1/
# output
{
    "id": 1,
    "author": "xxx",
    "requested_on": "2015-02-03T05:50:49.387Z",
    "committed_on": "2015-02-03T05:51:17.262Z",
    "duration": "27.875",
    "changes": [
       {
           "resource": "person",
           "resource_id": "2",
           "old_value": "old",
           "new_value": "new"
       }
    ],
    "comment": "xxx"
}

Browsable GET

GET /rest_api/v1/changesets/
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "count": 2802051,
    "next": "https://pdc.fedoraproject.org/rest_api/v1/changesets/?page=2",
    "previous": null,
    "results": [
        {
            "id": 2802052,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:57:14.237335Z",
            "committed_on": "2024-07-14T15:57:14.257020Z",
            "duration": "0.019685",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "1389596",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"security_fixes\", \"branch\": \"f39\", \"eol\": \"2024-11-12\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 2802051,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:57:14.173256Z",
            "committed_on": "2024-07-14T15:57:14.194152Z",
            "duration": "0.020896",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "1389595",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"bug_fixes\", \"branch\": \"f39\", \"eol\": \"2024-11-12\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 2802050,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:57:14.112159Z",
            "committed_on": "2024-07-14T15:57:14.129719Z",
            "duration": "0.01756",
            "changes": [
                {
                    "resource": "componentbranch",
                    "resource_id": "693198",
                    "old_value": "null",
                    "new_value": "{\"type_name\": \"rpm\", \"global_component_name\": \"rust-minicbor-derive\", \"name\": \"f39\", \"critical_path\": false, \"slas\": []}"
                }
            ],
            "comment": null
        },
        {
            "id": 2802049,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:56:54.628756Z",
            "committed_on": "2024-07-14T15:56:54.648219Z",
            "duration": "0.019463",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "1389594",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"security_fixes\", \"branch\": \"f40\", \"eol\": \"2025-05-13\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 2802048,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:56:54.569504Z",
            "committed_on": "2024-07-14T15:56:54.589629Z",
            "duration": "0.020125",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "1389593",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"bug_fixes\", \"branch\": \"f40\", \"eol\": \"2025-05-13\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 2802047,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:56:54.510626Z",
            "committed_on": "2024-07-14T15:56:54.527083Z",
            "duration": "0.016457",
            "changes": [
                {
                    "resource": "componentbranch",
                    "resource_id": "693197",
                    "old_value": "null",
                    "new_value": "{\"type_name\": \"rpm\", \"global_component_name\": \"rust-minicbor-derive\", \"name\": \"f40\", \"critical_path\": false, \"slas\": []}"
                }
            ],
            "comment": null
        },
        {
            "id": 2802046,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:56:27.344558Z",
            "committed_on": "2024-07-14T15:56:27.365663Z",
            "duration": "0.021105",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "1389592",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"security_fixes\", \"branch\": \"f39\", \"eol\": \"2024-11-12\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 2802045,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:56:27.282031Z",
            "committed_on": "2024-07-14T15:56:27.302242Z",
            "duration": "0.020211",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "1389591",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"bug_fixes\", \"branch\": \"f39\", \"eol\": \"2024-11-12\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 2802044,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:56:27.162575Z",
            "committed_on": "2024-07-14T15:56:27.182020Z",
            "duration": "0.019445",
            "changes": [
                {
                    "resource": "componentbranch",
                    "resource_id": "693196",
                    "old_value": "null",
                    "new_value": "{\"type_name\": \"rpm\", \"global_component_name\": \"golang-github-mesilliac-pulse-simple\", \"name\": \"f39\", \"critical_path\": false, \"slas\": []}"
                }
            ],
            "comment": null
        },
        {
            "id": 2802043,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:55:44.735973Z",
            "committed_on": "2024-07-14T15:55:44.753911Z",
            "duration": "0.017938",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "1389590",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"security_fixes\", \"branch\": \"f40\", \"eol\": \"2025-05-13\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 2802042,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:55:44.588125Z",
            "committed_on": "2024-07-14T15:55:44.684947Z",
            "duration": "0.096822",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "1389589",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"bug_fixes\", \"branch\": \"f40\", \"eol\": \"2025-05-13\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 2802041,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:55:44.484062Z",
            "committed_on": "2024-07-14T15:55:44.505486Z",
            "duration": "0.021424",
            "changes": [
                {
                    "resource": "componentbranch",
                    "resource_id": "693195",
                    "old_value": "null",
                    "new_value": "{\"type_name\": \"rpm\", \"global_component_name\": \"golang-github-mesilliac-pulse-simple\", \"name\": \"f40\", \"critical_path\": false, \"slas\": []}"
                }
            ],
            "comment": null
        },
        {
            "id": 2802040,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:55:17.062545Z",
            "committed_on": "2024-07-14T15:55:17.084559Z",
            "duration": "0.022014",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "1389588",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"security_fixes\", \"branch\": \"f39\", \"eol\": \"2024-11-12\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 2802039,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:55:16.999009Z",
            "committed_on": "2024-07-14T15:55:17.021127Z",
            "duration": "0.022118",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "1389587",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"bug_fixes\", \"branch\": \"f39\", \"eol\": \"2024-11-12\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 2802038,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:55:16.940527Z",
            "committed_on": "2024-07-14T15:55:16.957252Z",
            "duration": "0.016725",
            "changes": [
                {
                    "resource": "componentbranch",
                    "resource_id": "693194",
                    "old_value": "null",
                    "new_value": "{\"type_name\": \"rpm\", \"global_component_name\": \"rust-x509-certificate\", \"name\": \"f39\", \"critical_path\": false, \"slas\": []}"
                }
            ],
            "comment": null
        },
        {
            "id": 2802037,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:54:45.288546Z",
            "committed_on": "2024-07-14T15:54:45.314360Z",
            "duration": "0.025814",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "1389586",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"security_fixes\", \"branch\": \"f40\", \"eol\": \"2025-05-13\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 2802036,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:54:45.223478Z",
            "committed_on": "2024-07-14T15:54:45.247217Z",
            "duration": "0.023739",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "1389585",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"bug_fixes\", \"branch\": \"f40\", \"eol\": \"2025-05-13\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 2802035,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:54:45.160113Z",
            "committed_on": "2024-07-14T15:54:45.175483Z",
            "duration": "0.01537",
            "changes": [
                {
                    "resource": "componentbranch",
                    "resource_id": "693193",
                    "old_value": "null",
                    "new_value": "{\"type_name\": \"rpm\", \"global_component_name\": \"rust-x509-certificate\", \"name\": \"f40\", \"critical_path\": false, \"slas\": []}"
                }
            ],
            "comment": null
        },
        {
            "id": 2802034,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:53:22.588586Z",
            "committed_on": "2024-07-14T15:53:22.607715Z",
            "duration": "0.019129",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "1389584",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"security_fixes\", \"branch\": \"f39\", \"eol\": \"2024-11-12\"}"
                }
            ],
            "comment": null
        },
        {
            "id": 2802033,
            "author": "_48db0945906e4ceda1da223bd8f2df82",
            "requested_on": "2024-07-14T15:53:22.530384Z",
            "committed_on": "2024-07-14T15:53:22.549901Z",
            "duration": "0.019517",
            "changes": [
                {
                    "resource": "slatocomponentbranch",
                    "resource_id": "1389583",
                    "old_value": "null",
                    "new_value": "{\"sla\": \"bug_fixes\", \"branch\": \"f39\", \"eol\": \"2024-11-12\"}"
                }
            ],
            "comment": null
        }
    ]
}