{"meta":{"title":"Points de terminaison d’API REST pour les liens automatiques du référentiel","intro":"Utilisez l’API REST pour ajouter des liens automatiques à des ressources externes.","product":"API REST","breadcrumbs":[{"href":"/fr/rest","title":"API REST"},{"href":"/fr/rest/repos","title":"Référentiels"},{"href":"/fr/rest/repos/autolinks","title":"Liens automatiques"}],"documentType":"article"},"body":"# Points de terminaison d’API REST pour les liens automatiques du référentiel\n\nUtilisez l’API REST pour ajouter des liens automatiques à des ressources externes.\n\n## À propos des liens automatiques du référentiel\n\nPour simplifier votre workflow, vous pouvez utiliser l’API REST afin d’ajouter des liens automatiques à des ressources externes comme des problèmes JIRA et des tickets Zendesk. Pour plus d’informations, consultez « [Configuration de liens automatiques pour référencer des ressources externes](/fr/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/configuring-autolinks-to-reference-external-resources) ».\n\nLes GitHub Apps nécessitent des autorisations d’administration de référentiel avec un accès en lecture ou en écriture pour utiliser ces points de terminaison.\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):**"}