---
title: "Create repository label (beta)"
method: POST
path: "/orgs/{org_slug}/repos/labels"
tags: ["repo-labels"]
---

# Create repository label (beta)

`POST /orgs/{org_slug}/repos/labels`

Create a repository label.

Labels can be used to group and organize repositories and to apply security/license policies.

This endpoint consumes 1 unit of your quota.

This endpoint requires the following org token scopes:
- repo-label:create

## Path parameters

- `org_slug` string, required

## Request body

- object
  - `name` string, required — The name of the label

## Response `201`

Creates a new repository label for the specified organization. The authenticated user must be a member of the organization. Label names must be non-empty and less than 1000 characters.

- object
  - `id` string — The ID of the label
  - `name` string — The name of the label
  - `repository_ids` string[] — The IDs of repositories this label is associated with
  - `has_security_policy` boolean — Whether the label has a security policy
  - `has_license_policy` boolean — Whether the label has a license policy

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `403` — Insufficient max_quota for API method
- `404` — Resource not found
- `409` — Conflict
- `429` — Insufficient quota for API route

---

[API](https://skmtc.dev/socket-dev/apis/socket.md) · [All operations](https://skmtc.dev/socket-dev/apis/socket/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/socket-dev/socket/revisions/bf994b75d33f/schema)
