Create an autolink reference for a repository
Users with admin access to the repository can create an autolink.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The account owner of the repository. The name is not case sensitive.
The name of the repository without the .git extension. The name is not case sensitive.
Request Body required
Section titled “ Request Body required ”object
This prefix appended by certain characters will generate a link any time it is found in an issue, pull request, or commit.
The URL must contain <num> for the reference number. <num> matches different characters depending on the value of is_alphanumeric.
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.
Examples
{ "key_prefix": "TICKET-", "url_template": "https://example.com/TICKET?query=<num>", "is_alphanumeric": true}Responses
Section titled “ Responses ”Response
An autolink reference.
object
The prefix of a key that is linkified.
A template for the target URL that is generated if a key was found.
Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters.
Examples
{ "id": 1, "key_prefix": "TICKET-", "url_template": "https://example.com/TICKET?query=<num>", "is_alphanumeric": true}Headers
Section titled “ Headers ”Example
https://api.github.com/repos/octocat/Hello-World/autolinks/1Validation failed, or the endpoint has been spammed.
Validation Error
object
object
Example generated
{ "message": "example", "documentation_url": "example", "errors": [ { "resource": "example", "field": "example", "message": "example", "code": "example", "index": 1, "value": [ "example" ] } ]}