v50

latestOpenAPI 3.0.3MITraw.githubusercontent.com2023-11-288093493.9 MB
repos

Create an autolink reference for a repository

Users with admin access to the repository can create an autolink.

post/repos/{owner}/{repo}/autolinks

Path parameters

ownerstring required

The account owner of the repository. The name is not case sensitive.

repostring required

The name of the repository without the .git extension. The name is not case sensitive.

Request body

key_prefixstring required

The prefix appended by a number will generate a link any time it is found in an issue, pull request, or commit.

url_templatestring required

The URL must contain <num> for the reference number.

is_alphanumericboolean

Whether this autolink reference matches alphanumeric characters. If true, the <num> parameter of the url_template matches alphanumeric characters A-Z (case insensitive), 0-9, and -. If false, this autolink reference only matches numeric characters.

Response

response

idinteger required
key_prefixstring required

The prefix of a key that is linkified.

url_templatestring required

A template for the target URL that is generated if a key was found.

Example response

{
  "id": 3,
  "key_prefix": "TICKET-",
  "url_template": "https://example.com/TICKET?query=<num>"
}