# Create a registration token for a repository

From **GitHub v3 REST API**.

`POST /repos/{owner}/{repo}/actions/runners/registration-token`

Returns a token that you can pass to the `config` script. The token expires after one hour. You must authenticate
using an access token with the `repo` scope to use this endpoint.

#### Example using registration token
 
Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint.

```
./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN
```

## Parameters

### `owner`

- Location: path
- Required: true
- Type: `string`

### `repo`

- Location: path
- Required: true
- Type: `string`

## Responses

### `201`

Response

### `application/json`

- Type: `object`

Authentication Token

```json
{
  "expires_at": "2020-01-22T12:13:35.123-08:00",
  "token": "LLBF3JGZDX3P5PMEXLND6TS6FCWO6"
}
```

```json
{"description":"Authentication Token","properties":{"expires_at":{"description":"The time this token expires","example":"2016-07-11T22:14:10Z","format":"date-time","type":"string"},"permissions":{"example":{"deployments":"write","issues":"read"},"type":"object"},"repositories":{"description":"The repositories this token has access to","items":{"$ref":"#/components/schemas/repository"},"type":"array"},"repository_selection":{"description":"Describe whether all repositories have been selected or there's a selection involved","enum":["all","selected"],"type":"string"},"single_file":{"example":"config.yaml","nullable":true,"type":"string"},"token":{"description":"The token used for authentication","example":"v1.1f699f1069f60xxx","type":"string"}},"required":["token","expires_at"],"title":"Authentication Token","type":"object"}
```

## Request examples

### cURL

```shell
curl --request POST \
  --url {protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/runners/registration-token
```
