---
title: "Create an autolink reference for a repository"
method: POST
path: "/repos/{owner}/{repo}/autolinks"
tags: ["repos"]
---

# Create an autolink reference for a repository

`POST /repos/{owner}/{repo}/autolinks`

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

## Path parameters

- `owner` string, required
- `repo` string, required

## Request body

- object
  - `key_prefix` string, required — This prefix appended by certain characters will generate a link any time it is found in an issue, pull request, or commit.
  - `url_template` string, required — The URL must contain `<num>` for the reference number. `<num>` matches different characters depending on the value of `is_alphanumeric`.
  - `is_alphanumeric` boolean — 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 `201`

response

- Autolink — An autolink reference.
  - `id` integer, required
  - `key_prefix` string, required — The prefix of a key that is linkified.
  - `url_template` string, required — A template for the target URL that is generated if a key was found.
  - `is_alphanumeric` boolean, required — Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters.
  - `updated_at` string, date-time, nullable

## Other responses

- `422` — Validation failed, or the endpoint has been spammed.

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-2.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-2/versions/8ae6d0c8716e/schema)
