# REST-API-Endpunkte für GitHub Actions OIDC

Verwenden Sie die REST-API, um mit JWTs für OIDC-Subjekt-Claims in GitHub Actions zu arbeiten.

## Über GitHub Actions OIDC

Sie können die REST-API verwenden, um eine Anpassungsvorlage für einen OpenID Connect (OIDC)-Antragstelleranspruch abzufragen und zu verwalten. Weitere Informationen finden Sie unter [OpenID Connect](/de/enterprise-server@3.22/actions/concepts/security/openid-connect).

> \[!NOTE]
> 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.

## Get the customization template for an OIDC subject claim for an organization

```
GET /orgs/{org}/actions/oidc/customization/sub
```

Gets the customization template for an OpenID Connect (OIDC) subject claim.
OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`org`** (string) (required)
  The organization name. The name is not case sensitive.

### HTTP response status codes

* **200** - A JSON serialized template for OIDC subject claim customization

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X GET \
  http(s)://HOSTNAME/api/v3/orgs/ORG/actions/oidc/customization/sub
```

**Response schema (Status: 200):**

* `include_claim_keys`: required, array of string

## Set the customization template for an OIDC subject claim for an organization

```
PUT /orgs/{org}/actions/oidc/customization/sub
```

Creates or updates the customization template for an OpenID Connect (OIDC) subject claim.
OAuth app tokens and personal access tokens (classic) need the write:org scope to use this endpoint.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`org`** (string) (required)
  The organization name. The name is not case sensitive.

#### Body parameters

* **`include_claim_keys`** (array of strings)
  Array of unique strings. Each claim key can only contain alphanumeric characters and underscores.

### HTTP response status codes

* **201** - Empty response

* **403** - Forbidden

* **404** - Resource not found

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X PUT \
  http(s)://HOSTNAME/api/v3/orgs/ORG/actions/oidc/customization/sub \
  -d '{
  "include_claim_keys": [
    "repo",
    "context"
  ]
}'
```

**Response schema (Status: 201):**

## Get the customization template for an OIDC subject claim for a repository

```
GET /repos/{owner}/{repo}/actions/oidc/customization/sub
```

Gets the customization template for an OpenID Connect (OIDC) subject claim.
OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`owner`** (string) (required)
  The account owner of the repository. The name is not case sensitive.

* **`repo`** (string) (required)
  The name of the repository without the .git extension. The name is not case sensitive.

### HTTP response status codes

* **200** - Status response

* **400** - Bad Request

* **404** - Resource not found

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X GET \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/oidc/customization/sub
```

**Response schema (Status: 200):**

* `use_default`: required, boolean
* `include_claim_keys`: array of string

## Set the customization template for an OIDC subject claim for a repository

```
PUT /repos/{owner}/{repo}/actions/oidc/customization/sub
```

Sets the customization template and opt-in or opt-out flag for an OpenID Connect (OIDC) subject claim for a repository.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`owner`** (string) (required)
  The account owner of the repository. The name is not case sensitive.

* **`repo`** (string) (required)
  The name of the repository without the .git extension. The name is not case sensitive.

#### Body parameters

* **`use_default`** (boolean) (required)
  Whether to use the default template or not. If true, the include\_claim\_keys field is ignored.

* **`include_claim_keys`** (array of strings)
  Array of unique strings. Each claim key can only contain alphanumeric characters and underscores.

### HTTP response status codes

* **201** - Empty response

* **400** - Bad Request

* **404** - Resource not found

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

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X PUT \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/oidc/customization/sub \
  -d '{
  "use_default": false,
  "include_claim_keys": [
    "repo",
    "context"
  ]
}'
```

**Response schema (Status: 201):**