---
ai:
  exclude: true
search:
  tags:
    - component
    - POST
seo:
  description: >-
    Create a component via POST. Reference for the POST /api/2/component
    endpoint in the Jira Software Data Center REST API Reference.
sidebar:
  label: Create component
  badge: POST
title: Create component
type: openapi-operation
---
Create a component via POST.

`POST /api/2/component`

**Request body** (`application/json`)

the request containing value of the component's property. The value has to be a valid, non-empty JSON conforming to http://tools.ietf.org/html/rfc4627. The maximum length of the property value is 32768 bytes.

- `archived` (boolean)
- `assigneeType` (string)
- `deleted` (boolean)
- `description` (string)
- `id` (string)
- `lead` (UserBean)
- `leadUserName` (string)
- `name` (string)
- `project` (string)
- `self` (string<uri>)

Request body example:

```json
{
  "archived": false,
  "assigneeType": "PROJECT_LEAD",
  "deleted": false,
  "description": "This is a Jira component",
  "id": "10000",
  "lead": {
    "active": true,
    "applicationRoles": [
      "jira-core",
      "jira-admin",
      "important"
    ],
    "avatarUrls": {
      "48x48": "http://www.example.com/jira/secure/useravatar?size=large&ownerId=fred",
      "24x24": "http://www.example.com/jira/secure/useravatar?size=small&ownerId=fred",
      "16x16": "http://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=fred",
      "32x32": "http://www.example.com/jira/secure/useravatar?size=medium&ownerId=fred"
    },
    "deleted": false,
    "displayName": "Fred F. User",
    "emailAddress": "fred@example.com",
    "expand": "string",
    "groups": {
      "callback": {},
      "maxResults": 0,
      "pagingCallback": {},
      "size": 0
    },
    "key": "JIRAUSER10100",
    "lastLoginTime": "2023-08-30T16:37:01+1000",
    "locale": "en_AU",
    "name": "fred",
    "self": "http://www.example.com/jira/rest/api/2.0/user?username=fred",
    "timeZone": "Australia/Sydney"
  },
  "leadUserName": "fred",
  "name": "Component 1",
  "project": "HSP",
  "self": "http://www.example.com/jira/rest/api/2/component/10000"
}
```

**Responses**

- `201` — Returned if the component is created successfully.
- `401` — Returned if the caller is not logged in and does not have permission to create components in the project.
- `403` — Returned if the caller is authenticated and does not have permission to create components in the project.
- `404` — Returned if the project does not exist or the currently authenticated user does not have permission to view it.

Response example, 201:

```json
{
  "archived": false,
  "assigneeType": "PROJECT_LEAD",
  "deleted": false,
  "description": "This is a Jira component",
  "id": "10000",
  "lead": {
    "active": true,
    "applicationRoles": [
      "jira-core",
      "jira-admin",
      "important"
    ],
    "avatarUrls": {
      "48x48": "http://www.example.com/jira/secure/useravatar?size=large&ownerId=fred",
      "24x24": "http://www.example.com/jira/secure/useravatar?size=small&ownerId=fred",
      "16x16": "http://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=fred",
      "32x32": "http://www.example.com/jira/secure/useravatar?size=medium&ownerId=fred"
    },
    "deleted": false,
    "displayName": "Fred F. User",
    "emailAddress": "fred@example.com",
    "expand": "string",
    "groups": {
      "callback": {},
      "maxResults": 0,
      "pagingCallback": {},
      "size": 0
    },
    "key": "JIRAUSER10100",
    "lastLoginTime": "2023-08-30T16:37:01+1000",
    "locale": "en_AU",
    "name": "fred",
    "self": "http://www.example.com/jira/rest/api/2.0/user?username=fred",
    "timeZone": "Australia/Sydney"
  },
  "leadUserName": "fred",
  "name": "Component 1",
  "project": "HSP",
  "self": "http://www.example.com/jira/rest/api/2/component/10000"
}
```
