---
title: "Create an organization component as an administrator"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cloudraker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an organization component as an administrator

Path: CloudRaker Workspace API › Agent components

`POST /agent-components`

## Authentication

- `bearerAuth`, http, header `Authorization`

## Request body

_Required._

- `slug` (`createAgentComponent.slug`; string, required)
  - pattern `^[a-z][a-z0-9-]{0,63}$`
- `definition` (`createAgentComponent.definition`; map<unknown>, required)

## Example request

```json
{
  "slug": "string",
  "definition": {
    "property1": null,
    "property2": null
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.cloudraker.com/agent-components \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "slug": "string",
  "definition": {
    "property1": null,
    "property2": null
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/agent-components';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({slug: 'string', definition: {property1: null, property2: null}})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/agent-components"

payload = {
    "slug": "string",
    "definition": {
        "property1": None,
        "property2": None
    }
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 201

Create an organization component as an administrator

#### Example

```json
{
  "data": null
}
```

- `data` (`createAgentComponent.response.201.data`; unknown, required)

### 400

Validation Error

#### Example

```json
{
  "success": false,
  "error": [
    null
  ],
  "data": null
}
```

- `success` (`createAgentComponent.response.400.success`; boolean, required)
  - one of `false`
- `error` (`createAgentComponent.response.400.error`; array<unknown>, required)
- `data` (`createAgentComponent.response.400.data`; unknown, required)


Source: https://docs.cloudraker.com/workspace/api/agent-components/create-agent-component/index.md
