{"meta":{"title":"REST API endpoints for repository autolinks","intro":"Use the REST API to add autolinks to external resources.","product":"REST API","breadcrumbs":[{"href":"/en/enterprise-cloud@latest/rest","title":"REST API"},{"href":"/en/enterprise-cloud@latest/rest/repos","title":"Repositories"},{"href":"/en/enterprise-cloud@latest/rest/repos/autolinks","title":"Autolinks"}],"documentType":"article"},"body":"# REST API endpoints for repository autolinks\n\nUse the REST API to add autolinks to external resources.\n\n## About repository autolinks\n\nTo help streamline your workflow, you can use the REST API to add autolinks to external resources like JIRA issues and Zendesk tickets. For more information, see [Configuring autolinks to reference external resources](/en/enterprise-cloud@latest/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/configuring-autolinks-to-reference-external-resources).\n\nGitHub Apps require repository administration permissions with read or write access to use these endpoints.\n\n> \\[!NOTE]\n> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.\n\n## Get all autolinks of a repository\n\n```\nGET /repos/{owner}/{repo}/autolinks\n```\n\nGets all autolinks that are configured for a repository.\nInformation about autolinks are only available to repository administrators.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n### HTTP response status codes\n\n* **200** - OK\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/autolinks\n```\n\n**Response schema (Status: 200):**\n\nArray of `Autolink reference`:\n\n* `id`: required, integer\n* `key_prefix`: required, string\n* `url_template`: required, string\n* `is_alphanumeric`: required, boolean\n* `updated_at`: string or null, format: date-time\n\n## Create an autolink reference for a repository\n\n```\nPOST /repos/{owner}/{repo}/autolinks\n```\n\nUsers with admin access to the repository can create an autolink.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n#### Body parameters\n\n* **`key_prefix`** (string) (required)\n  This prefix appended by certain characters will generate a link any time it is found in an issue, pull request, or commit.\n\n* **`url_template`** (string) (required)\n  The URL must contain <num> for the reference number. <num> matches different characters depending on the value of is\\_alphanumeric.\n\n* **`is_alphanumeric`** (boolean)\n  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.\n  Default: `true`\n\n### HTTP response status codes\n\n* **201** - Created\n\n* **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/repos/OWNER/REPO/autolinks \\\n  -d '{\n  \"key_prefix\": \"TICKET-\",\n  \"url_template\": \"https://example.com/TICKET?query=<num>\",\n  \"is_alphanumeric\": true\n}'\n```\n\n**Response schema (Status: 201):**\n\n* `id`: required, integer\n* `key_prefix`: required, string\n* `url_template`: required, string\n* `is_alphanumeric`: required, boolean\n* `updated_at`: string or null, format: date-time\n\n## Get an autolink reference of a repository\n\n```\nGET /repos/{owner}/{repo}/autolinks/{autolink_id}\n```\n\nThis returns a single autolink reference by ID that was configured for the given repository.\nInformation about autolinks are only available to repository administrators.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`autolink_id`** (integer) (required)\n  The unique identifier of the autolink.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/autolinks/AUTOLINK_ID\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create an autolink reference for a repository](#create-an-autolink-reference-for-a-repository).\n\n## Delete an autolink reference from a repository\n\n```\nDELETE /repos/{owner}/{repo}/autolinks/{autolink_id}\n```\n\nThis deletes a single autolink reference by ID that was configured for the given repository.\nInformation about autolinks are only available to repository administrators.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`autolink_id`** (integer) (required)\n  The unique identifier of the autolink.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  https://api.github.com/repos/OWNER/REPO/autolinks/AUTOLINK_ID\n```\n\n**Response schema (Status: 204):**"}