Pagure API Reference

This documentation describes the Pagure API v0 revision ..

Authentication

To access some endpoints, you need to login to Pagure using API token. You can generate one in the project setting page.

When sending HTTP request, include an Authorization field in the header with value token $your-api-token, where $your-api-token is the API token generated in the project setting page.

So the result should look like:

Authorization: token abcdefghijklmnop

Where abcdefghijklmnop is the API token provided by pagure.

Anyone with the token can access the APIs on your behalf, so please be sure to keep it private and safe.

Request Encoding

The payload of POST and GET requests is encoded as

application/x-www-form-urlencoded.

This is an example URL of a GET request:

https://pagure.io/api/0/test/issues?status=Open&tags=Pagure&tags=Enhancement

Return Encoding

The return value of API calls is application/json. This is an example of return value:

{
  "args": {
    "assignee": null,
    "author": null,
    "status": null,
    "tags": []
  },
  "issues": [
    {
      "assignee": null,
      "blocks": [],
      "comments": [],
      "content": "Sample ticket",
      "date_created": "1434266418",
      "depends": [],
      "id": 4,
      "private": false,
      "status": "Open",
      "tags": [],
      "title": "This is a sample",
      "user": {
        "fullname": "Pagure",
        "name": "API"
      }
    }
  ]
}

List of the API endpoints:

Projects

 Create a new project

Create a new project on this pagure instance.

This is an asynchronous call.

POST /api/0/new

Input

Key Type Optionality Description
name string Mandatory
The name of the new project.
description string Mandatory
A short description of the new project.
namespace string Optional
The namespace of the project to fork.
url string Optional
An url providing more information about the project.
avatar_email string Optional
An email address for the avatar of the project.
create_readme boolean Optional
A boolean to specify if there should be a readme added to the project on creation.
private boolean Optional
A boolean to specify if the project to create is private. Note: not all pagure instance support private projects, confirm this with your administrators
ignore_existing_repos boolean Optional
Only available to admins this option allows them to make project creation pass even if there is already a coresopnding git repository on disk
repospanner_region boolean Optional
Only available to admins this option allows them to override the default respoSpanner region configured
wait boolean Optional
A boolean to specify if this API call should return a taskid or if it should wait for the task to finish.

Sample response

wait=False:
{
  'message': 'Project creation queued',
  'taskid': '123-abcd'
}

wait=True:
{
  'message': 'Project creation queued'
}

 Modify a project

Modify an existing project on this Pagure instance.

PATCH /api/0/<repo>

Input

Key Type Optionality Description
main_admin string Mandatory
The new main admin of the project.
retain_access string Optional
The old main admin retains access on the project when giving the project. Defaults to False.

Sample response

{
  "access_groups": {
    "admin": [],
    "commit": [],
    "ticket": []
  },
  "access_users": {
    "admin": [],
    "commit": [],
    "owner": [
      "testuser1"
    ],
    "ticket": []
  },
  "close_status": [],
  "custom_keys": [],
  "date_created": "1496326387",
  "description": "Test",
  "fullname": "test-project2",
  "id": 2,
  "milestones": {},
  "name": "test-project2",
  "namespace": null,
  "parent": null,
  "priorities": {},
  "tags": [],
  "user": {
    "default_email": "testuser1@domain.local",
    "emails": [],
    "fullname": "Test User1",
    "name": "testuser1"
  }
}

 Project information

Return information about a specific project

GET /api/0/<repo>
GET /api/0/<namespace>/<repo>
GET /api/0/fork/<username>/<repo>
GET /api/0/fork/<username>/<namespace>/<repo>

Sample response

{
  "access_groups": {
    "admin": [],
    "commit": [],
    "ticket": []
  },
  "access_users": {
    "admin": [
      "ryanlerch"
    ],
    "commit": [
      "puiterwijk"
    ],
    "owner": [
      "pingou"
    ],
    "ticket": [
      "vivekanand1101",
      "mprahl",
      "jcline",
      "lslebodn",
      "cverna",
      "farhaan"
    ]
  },
  "close_status": [
    "Invalid",
    "Insufficient data",
    "Fixed",
    "Duplicate"
  ],
  "custom_keys": [],
  "date_created": "1431549490",
  "date_modified": "1431549490",
  "description": "A git centered forge",
  "fullname": "pagure",
  "id": 10,
  "milestones": {},
  "name": "pagure",
  "namespace": null,
  "parent": null,
  "priorities": {},
  "tags": [
    "pagure",
    "fedmsg"
  ],
  "user": {
    "fullname": "Pierre-YvesChibon",
    "name": "pingou"
  }
}

 List projects

Search projects given the specified criterias.

GET /api/0/projects
GET /api/0/projects?tags=fedora-infra
GET /api/0/projects?page=1&per_page=50

Parameters

Key Type Optionality Description
tags string Optional
Filters the projects returned by their tags
pattern string Optional
Filters the projects by the pattern string
username string Optional
Filters the projects returned by the users having commit rights to it
owner string Optional
Filters the projects by ownership. If the argument is of the form <!owner> then the project returned are the ones not owned by this user.
namespace string Optional
Filters the projects by namespace
fork boolean Optional
Filters the projects returned depending if they are forks or not
short boolean Optional
Whether to return the entrie project JSON or just a sub-set
page int Optional
Specifies which page to return (defaults to: 1)
per_page int Optional
The number of projects to return per page. The maximum is 100.

Sample response

{
  "args": {
    "fork": null,
    "namespace": null,
    "owner": null,
    "page": 1,
    "pattern": null,
    "per_page": 2,
    "short": false,
    "tags": [],
    "username": null
  },
  "pagination": {
    "first": "http://127.0.0.1:5000/api/0/projects?per_page=2&page=1",
    "last": "http://127.0.0.1:5000/api/0/projects?per_page=2&page=500",
    "next": "http://127.0.0.1:5000/api/0/projects?per_page=2&page=2",
    "page": 1,
    "pages": 500,
    "per_page": 2,
    "prev": null
  },
  "projects": [
    {
      "access_groups": {
        "admin": [],
        "commit": [],
        "ticket": []
      },
      "access_users": {
        "admin": [],
        "commit": [],
        "owner": [
          "mprahl"
        ],
        "ticket": []
      },
      "close_status": [],
      "custom_keys": [],
      "date_created": "1498841289",
      "description": "test1",
      "fullname": "test1",
      "id": 1,
      "milestones": {},
      "name": "test1",
      "namespace": null,
      "parent": null,
      "priorities": {},
      "tags": [],
      "url_path": "test1",
      "user": {
        "fullname": "Matt Prahl",
        "name": "mprahl"
      }
    },
    {
      "access_groups": {
        "admin": [],
        "commit": [],
        "ticket": []
      },
      "access_users": {
        "admin": [],
        "commit": [],
        "owner": [
          "mprahl"
        ],
        "ticket": []
      },
      "close_status": [],
      "custom_keys": [],
      "date_created": "1499795310",
      "description": "test2",
      "fullname": "test2",
      "id": 2,
      "milestones": {},
      "name": "test2",
      "namespace": null,
      "parent": null,
      "priorities": {},
      "tags": [],
      "url_path": "test2",
      "user": {
        "fullname": "Matt Prahl",
        "name": "mprahl"
      }
    }
  ],
  "total_projects": 1000
}

 Project git tags

List the tags made on the project Git repository.

GET /api/0/<repo>/git/tags
GET /api/0/<namespace>/<repo>/git/tags
GET /api/0/fork/<username>/<repo>/git/tags
GET /api/0/fork/<username>/<namespace>/<repo>/git/tags

Parameters

Key Type Optionality Description
with_commits string Optional
Include the commit hash corresponding to the tags found in the repo

Sample response

{
  "total_tags": 2,
  "tags": ["0.0.1", "0.0.2"]
}


{
  "total_tags": 2,
  "tags": {
    "0.0.1": "bb8fa2aa199da08d6085e1c9badc3d83d188d38c",
    "0.0.2": "d16fe107eca31a1bdd66fb32c6a5c568e45b627e"
  }
}

 Project Git URLs

List the Git URLS on the project.

GET /api/0/<repo>/git/urls
GET /api/0/<namespace>/<repo>/git/urls
GET /api/0/fork/<username>/<repo>/git/urls
GET /api/0/fork/<username>/<namespace>/<repo>/git/urls

Sample response

{
    "total_urls": 2,
    "urls": {
        "ssh": "ssh://git@pagure.io/mprahl-test123.git",
        "git": "https://pagure.io/mprahl-test123.git"
    }
}

 Project watchers

List the watchers on the project.

GET /api/0/<repo>/watchers
GET /api/0/<namespace>/<repo>/watchers
GET /api/0/fork/<username>/<repo>/watchers
GET /api/0/fork/<username>/<namespace>/<repo>/watchers

Sample response

{
    "total_watchers": 1,
    "watchers": {
        "mprahl": [
            "issues",
            "commits"
        ]
    }
}

 List project branches

List the branches associated with a Pagure git repository

GET /api/0/<repo>/git/branches
GET /api/0/<namespace>/<repo>/git/branches
GET /api/0/fork/<username>/<repo>/git/branches
GET /api/0/fork/<username>/<namespace>/<repo>/git/branches

Parameters

Key Type Optionality Description
with_commits boolean Optional
Include the commit hash corresponding to the HEAD of each branch

Sample response

{
  "total_branches": 2,
  "branches": ["master", "dev"]
}

{
  "total_branches": 2,
  "branches": {
    "master": "16ae2a4df107658b52750063ae203f978cf02ff7",
    "dev": "8351c460167a41defc393f5b6c1d51fe1b3b82b8"
  }
}

 Fork a project

Fork a project on this pagure instance.

This is an asynchronous call.

POST /api/0/fork

Input

Key Type Optionality Description
repo string Mandatory
The name of the project to fork.
namespace string Optional
The namespace of the project to fork.
username string Optional
The username of the user of the fork.
wait boolean Optional
A boolean to specify if this API call should return a taskid or if it should wait for the task to finish.

Sample response

wait=False:
{
  "message": "Project forking queued",
  "taskid": "123-abcd"
}

wait=True:
{
  "message": 'Repo "test" cloned to "pingou/test"
}

 Modify ACLs on a project

Add, remove or update ACLs on a project for a particular user or group.

This is restricted to project admins.

POST /api/0/<repo>/git/modifyacls
POST /api/0/<namespace>/<repo>/git/modifyacls
POST /api/0/fork/<username>/<repo>/git/modifyacls
POST /api/0/fork/<username>/<namespace>/<repo>/git/modifyacls

Input

Key Type Optionality Description
user_type String Mandatory A string to specify if the ACL should be changed for a user or a group. Specifying one of either 'user' or 'group' is mandatory
name String Mandatory The name of the user or group whose ACL should be changed.
acl String Optional Can be either unspecified, 'ticket', 'commit', 'admin'. If unspecified, the access will be removed

Sample response

{
  "access_groups": {
    "admin": [],
    "commit": [],
    "ticket": []
  },
  "access_users": {
    "admin": [],
    "commit": [
      "ta2"
    ],
    "owner": [
      "karsten"
    ],
    "ticket": [
      "ta1"
    ]
  },
  "close_status": [],
  "custom_keys": [],
  "date_created": "1531131619",
  "date_modified": "1531302337",
  "description": "pagure local instance",
  "fullname": "pagure",
  "id": 1,
  "milestones": {},
  "name": "pagure",
  "namespace": null,
  "parent": null,
  "priorities": {},
  "tags": [],
  "url_path": "pagure",
  "user": {
    "fullname": "KH",
    "name": "karsten"
  }
}

 Generate Gitolite ACLs on a project

Generate Gitolite ACLs on a project. This is restricted to Pagure admins.

This is an asynchronous call.

POST /api/0/rpms/python-requests/git/generateacls

Input

Key Type Optionality Description
wait boolean Optional
A boolean to specify if this API call should return a taskid or if it should wait for the task to finish.

Sample response

wait=False:
{
  'message': 'Project ACL generation queued',
  'taskid': '123-abcd'
}

wait=True:
{
  'message': 'Project ACLs generated'
}

 Create a new git branch on a project

Create a new git branch on a project

POST /api/0/rpms/python-requests/git/branch

Input

Key Type Optionality Description
branch string Mandatory
A string of the branch to create.
from_branch string Optional
A string of the branch to branch off of. This defaults to "master". if from_commit isn't set.
from_commit string Optional
A string of the commit to branch off of.

Sample response

{
  'message': 'Project branch was created'
}

 Flags for a commit

Return all flags for given commit of given project

GET /api/0/<repo>/c/<commit_hash>/flag
GET /api/0/<namespace>/<repo>/c/<commit_hash>/flag
GET /api/0/fork/<username>/<repo>/c/<commit_hash>/flag
GET /api/0/fork/<username>/<namespace>/<repo>/c/<commit_hash>/flag

Sample response

{
  "flags": [
    {
      "comment": "flag-comment",
      "commit_hash": "28f1f7fe844301f0e5f7aecacae0a1e5ec50a090",
      "date_created": "1520341983",
      "percent": null,
      "status": "success",
      "url": "https://some.url.com",
      "user": {
        "fullname": "Full name",
        "name": "fname"
      },
      "username": "somename"
    },
    {
      "comment": "different-comment",
      "commit_hash": "28f1f7fe844301f0e5f7aecacae0a1e5ec50a090",
      "date_created": "1520512543",
      "percent": null,
      "status": "pending",
      "url": "https://other.url.com",
      "user": {
        "fullname": "Other Name",
        "name": "oname"
      },
      "username": "differentname"
    }
  ],
  "total_flags": 2
}

 Flag a commit

Add or edit flags on a commit.

POST /api/0/<repo>/c/<commit_hash>/flag
POST /api/0/<namespace>/<repo>/c/<commit_hash>/flag
POST /api/0/fork/<username>/<repo>/c/<commit_hash>/flag
POST /api/0/fork/<username>/<namespace>/<repo>/c/<commit_hash>/flag

Input

Key Type Optionality Description
username string Mandatory
The name of the application to be presented to users on the commit pages
comment string Mandatory
A short message summarizing the presented results
url string Mandatory
A URL to the result of this flag
status string Mandatory
The status of the task, can be any of: canceled, error, failure, pending, success
percent int Optional
A percentage of completion compared to the goal. The percentage also determine the background color of the flag on the pages
uid string Optional
A unique identifier used to identify a flag across all projects. If the provided UID matches an existing one, then the API call will update the existing one rather than create a new one. Maximum Length: 32 characters. Default: an auto generated UID

Sample response

{
  "flag": {
      "comment": "Tests passed",
      "commit_hash": "62b49f00d489452994de5010565fab81",
      "date_created": "1510742565",
      "percent": 100,
      "status": "success",
      "url": "http://jenkins.cloud.fedoraproject.org/",
      "user": {
        "default_email": "bar@pingou.com",
        "emails": ["bar@pingou.com", "foo@pingou.com"],
        "fullname": "PY C",
        "name": "pingou"},
      "username": "Jenkins"
    },
    "message": "Flag added",
    "uid": "b1de8f80defd4a81afe2e09f39678087"
}
{
  "flag": {
      "comment": "Tests passed",
      "commit_hash": "62b49f00d489452994de5010565fab81",
      "date_created": "1510742565",
      "percent": 100,
      "status": "success",
      "url": "http://jenkins.cloud.fedoraproject.org/",
      "user": {
        "default_email": "bar@pingou.com",
        "emails": ["bar@pingou.com", "foo@pingou.com"],
        "fullname": "PY C",
        "name": "pingou"},
      "username": "Jenkins"
    },
    "message": "Flag updated",
    "uid": "b1de8f80defd4a81afe2e09f39678087"
}

 Update project watchers

Allows anyone to update their own watch status on the project.

POST /api/0/<repo>/watchers/update
POST /api/0/<namespace>/<repo>/watchers/update
POST /api/0/fork/<username>/<repo>/watchers/update
POST /api/0/fork/<username>/<namespace>/<repo>/watchers/update

Input

Key Type Optionality Description
repo string Mandatory
The name of the project to fork.
status string Mandatory
The new watch status to set on that project. (See options below)
watcher string Mandatory
The name of the user changing their watch status.
namespace string Optional
The namespace of the project to fork.
username string Optional
The username of the user of the fork.

Watch Status

Key Description
-1 Reset the watch status to default
0 Unwatch, don't notify the user of anything
1 Watch issues and pull-requests
2 Watch commits
3 Watch commits, issues and pull-requests

Sample response

{
    "message": "You are now watching issues and PRs on this project",
    "status": "ok"
}

 Get project options

Allow project admins to retrieve the current options of a project.

GET /api/0/<repo>/options
GET /api/0/<namespace>/<repo>/options
GET /api/0/fork/<username>/<repo>/options
GET /api/0/fork/<username>/<namespace>/<repo>/options

Sample response

{
  "settings": {
    "Enforce_signed-off_commits_in_pull-request": false,
    "Minimum_score_to_merge_pull-request": -1,
    "Only_assignee_can_merge_pull-request": false,
    "Web-hooks": null,
    "always_merge": false,
    "disable_non_fast-forward_merges": false,
    "fedmsg_notifications": true,
    "issue_tracker": true,
    "issue_tracker_read_only": false,
    "issues_default_to_private": false,
    "notify_on_commit_flag": false,
    "notify_on_pull-request_flag": false,
    "open_metadata_access_to_all": false,
    "project_documentation": false,
    "pull_request_access_only": false,
    "pull_requests": true,
    "stomp_notifications": true
  },
  "status": "ok"
}

 Update project options

Allow project admins to modify the options of a project.

POST /api/0/<repo>/options/update
POST /api/0/<namespace>/<repo>/options/update
POST /api/0/fork/<username>/<repo>/options/update
POST /api/0/fork/<username>/<namespace>/<repo>/options/update

Input

Simply specify the key/values you would like to set. Beware that if you do not specify in the request values that have been changed before they will go back to their default value.

Sample response

{
    'message': 'Edited successfully settings of repo: test',
    'status': 'ok'
}

 Block an user from a project

Block an user from interacting with the project

This is restricted to project admins.

POST /api/0/<repo>/blockuser
POST /api/0/<namespace>/<repo>/blockuser
POST /api/0/fork/<username>/<repo>/blockuser
POST /api/0/fork/<username>/<namespace>/<repo>/blockuser

Input

Key Type Optionality Description
username String optional The username of the user to block on this project

Beware that this API endpoint updates all the users blocked in the project, so if you are updating this list, do not submit just one username, submit the updated list.

Sample response

{"message": "User(s) blocked"}

Issues

 Create a new issue

Open a new issue on a project.

POST /api/0/<repo>/new_issue
POST /api/0/<namespace>/<repo>/new_issue
POST /api/0/fork/<username>/<repo>/new_issue
POST /api/0/fork/<username>/<namespace>/<repo>/new_issue

Input

Key Type Optionality Description
title string Mandatory The title of the issue
issue_content string Mandatory
The description of the issue
private boolean Optional
Include this key if you want a private issue to be created
priority string Optional
The priority to set to this ticket from the list of priorities set in the project
milestone string Optional
The milestone to assign to this ticket from the list of milestones set in the project
tag string Optional
Comma separated list of tags to link to this ticket from the list of tags in the project
assignee string Optional
The username of the user to assign this ticket to

Sample response

{
  "issue": {
    "assignee": null,
    "blocks": [],
    "close_status": null,
    "closed_at": null,
    "closed_by": null,
    "comments": [],
    "content": "This issue needs attention",
    "custom_fields": [],
    "date_created": "1479458613",
    "depends": [],
    "id": 1,
    "milestone": null,
    "priority": null,
    "private": false,
    "status": "Open",
    "tags": [],
    "title": "test issue",
    "user": {
      "fullname": "PY C",
      "name": "pingou"
    }
  },
  "message": "Issue created"
}

 List project's issues

List issues of a project.

GET /api/0/<repo>/issues
GET /api/0/<namespace>/<repo>/issues
GET /api/0/fork/<username>/<repo>/issues
GET /api/0/fork/<username>/<namespace>/<repo>/issues

Parameters

Key Type Optionality Description
status string Optional
Filters the status of issues. Fetches all the issues if status is all. Default: Open
tags string Optional
A list of tags you wish to filter. If you want to filter for issues not having a tag, add an exclamation mark in front of it
assignee string Optional
Filter the issues by assignee
author string Optional
Filter the issues by creator
milestones list of strings Optional
Filter the issues by milestone
priority string Optional
Filter the issues by priority
no_stones boolean Optional
If true returns only the issues having no milestone, if false returns only the issues having a milestone
since string Optional
Filter the issues updated after this date. The date can either be provided as an unix date or in the format Y-M-D
order string Optional
Set the ordering of the issues. This can be asc or desc. Default: desc
page
int | Optional


Specifies which page to return (defaults to: 1)
per_page int Optional
The number of projects to return per page. The maximum is 100.

Sample response

{
  "args": {
    "assignee": null,
    "author": null,
    'milestones': [],
    'no_stones': null,
    'order': null,
    'priority': null,
    "since": null,
    "status": "Closed",
    "tags": [
      "0.1"
    ]
  },
  "total_issues": 1,
  "issues": [
    {
      "assignee": null,
      "blocks": ["1"],
      "close_status": null,
      "closed_at": null,
      "closed_by": null,
      "comments": [],
      "content": "asd",
      "custom_fields": [],
      "date_created": "1427442217",
      "depends": [],
      "id": 4,
      "last_updated": "1533815358",
      "milestone": null,
      "priority": null,
      "private": false,
      "status": "Fixed",
      "tags": [
        "0.1"
      ],
      "title": "bug",
      "user": {
        "fullname": "PY.C",
        "name": "pingou"
      }
    }
  ],
  'pagination': {
    'first': 'http://localhost/api/0/test/issues?per_page=20&page=1',
    'last': 'http://localhost/api/0/test/issues?per_page=20&page=1',
    'next': null,
    'page': 1,
    'pages': 1,
    'per_page': 20,
    'prev': null
  },
}

 Issue information

Retrieve information of a specific issue.

GET /api/0/<repo>/issue/<issue id>
GET /api/0/<namespace>/<repo>/issue/<issue id>
GET /api/0/fork/<username>/<repo>/issue/<issue id>
GET /api/0/fork/<username>/<namespace>/<repo>/issue/<issue id>

The identifier provided can be either the unique identifier or the regular identifier used in the UI (for example 24 in /forks/user/test/issue/24)

Sample response

{
  "assignee": null,
  "blocks": [],
  "comments": [],
  "content": "This issue needs attention",
  "date_created": "1431414800",
  "depends": ["4"],
  "id": 1,
  "private": false,
  "status": "Open",
  "tags": [],
  "title": "test issue",
  "user": {
    "fullname": "PY C",
    "name": "pingou"
  }
}

 Comment of an issue

Retrieve a specific comment of an issue.

GET /api/0/<repo>/issue/<issue id>/comment/<comment id>
GET /api/0/<namespace>/<repo>/issue/<issue id>/comment/<comment id>
GET /api/0/fork/<username>/<repo>/issue/<issue id>/comment/<comment id>
GET /api/0/fork/<username>/<namespace>/<repo>/issue/<issue id>/comment/<comment id>

The identifier provided can be either the unique identifier or the regular identifier used in the UI (for example 24 in /forks/user/test/issue/24)

Sample response

{
  "avatar_url": "https://seccdn.libravatar.org/avatar/...",
  "comment": "9",
  "comment_date": "2015-07-01 15:08",
  "date_created": "1435756127",
  "id": 464,
  "parent": null,
  "user": {
    "fullname": "P.-Y.C.",
    "name": "pingou"
  }
}

 Comment to an issue

Add a comment to an issue.

POST /api/0/<repo>/issue/<issue id>/comment
POST /api/0/<namespace>/<repo>/issue/<issue id>/comment
POST /api/0/fork/<username>/<repo>/issue/<issue id>/comment
POST /api/0/fork/<username>/<namespace>/<repo>/issue/<issue id>/comment

Input

Key Type Optionality Description
comment string Mandatory
The comment to add to the issue

Sample response

{
  "message": "Comment added"
}

 Update custom field

Update or reset the content of a custom field associated to an issue.

POST /api/0/<repo>/issue/<issue id>/custom/<field>
POST /api/0/<namespace>/<repo>/issue/<issue id>/custom/<field>
POST /api/0/fork/<username>/<repo>/issue/<issue id>/custom/<field>
POST /api/0/fork/<username>/<namespace>/<repo>/issue/<issue id>/custom/<field>

Input

Key Type Optionality Description
value string Optional The new value of the custom field of interest

Sample response

{
  "message": "Custom field adjusted"
}

 Update custom fields

Update or reset the content of a collection of custom fields associated to an issue.

POST /api/0/<repo>/issue/<issue id>/custom
POST /api/0/<namespace>/<repo>/issue/<issue id>/custom
POST /api/0/fork/<username>/<repo>/issue/<issue id>/custom
POST /api/0/fork/<username>/<namespace>/<repo>/issue/<issue id>/custom

Input

Key Type Optionality Description
myfields dict Mandatory A dictionary with the fields name as key and the value

Sample payload

{
   "myField": "to do",
   "myField_1": "test",
   "myField_2": "done",
}

Sample response

{
  "messages": [
    {
      "myField" : "Custom field myField adjusted to to do"
    },
    {
      "myField_1": "Custom field myField_1 adjusted test (was: to do)"
    },
    {
      "myField_2": "Custom field myField_1 adjusted to done (was: test)"
    }
  ]
}

 Change issue status

Change the status of an issue.

POST /api/0/<repo>/issue/<issue id>/status
POST /api/0/<namespace>/<repo>/issue/<issue id>/status
POST /api/0/fork/<username>/<repo>/issue/<issue id>/status
POST /api/0/fork/<username>/<namespace>/<repo>/issue/<issue id>/status

Input

Key Type Optionality Description
close_status string Optional The close status of the issue
status string Mandatory The new status of the issue, can be 'Open' or 'Closed'

Sample response

{
  "message": "Successfully edited issue #1"
}

 Change issue milestone

Change the milestone of an issue.

POST /api/0/<repo>/issue/<issue id>/milestone
POST /api/0/<namespace>/<repo>/issue/<issue id>/milestone
POST /api/0/fork/<username>/<repo>/issue/<issue id>/milestone
POST /api/0/fork/<username>/<namespace>/<repo>/issue/<issue id>/milestone

Input

Key Type Optionality Description
milestone string Optional The new milestone of the issue, can be any of defined milestones or empty to unset the milestone

Sample response

{
  "message": "Successfully edited issue #1"
}

 Assign an issue

Assign an issue to someone.

POST /api/0/<repo>/issue/<issue id>/assign
POST /api/0/<namespace>/<repo>/issue/<issue id>/assign
POST /api/0/fork/<username>/<repo>/issue/<issue id>/assign
POST /api/0/fork/<username>/<namespace>/<repo>/issue/<issue id>/assign

Input

Key Type Optionality Description
assignee string Mandatory
The username of the user to assign the issue to.

Sample response

{
  "message": "Issue assigned"
}

 Subscribe to an issue

Allows someone to subscribe to or unsubscribe from the notifications related to an issue.

POST /api/0/<repo>/issue/<issue id>/subscribe
POST /api/0/<namespace>/<repo>/issue/<issue id>/subscribe
POST /api/0/fork/<username>/<repo>/issue/<issue id>/subscribe
POST /api/0/fork/<username>/<namespace>/<repo>/issue/<issue id>/subscribe

Input

Key Type Optionality Description
status boolean Mandatory The intended subscription status. true for subscribing, false for unsubscribing.

Sample response

{
  "message": "User subscribed",
  "avatar_url": "https://image.png",
  "user": "pingou"
}

 List user's issues

List issues opened by or assigned to a specific user across all projects.

GET /api/0/user/<username>/issues

Parameters

Key Type Optionality Description
page integer Mandatory
The page requested. Defaults to 1.
per_page int Optional
The number of items to return per page. The maximum is 100.
status string Optional
Filters the status of issues. Fetches all the issues if status is all. Default: Open
tags string Optional
A list of tags you wish to filter. If you want to filter for issues not having a tag, add an exclamation mark in front of it
milestones list of strings Optional
Filter the issues by milestone
no_stones boolean Optional
If true returns only the issues having no milestone, if false returns only the issues having a milestone
since string Optional
Filter the issues updated after this date. The date can either be provided as an unix date or in the format Y-M-D
order string Optional
Set the ordering of the issues. This can be asc or desc. Default: desc
order_key string Optional
Set the ordering key. This can be assignee , last_updated or name of other column. Default: date_created
assignee boolean Optional
A boolean of whether to return the issues assigned to this user or not. Defaults to True
author boolean Optional
A boolean of whether to return the issues created by this user or not. Defaults to True
created string Optional
Filter the issues returned by their creation date The date can be of specified either using a timestamp format or using the iso format for dates: yyyy-mm-dd. You can specify a start and a end date to this filter using start..end.
updated string Optional
Filter the pull-requests returned by their update date. The date can be of specified either using a timestamp format or using the iso format for dates: yyyy-mm-dd. You can specify a start and a end date to this filter using start..end.
closed string Optional
Filter the pull-requests returned by their closing date. The date can be of specified either using a timestamp format or using the iso format for dates: yyyy-mm-dd. You can specify a start and a end date to this filter using start..end.

Sample response

{
  "args": {
    "assignee": true,
    "author": true,
    "milestones": [],
    "no_stones": null,
    "order": null,
    "order_key": null,
    "page": 1,
    "since": null,
    "status": null,
    "tags": [],
    "created": null,
    "updated": null,
    "closed": null,
  },
  "issues_assigned": [
    {
      "assignee": {
        "fullname": "Anar Adilova",
        "name": "anar"
      },
      "blocks": [],
      "close_status": null,
      "closed_at": null,
      "closed_by": null,
      "comments": [],
      "content": "Test Issue",
      "custom_fields": [],
      "date_created": "1510124763",
      "depends": [],
      "id": 2,
      "last_updated": "1510124763",
      "milestone": null,
      "priority": null,
      "private": false,
      "status": "Open",
      "tags": [],
      "title": "issue4",
      "user": {
        "fullname": "Anar Adilova",
        "name": "anar"
      }
    }
  ],
  "issues_created": [
    {
      "assignee": {
        "fullname": "Anar Adilova",
        "name": "anar"
      },
      "blocks": [],
      "close_status": null,
      "closed_at": null,
      "closed_by": null,
      "comments": [],
      "content": "Test Issue",
      "custom_fields": [],
      "date_created": "1510124763",
      "depends": [],
      "id": 2,
      "last_updated": "1510124763",
      "milestone": null,
      "priority": null,
      "private": false,
      "status": "Open",
      "tags": [],
      "title": "issue4",
      "user": {
        "fullname": "Anar Adilova",
        "name": "anar"
      }
    }
  ],
  "pagination_issues_assigned": {
    "first": "http://localhost:5000/api/0/user/anar/issues?per_page=1&page=1",
    "last": "http://localhost:5000/api/0/user/anar/issues?per_page=1&page=0",
    "next": null,
    "page": 1,
    "pages": 0,
    "per_page": 1,
    "prev": null
  },
  "pagination_issues_created": {
    "first": "http://localhost:5000/api/0/user/anar/issues?per_page=1&page=1",
    "last": "http://localhost:5000/api/0/user/anar/issues?per_page=1&page=200",
    "next": "http://localhost:5000/api/0/user/anar/issues?per_page=1&page=2",
    "page": 1,
    "pages": 200,
    "per_page": 1,
    "prev": null
  },
  "total_issues_assigned": 1,
  "total_issues_created": 1
}

Pull-requests

 Create pull-request

Open a new pull-request from this project to itself or its parent (if this project is a fork).

POST /api/0/<repo>/pull-request/new
POST /api/0/<namespace>/<repo>/pull-request/new
POST /api/0/fork/<username>/<repo>/pull-request/new
POST /api/0/fork/<username>/<namespace>/<repo>/pull-request/new

Input

Key Type Optionality Description
title string Mandatory The title to give to this pull-request
branch_to string Mandatory The name of the branch the submitted changes should be merged into.
branch_from string Mandatory The name of the branch containing the changes to merge
repo_from string Optional The name of the project the changes originate from. If not specified the repo_from is assumed to be the repo_to.
repo_from_username string Optional The username of the project the changes originate from. If not specified the repo_from is assumed to be the repo_to.
repo_from_namespace string Optional The namespace of the project the changes originate from. If not specified the repo_from is assumed to be the repo_to.
initial_comment string Optional The intial comment describing what these changes are about.

Sample response

{
  "assignee": null,
  "branch": "master",
  "branch_from": "master",
  "closed_at": null,
  "closed_by": null,
  "comments": [],
  "commit_start": null,
  "commit_stop": null,
  "date_created": "1431414800",
  "id": 1,
  "project": {
    "close_status": [],
    "custom_keys": [],
    "date_created": "1431414800",
    "description": "test project #1",
    "id": 1,
    "name": "test",
    "parent": null,
    "user": {
      "fullname": "PY C",
      "name": "pingou"
    }
  },
  "repo_from": {
    "date_created": "1431414800",
    "description": "test project #1",
    "id": 1,
    "name": "test",
    "parent": null,
    "user": {
      "fullname": "PY C",
      "name": "pingou"
    }
  },
  "status": "Open",
  "title": "test pull-request",
  "uid": "1431414800",
  "updated_on": "1431414800",
  "user": {
    "fullname": "PY C",
    "name": "pingou"
  }
}

 List project's Pull-Requests

Retrieve pull requests of a project.

GET /api/0/<repo>/pull-requests
GET /api/0/<namespace>/<repo>/pull-requests
GET /api/0/fork/<username>/<repo>/pull-requests
GET /api/0/fork/<username>/<namespace>/<repo>/pull-requests

Parameters

Key Type Optionality Description
status string Optional
Filter the status of pull requests. Default: True (opened pull requests), can be 0 or closed for closed requests or Merged for merged requests. All returns closed, merged and open requests.
assignee string Optional
Filter the assignee of pull requests
author string Optional
Filter the author of pull requests
tags string Optional
A list of tags you wish to filter. If you want to filter for pull requests not having a tag, add an exclamation mark in front of it

Sample response

{
  "args": {
    "assignee": null,
    "author": null,
    "status": true,
    "tags": null
  },
  "total_requests": 1,
  "requests": [
    {
      "assignee": null,
      "branch": "master",
      "branch_from": "master",
      "closed_at": null,
      "closed_by": null,
      "comments": [],
      "commit_start": null,
      "commit_stop": null,
      "date_created": "1431414800",
      "id": 1,
      "project": {
        "date_created": "1431414800",
        "description": "test project #1",
        "id": 1,
        "name": "test",
        "parent": null,
        "user": {
          "fullname": "PY C",
          "name": "pingou"
        }
      },
      "repo_from": {
        "date_created": "1431414800",
        "description": "test project #1",
        "id": 1,
        "name": "test",
        "parent": null,
        "user": {
          "fullname": "PY C",
          "name": "pingou"
        }
      },
      "status": "Open",
      "title": "test pull-request",
      "uid": "1431414800",
      "updated_on": "1431414800",
      "user": {
        "fullname": "PY C",
        "name": "pingou"
      }
    }
  ]
}

 Pull-request information

Retrieve information of a specific pull request.

GET /api/0/<repo>/pull-request/<request id>
GET /api/0/<namespace>/<repo>/pull-request/<request id>
GET /api/0/fork/<username>/<repo>/pull-request/<request id>
GET /api/0/fork/<username>/<namespace>/<repo>/pull-request/<request id>

Sample response

{
  "assignee": null,
  "branch": "master",
  "branch_from": "master",
  "closed_at": null,
  "closed_by": null,
  "comments": [],
  "commit_start": null,
  "commit_stop": null,
  "date_created": "1431414800",
  "id": 1,
  "project": {
    "close_status": [],
    "custom_keys": [],
    "date_created": "1431414800",
    "description": "test project #1",
    "id": 1,
    "name": "test",
    "parent": null,
    "user": {
      "fullname": "PY C",
      "name": "pingou"
    }
  },
  "repo_from": {
    "date_created": "1431414800",
    "description": "test project #1",
    "id": 1,
    "name": "test",
    "parent": null,
    "user": {
      "fullname": "PY C",
      "name": "pingou"
    }
  },
  "status": "Open",
  "title": "test pull-request",
  "uid": "1431414800",
  "updated_on": "1431414800",
  "user": {
    "fullname": "PY C",
    "name": "pingou"
  }
}

 Pull-request diff statistics

Retrieve the statistics about the diff of a specific pull request.

GET /api/0/<repo>/pull-request/<request id>/diffstats
GET /api/0/<namespace>/<repo>/pull-request/<request id>/diffstats
GET /api/0/fork/<username>/<repo>/pull-request/<request id>/diffstats
GET /api/0/fork/<username>/<namespace>/<repo>/pull-request/<request id>/diffstats

Sample response

{
  "README.rst": {
    "lines_added": 1,
    "lines_removed": 1,
    "old_path": "README.rst",
    "status": "M"
  },
  "blame_file.txt": {
    "lines_added": 0,
    "lines_removed": 0,
    "old_path": "blame_file",
    "status": "R"
  },
  "test": {
    "lines_added": 0,
    "lines_removed": 8,
    "old_path": "test",
    "status": "D"
  },
  "test3": {
    "lines_added": 3,
    "lines_removed": 0,
    "old_path": "test3",
    "status": "A"
  }
}

 Pull-request by UID information

Retrieve information of a pull request specified by uid.

GET /api/0/pull-requests/<uid>

Sample response

{
  "assignee": null,
  "branch": "master",
  "branch_from": "master",
  "closed_at": null,
  "closed_by": null,
  "comments": [],
  "commit_start": null,
  "commit_stop": null,
  "date_created": "1431414800",
  "id": 1,
  "project": {
    "close_status": [],
    "custom_keys": [],
    "date_created": "1431414800",
    "description": "test project #1",
    "id": 1,
    "name": "test",
    "parent": null,
    "user": {
      "fullname": "PY C",
      "name": "pingou"
    }
  },
  "repo_from": {
    "date_created": "1431414800",
    "description": "test project #1",
    "id": 1,
    "name": "test",
    "parent": null,
    "user": {
      "fullname": "PY C",
      "name": "pingou"
    }
  },
  "status": "Open",
  "title": "test pull-request",
  "uid": "1431414800",
  "updated_on": "1431414800",
  "user": {
    "fullname": "PY C",
    "name": "pingou"
  }
}

 Merge a pull-request

Instruct Pagure to merge a pull request.

This is an asynchronous call.

POST /api/0/<repo>/pull-request/<request id>/merge
POST /api/0/<namespace>/<repo>/pull-request/<request id>/merge
POST /api/0/fork/<username>/<repo>/pull-request/<request id>/merge
POST /api/0/fork/<username>/<namespace>/<repo>/pull-request/<request id>/merge

Sample response

wait=False:
{
  "message": "Merging queued",
  "taskid": "123-abcd"
}

wait=True:
{
  "message": "Changes merged!"
}

 Rebase a pull-request

Instruct Pagure to rebase a pull request.

This is an asynchronous call.

POST /api/0/<repo>/pull-request/<request id>/rebase
POST /api/0/<namespace>/<repo>/pull-request/<request id>/rebase
POST /api/0/fork/<username>/<repo>/pull-request/<request id>/rebase
POST /api/0/fork/<username>/<namespace>/<repo>/pull-request/<request id>/rebase

Sample response

wait=False:
{
  "message": "Rebasing queued",
  "taskid": "123-abcd"
}

wait=True:
{
  "message": "Pull-request rebased"
}

 Close a pull-request

Instruct Pagure to close a pull request.

POST /api/0/<repo>/pull-request/<request id>/close
POST /api/0/<namespace>/<repo>/pull-request/<request id>/close
POST /api/0/fork/<username>/<repo>/pull-request/<request id>/close
POST /api/0/fork/<username>/<namespace>/<repo>/pull-request/<request id>/close

Sample response

{
  "message": "Pull-request closed!"
}

 Comment on a pull-request

Add comment to a pull request.

POST /api/0/<repo>/pull-request/<request id>/comment
POST /api/0/<namespace>/<repo>/pull-request/<request id>/comment
POST /api/0/fork/<username>/<repo>/pull-request/<request id>/comment
POST /api/0/fork/<username>/<namespace>/<repo>/pull-request/<request id>/comment

Input

Key Type Optionality Description
comment string Mandatory
The comment to add to the pull request
commit string Optional
The hash of the specific commit you wish to comment on
filename string Optional
The filename of the specific file you wish to comment on
row int Optional
Used in combination with filename to comment on a specific row of a file
tree_id string Optional
The identifier of the git tree as it was when the comment was added

Sample response

{
  "message": "Comment added"
}

 Flag a pull-request

Add or edit flags on a pull-request.

POST /api/0/<repo>/pull-request/<request id>/flag
POST /api/0/<namespace>/<repo>/pull-request/<request id>/flag
POST /api/0/fork/<username>/<repo>/pull-request/<request id>/flag
POST /api/0/fork/<username>/<namespace>/<repo>/pull-request/<request id>/flag

Input

Key Type Optionality Description
username string Mandatory
The name of the application to be presented to users on the pull request page
comment string Mandatory
A short message summarizing the presented results
url string Mandatory
A URL to the result of this flag
status string Optional
The status of the task, can be any of: canceled, error, failure, pending, success If not provided it will be set to success if percent is higher than 0 failure if it is 0 and pending if percent is not specified
percent int Optional
A percentage of completion compared to the goal. The percentage also determine the background color of the flag on the pull-request page
uid string Optional
A unique identifier used to identify a flag on a pull-request. If the provided UID matches an existing one, then the API call will update the existing one rather than create a new one. Maximum Length: 32 characters. Default: an auto generated UID

Sample response

{
  "flag": {
    "comment": "Tests failed",
    "date_created": "1510742565",
    "percent": 0,
    "pull_request_uid": "62b49f00d489452994de5010565fab81",
    "status": "error",
    "url": "http://jenkins.cloud.fedoraproject.org/",
    "user": {
      "default_email": "bar@pingou.com",
      "emails": ["bar@pingou.com", "foo@pingou.com"],
      "fullname": "PY C",
      "name": "pingou"},
    "username": "Jenkins"},
  "message": u"Flag added",
  "uid": u"jenkins_build_pagure_100+seed"
}
{
  "flag": {
    "comment": "Tests failed",
    "date_created": "1510742565",
    "percent": 0,
    "pull_request_uid": "62b49f00d489452994de5010565fab81",
    "status": "error",
    "url": "http://jenkins.cloud.fedoraproject.org/",
    "user": {
      "default_email": "bar@pingou.com",
      "emails": ["bar@pingou.com", "foo@pingou.com"],
      "fullname": "PY C",
      "name": "pingou"},
    "username": "Jenkins"},
  "message": u"Flag updated",
  "uid": u"jenkins_build_pagure_100+seed"
}

 Assign a pull-request

Assign a pull-request to someone.

POST /api/0/<repo>/pull-request/<issue id>/assign
POST /api/0/<namespace>/<repo>/pull-request/<issue id>/assign
POST /api/0/fork/<username>/<repo>/pull-request/<issue id>/assign
POST /api/0/fork/<username>/<namespace>/<repo>/pull-request/<issue id>/assign

Input

Key Type Optionality Description
assignee string Mandatory
The username of the user to assign the PR to.

Sample response

{
  "message": "pull-request assigned"
}

 Update pull-request information

Update the title and initial comment of an existing pull-request.

POST /api/0/<repo>/pull-request/<request id>
POST /api/0/<namespace>/<repo>/pull-request/<request id>
POST /api/0/fork/<username>/<repo>/pull-request/<request id>
POST /api/0/fork/<username>/<namespace>/<repo>/pull-request/<request id>

Input

Key Type Optionality Description
title string Mandatory
The title to give to the pull-request
initial_comment string Optional
The initial comment or description of the pull-request

Sample response

{
  "assignee": null,
  "branch": "master",
  "branch_from": "master",
  "closed_at": null,
  "closed_by": null,
  "comments": [],
  "commit_start": null,
  "commit_stop": null,
  "date_created": "1431414800",
  "id": 1,
  "project": {
    "close_status": [],
    "custom_keys": [],
    "date_created": "1431414800",
    "description": "test project #1",
    "id": 1,
    "name": "test",
    "parent": null,
    "user": {
      "fullname": "PY C",
      "name": "pingou"
    }
  },
  "repo_from": {
    "date_created": "1431414800",
    "description": "test project #1",
    "id": 1,
    "name": "test",
    "parent": null,
    "user": {
      "fullname": "PY C",
      "name": "pingou"
    }
  },
  "status": "Open",
  "title": "test pull-request",
  "uid": "1431414800",
  "updated_on": "1431414800",
  "user": {
    "fullname": "PY C",
    "name": "pingou"
  }
}

Users

 List users

Retrieve users that have logged into the Pagure instance. This can then be used as input for autocompletion in some forms/fields.

GET /api/0/users

Parameters

Key Type Optionality Description
pattern string Optional
Filters the starting letters of the usernames

Sample response

{
  "total_users": 2,
  "users": ["user1", "user2"]
}

 User information

Use this endpoint to retrieve information about a specific user.

GET /api/0/user/<username>
GET /api/0/user/ralph

Parameters

Key Type Optionality Description
repopage int Optional
Specifies which page of the projects to return (defaults to: 1)
forkpage int Optional
Specifies which page of the forks to return (defaults to: 1)
per_page int Optional
The number of items to return per page. The maximum is 100.

Sample response

{
  "forks": [],
  "repos": [
    {
      "custom_keys": [],
      "description": "",
      "parent": null,
      "tags": [],
      "namespace": None,
      "priorities": {},
      "close_status": [
        "Invalid",
        "Insufficient data",
        "Fixed",
        "Duplicated"
      ],
      "milestones": {},
      "user": {
        "fullname": "ralph",
        "name": "ralph"
      },
      "date_created": "1426595173",
      "id": 5,
      "name": "pagure"
    }
  ],
  "repos_pagination": {
    "first": "http://localhost:5000/api/0/user/ralph?per_page=1&repopage=1",
    "last": "http://localhost:5000/api/0/user/ralph?per_page=1&repopage=123",
    "next": "http://localhost:5000/api/0/user/ralph?per_page=1&repopage=2",
    "pages": 123,
    "per_page": 1,
    "prev": null,
    "repopage": 1
  },
  "user": {
    "fullname": "ralph",
    "name": "ralph",
    "avatar_url": "https://seccdn.libravatar.org/avatar/5dac3?s=16&d=retro"
  }
}

 User activity stats

Use this endpoint to retrieve activity stats about a specific user over the last year.

GET /api/0/user/<username>/activity/stats
GET /api/0/user/ralph/activity/stats

GET /api/0/user/ralph/activity/stats?format=timestamp

Parameters

Key Type Optionality Description
username string Mandatory
The username of the user whose activity you are interested in.
format string Optional
Allows changing the of the date/time returned from iso format to unix timestamp Can be: timestamp or isoformat

Sample response

{
  "2015-11-04": 9,
  "2015-11-06": 3,
  "2015-11-09": 6,
  "2015-11-13": 4,
  "2015-11-15": 3,
  "2015-11-18": 15,
  "2015-11-19": 3,
  "2015-11-20": 15,
  "2015-11-26": 18,
  "2015-11-30": 116,
  "2015-12-02": 12,
  "2015-12-03": 2
}

or:

{
  "1446591600": 9,
  "1446764400": 3,
  "1447023600": 6,
  "1447369200": 4,
  "1447542000": 3,
  "1447801200": 15,
  "1447887600": 3,
  "1447974000": 15,
  "1448492400": 18,
  "1448838000": 116,
  "1449010800": 12,
  "1449097200": 2
}

 User activity on a specific date

Use this endpoint to retrieve activity information about a specific user on the specified date.

GET /api/0/user/<username>/activity/<date>
GET /api/0/user/ralph/activity/2016-01-02

GET /api/0/user/ralph/activity/2016-01-02?grouped=true

Parameters

Key Type Optionality Description
username string Mandatory
The username of the user whose activity you are interested in.
date string Mandatory
The date of interest, best provided in ISO format: YYYY-MM-DD
grouped boolean Optional
Whether or not to group the commits

Sample response

{
  "activities": [
    {
      "date": "2016-02-24",
      "date_created": "1456305852",
      "description": "pingou created PR test#44",
      "description_mk": "<p>pingou created PR <a href="/test/pull-request/44" title="Update test_foo">test#44</a></p>",
      "id": 4067,
      "user": {
        "fullname": "Pierre-YvesC",
        "name": "pingou"
      }
    },
    {
      "date": "2016-02-24",
      "date_created": "1456305887",
      "description": "pingou commented on PR test#44",
      "description_mk": "<p>pingou commented on PR <a href="/test/pull-request/44" title="Update test_foo">test#44</a></p>",
      "id": 4112,
      "user": {
        "fullname": "Pierre-YvesC",
        "name": "pingou"
      }
    }
  ]
}

 List pull-requests filled by user

Use this endpoint to retrieve a list of open pull requests a user has filed over the entire pagure instance.

GET /api/0/user/<username>/requests/filed
GET /api/0/user/dudemcpants/requests/filed

Parameters

Key Type Optionality Description
username string Mandatory
The username of the user whose activity you are interested in.
status string Optional
Filter the status of pull requests. Default: Open (open pull requests), can be Closed for closed requests, Merged for merged requests, or Open for open requests. All returns closed, merged and open requests.
created string Optional
Filter the pull-requests returned by their creation date. The date can be of specified either using a timestamp format or using the iso format for dates: yyyy-mm-dd. You can specify a start and a end date to this filter using start..end.
updated string Optional
Filter the pull-requests returned by their update date. The date can be of specified either using a timestamp format or using the iso format for dates: yyyy-mm-dd. You can specify a start and a end date to this filter using start..end.
closed string Optional
Filter the pull-requests returned by their closing date. The date can be of specified either using a timestamp format or using the iso format for dates: yyyy-mm-dd. You can specify a start and a end date to this filter using start..end.
page integer Mandatory
The page requested. Defaults to 1.
per_page int Optional
The number of items to return per page. The maximum is 100.

Sample response

{
  "args": {
    "status": "open",
    "username": "dudemcpants",
    "page": 1,
    "created": null,
    "updated": null,
    "closed": null,
  },
  "pagination": {
    "first": "http://localhost:5000/api/0/user/dudemcpants/requests/filed?per_page=1&page=1",
    "last": "http://localhost:5000/api/0/user/dudemcpants/requests/filed?per_page=1&page=61",
    "next": "http://localhost:5000/api/0/user/dudemcpants/requests/filed?per_page=1&page=2",
    "page": 1,
    "pages": 61,
    "per_page": 1,
    "prev": null
  },
  "requests": [
    {
      "assignee": null,
      "branch": "master",
      "branch_from": "master",
      "closed_at": null,
      "closed_by": null,
      "comments": [],
      "commit_start": "3973fae98fc485783ca14f5c3612d85832185065",
      "commit_stop": "3973fae98fc485783ca14f5c3612d85832185065",
      "date_created": "1510227832",
      "id": 2,
      "initial_comment": null,
      "last_updated": "1510227833",
      "project": {
          "access_groups": {
            "admin": [],
            "commit": [],
            "ticket": []
          },
          "access_users": {
            "admin": [],
            "commit": [],
            "owner": [
              "ryanlerch"
            ],
            "ticket": []
          },
          "close_status": [],
          "custom_keys": [],
          "date_created": "1510227638",
          "date_modified": "1510227638",
          "description": "this is a quick project",
          "fullname": "aquickproject",
          "id": 1,
          "milestones": {},
          "name": "aquickproject",
          "namespace": null,
          "parent": null,
          "priorities": {},
          "tags": [],
          "url_path": "aquickproject",
          "user": {
            "fullname": "ryanlerch",
            "name": "ryanlerch"
          }
      },
      "remote_git": null,
      "repo_from": {
          "access_groups": {
            "admin": [],
            "commit": [],
            "ticket": []
          },
          "access_users": {
            "admin": [],
            "commit": [],
            "owner": [
              "dudemcpants"
            ],
            "ticket": []
          },
          "close_status": [],
          "custom_keys": [],
          "date_created": "1510227729",
          "date_modified": "1510227729",
          "description": "this is a quick project",
          "fullname": "forks/dudemcpants/aquickproject",
          "id": 2,
          "milestones": {},
          "name": "aquickproject",
          "namespace": null,
          "parent": {
            "access_groups": {
              "admin": [],
              "commit": [],
              "ticket": []
            },
            "access_users": {
              "admin": [],
              "commit": [],
              "owner": [
                "ryanlerch"
              ],
              "ticket": []
            },
            "close_status": [],
            "custom_keys": [],
            "date_created": "1510227638",
            "date_modified": "1510227638",
            "description": "this is a quick project",
            "fullname": "aquickproject",
            "id": 1,
            "milestones": {},
            "name": "aquickproject",
            "namespace": null,
            "parent": null,
            "priorities": {},
            "tags": [],
            "url_path": "aquickproject",
            "user": {
                "fullname": "ryanlerch",
                "name": "ryanlerch"
            }
          },
          "priorities": {},
          "tags": [],
          "url_path": "fork/dudemcpants/aquickproject",
          "user": {
            "fullname": "Dude McPants",
            "name": "dudemcpants"
          }
      },
      "status": "Open",
      "title": "Update README.md",
      "uid": "819e0b1c449e414fa291c914f28d73ec",
      "updated_on": "1510227832",
      "user": {
        "fullname": "Dude McPants",
        "name": "dudemcpants"
      }
    }
  ],
  "total_requests": 1
}

 List PRs actionable by user

Use this endpoint to retrieve a list of open pull requests a user is able to action (e.g. merge) over the entire pagure instance.

GET /api/0/user/<username>/requests/actionable
GET /api/0/user/dudemcpants/requests/actionable

Parameters

Key Type Optionality Description
username string Mandatory
The username of the user whose activity you are interested in.
created string Optional
Filter the pull-requests returned by their creation date. The date can be of specified either using a timestamp format or using the iso format for dates: yyyy-mm-dd. You can specify a start and a end date to this filter using start..end.
updated string Optional
Filter the pull-requests returned by their update date. The date can be of specified either using a timestamp format or using the iso format for dates: yyyy-mm-dd. You can specify a start and a end date to this filter using start..end.
closed string Optional
Filter the pull-requests returned by their closing date. The date can be of specified either using a timestamp format or using the iso format for dates: yyyy-mm-dd. You can specify a start and a end date to this filter using start..end.
page integer Mandatory
The page requested. Defaults to 1.
status string Optional
Filter the status of pull requests. Default: Open (open pull requests), can be Closed for closed requests, Merged for merged requests, or Open for open requests. All returns closed, merged and open requests.

Sample response

{
  "args": {
    "status": "open",
    "username": "ryanlerch",
    "page": 1,
    "created": null,
    "updated": null,
    "closed": null,
  },
  "pagination": {
    "first": "http://localhost:5000/api/0/user/ryanlerch/requests/actionable?per_page=1&page=1",
    "last": "http://localhost:5000/api/0/user/ryanlerch/requests/actionable?per_page=1&page=61",
    "next": "http://localhost:5000/api/0/user/ryanlerch/requests/actionable?per_page=1&page=2",
    "page": 1,
    "pages": 61,
    "per_page": 1,
    "prev": null
  },
  "requests": [
    {
      "assignee": null,
      "branch": "master",
      "branch_from": "master",
      "closed_at": null,
      "closed_by": null,
      "comments": [],
      "commit_start": "3973fae98fc485783ca14f5c3612d85832185065",
      "commit_stop": "3973fae98fc485783ca14f5c3612d85832185065",
      "date_created": "1510227832",
      "id": 2,
      "initial_comment": null,
      "last_updated": "1510227833",
      "project": {
          "access_groups": {
            "admin": [],
            "commit": [],
            "ticket": []
          },
          "access_users": {
            "admin": [],
            "commit": [],
            "owner": [
                "ryanlerch"
            ],
            "ticket": []
          },
          "close_status": [],
          "custom_keys": [],
          "date_created": "1510227638",
          "date_modified": "1510227638",
          "description": "this is a quick project",
          "fullname": "aquickproject",
          "id": 1,
          "milestones": {},
          "name": "aquickproject",
          "namespace": null,
          "parent": null,
          "priorities": {},
          "tags": [],
          "url_path": "aquickproject",
          "user": {
            "fullname": "ryanlerch",
            "name": "ryanlerch"
          }
      },
      "remote_git": null,
      "repo_from": {
          "access_groups": {
            "admin": [],
            "commit": [],
            "ticket": []
          },
          "access_users": {
            "admin": [],
            "commit": [],
            "owner": [
              "dudemcpants"
            ],
            "ticket": []
          },
          "close_status": [],
          "custom_keys": [],
          "date_created": "1510227729",
          "date_modified": "1510227729",
          "description": "this is a quick project",
          "fullname": "forks/dudemcpants/aquickproject",
          "id": 2,
          "milestones": {},
          "name": "aquickproject",
          "namespace": null,
          "parent": {
            "access_groups": {
              "admin": [],
              "commit": [],
              "ticket": []
            },
            "access_users": {
              "admin": [],
              "commit": [],
              "owner": [
                "ryanlerch"
              ],
              "ticket": []
            },
            "close_status": [],
            "custom_keys": [],
            "date_created": "1510227638",
            "date_modified": "1510227638",
            "description": "this is a quick project",
            "fullname": "aquickproject",
            "id": 1,
            "milestones": {},
            "name": "aquickproject",
            "namespace": null,
            "parent": null,
            "priorities": {},
            "tags": [],
            "url_path": "aquickproject",
            "user": {
              "fullname": "ryanlerch",
              "name": "ryanlerch"
            }
          },
          "priorities": {},
          "tags": [],
          "url_path": "fork/dudemcpants/aquickproject",
          "user": {
            "fullname": "Dude McPants",
            "name": "dudemcpants"
          }
      },
      "status": "Open",
      "title": "Update README.md",
      "uid": "819e0b1c449e414fa291c914f28d73ec",
      "updated_on": "1510227832",
      "user": {
        "fullname": "Dude McPants",
        "name": "dudemcpants"
      }
    }
  ],
  "total_requests": 1
}

Groups

 List groups

Retrieve groups on this Pagure instance. This can then be used as input for autocompletion in some forms/fields.

GET /api/0/groups

Parameters

Key Type Optionality Description
pattern string Optional
Filters the starting letters of the group names
page int Optional
Specifies which page to return (defaults to: 1)
per_page int Optional
The number of projects to return per page. The maximum is 100.

Sample response

{
  "total_groups": 2,
  u'pagination': {
    'first': 'http://localhost/api/0/groups?per_page=20&extended=1&page=1',
    'last': 'http://localhost/api/0/groups?per_page=20&extended=1&page=1',
    'next': null,
    'page': 1,
    'pages': 1,
    'per_page': 20,
    'prev': None
  },
  "groups": ["group1", "group2"]
}

 Group information

Use this endpoint to retrieve information about a specific group.

GET /api/0/group/<group>
GET /api/0/group/some_group_name
GET /api/0/group/some_group_name?projects=1&acl=commit

Input

Key Type Optionality Description
group name str Mandatory The name of the group to retrieve information about.
projects bool Optional Specifies whether to include projects in the data returned.
acl str Optional Filter the project returned (if any) to those where the has the specified ACL level. Can be any of: admin, commit or ticket.

Sample response

{
  "creator": {
    "default_email": "user1@example.com",
    "emails": [
      "user1@example.com"
    ],
    "fullname": "User1",
    "name": "user1"
  },
  "date_created": "1492011511",
  "description": "Some Group",
  "display_name": "Some Group",
  "group_type": "user",
  "members": [
    "user1",
    "user2"
  ],
  "name": "some_group_name"
}
{
  "creator": {
    "default_email": "user1@example.com",
    "emails": [
      "user1@example.com"
    ],
    "fullname": "User1",
    "name": "user1"
  },
  "date_created": "1492011511",
  "description": "Some Group",
  "display_name": "Some Group",
  "group_type": "user",
  "members": [
    "user1",
    "user2"
  ],
  "name": "some_group_name",
  "projects": [],
}

Extras

 Who am I?

This API endpoint will return the username associated with the provided API token.

POST /api/0/-/whoami

Sample response

{
  "username": "user1"
}

 API Version

Get the current API version.

GET /api/0/-/version

Sample response

{
  "version": "1"
}

 Error codes

Get a dictionary (hash) of all error codes.

GET /api/0/-/error_codes

Sample response

{
  ENOCODE: 'Variable message describing the issue',
  ENOPROJECT: 'Project not found',
}

 List all the tags of a project

List the tags made on the project's issues.

GET /api/0/<repo>/tags
GET /api/0/fork/<username>/<repo>/tags

Parameters

Key Type Optionality Description
pattern string Optional
Filters the starting letters of the tags

Sample response

{
  "total_tags": 2,
  "tags": ["tag1", "tag2"]
}