---
type: api
title: Create a space
description: Create a new Kibana space.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-post-spaces-space
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-post-spaces-space
products:
  - Kibana
---

# Create a space

- Server: `https://{kibana_url}`

## Paths

- `POST` `/api/spaces/space`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/authentication#apikeyauth)

## Description

Create a new Kibana space.

## Request Body

`application/json`

- `_reserved` (boolean) — optional
- `color` (string) — optional
  The hexadecimal color code used in the space avatar. By default, the color is automatically generated from the space name.
- `description` (string) — optional
  A description for the space.
- `disabledFeatures` ([] string · max: 100 · default: []) — optional
- `id` (string) — required
  The space ID that is part of the Kibana URL when inside the space. Space IDs are limited to lowercase alphanumeric, underscore, and hyphen characters (a-z, 0-9, _, and -). You are cannot change the ID with the update operation.
- `imageUrl` (string) — optional
  The data-URL encoded image to display in the space avatar. If specified, initials will not be displayed and the color will be visible as the background color for transparent images. For best results, your image should be 64x64. Images will not be optimized by this API call, so care should be taken when using custom images.
- `initials` (string · max: 2) — optional
  One or two characters that are shown in the space avatar. By default, the initials are automatically generated from the space name.
- `name` (string · min: 1) — required
  The display name for the space.
- `projectRouting` (string) — optional
  Cross-project search default routing configuration for this space. Controls whether searches are scoped to a single project or span multiple projects in serverless environments.

## Response

Indicates a successful call.

`application/json`

- `_reserved` (boolean)
- `color` (string)
  The hexadecimal color code used in the space avatar. By default, the color is automatically generated from the space name.
- `description` (string)
  A description for the space.
- `disabledFeatures` ([] string · max: 100 · default: [])
- `id` (string)
  The space ID that is part of the Kibana URL when inside the space. Space IDs are limited to lowercase alphanumeric, underscore, and hyphen characters (a-z, 0-9, _, and -). You are cannot change the ID with the update operation.
- `imageUrl` (string)
  The data-URL encoded image to display in the space avatar. If specified, initials will not be displayed and the color will be visible as the background color for transparent images. For best results, your image should be 64x64. Images will not be optimized by this API call, so care should be taken when using custom images.
- `initials` (string · max: 2)
  One or two characters that are shown in the space avatar. By default, the initials are automatically generated from the space name.
- `name` (string · min: 1)
  The display name for the space.
- `projectRouting` (string)
  Cross-project search default routing configuration for this space. Controls whether searches are scoped to a single project or span multiple projects in serverless environments.
## Code Examples

#### Console

```console
POST /api/spaces/space
{
  "id": "marketing",
  "name": "Marketing",
  "description": "This is the Marketing Space",
  "color": "null",
  "initials": "MK",
  "disabledFeatures": [],
  "imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAABACAYAAABC6cT1AAAGf0lEQVRoQ\u002B3abYydRRUH8N882xYo0IqagEVjokQJKAiKBjXExC9G/aCkGowCIghCkRcrVSSKIu/FEiqgGL6gBIlAYrAqUTH6hZgQFVEMKlQFfItWoQWhZe8z5uzMLdvbfbkLxb13d\u002Bfbvfe588x/zpn/\u002BZ9zJpmnI81T3BaAzzfLL1h8weLzZAcWXH2eGHo7zAWLL1h8nuzAjFw9G1N6Kzq8HnuM36MR8iibF3Fv4q\u002B7cv8yDV6K13bYq2furSP8Ag8ncr/vnSnwRViJT2GfCV7yL1yHGxLb\u002Bl3EdM9lluNEnIC9xz\u002Bf2ZL4Er6Z2DrdXN3fZwp8CU7OfDHxggle8lTLbQ1nJ/7Z7yKmey5zYGZt4h2IzR8/trRc2PDlxJPTzfVcgJ\u002BCC0wMPOa9F6cm7up3EVM9V9386MxliVdM8GwAv6hh/awCz/w7lY25OtF5ruBz4ZLP42NYNrDAFbC3YPWuILnMAfgq3oaRQQYea/stViV\u002BsgssvjKzLvGySeaaNVfP4d7Btokgvxj/bblgpueuF1hmWcyTCmfE3J3M1lTcv0vMswM88zR\u002Bjpw4osu6me8kzkpsfLZWzxyRuabO22buxxOJ12FxnXfWgEe83pB5sOE47BsLymzscOoi7nw2JJfZreUjiUsTyzKPZm5NvBDvSuw268AzNzV8H5/Am\u002BqCnsAXgpgSW2Zq9cyKlksbPlTd\u002Bte4quWNieMHBfiNDdciYnwsdI/MaOaWhnMTf54J8C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iaRp8tlN3ueCTYPHH9RNaunjI8Z7wLYpT3jZSCYXQ8e9vTsRE/q\u002Bno3XMKeObgGtaintbb/AvXj4JDkNw/5hrwYPfIvlZFUbLn7G5q\u002BeQIN09Vnho6cqvnM/Lt99RixH49wO8K0ZL41WTWHoQzvsNVkOheZqKhEGpsp3SzB\u002BBBtZAYve7uOR9tuTaaB6l0XScdYfEQPpkTUyHEGP\u002BXqyDBzu\u002BNBCITUjNWHynkrbWKOuWFn1xKzqsyx0bdvS78odp0\u002BN503Zao0uCsWuSIDku8/7EO60b41vN5\u002BSes9BKlTdvd8bhp9EBvJjWJAIn/vxwHe6b3tSk6JFPV4nq85oAOrx555v/x/rh3E6Lo\u002BbnuNS4uB4Cuq0ZfvO8X1rM6q/\u002BvnjLVqZq7v83onttc2oYF4HPJmv1gWbB4P7s0l55ZsPhcsmY/WBYs3s8uzaVn5q3F/wf70mRuBCtbjQAAAABJRU5ErkJggg=="
}
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/spaces/space" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "marketing",
  "name": "Marketing",
  "description": "This is the Marketing Space",
  "color": "null",
  "initials": "MK",
  "disabledFeatures": [],
  "imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAABACAYAAABC6cT1AAAGf0lEQVRoQ\u002B3abYydRRUH8N882xYo0IqagEVjokQJKAiKBjXExC9G/aCkGowCIghCkRcrVSSKIu/FEiqgGL6gBIlAYrAqUTH6hZgQFVEMKlQFfItWoQWhZe8z5uzMLdvbfbkLxb13d\u002Bfbvfe588x/zpn/\u002BZ9zJpmnI81T3BaAzzfLL1h8weLzZAcWXH2eGHo7zAWLL1h8nuzAjFw9G1N6Kzq8HnuM36MR8iibF3Fv4q\u002B7cv8yDV6K13bYq2furSP8Ag8ncr/vnSnwRViJT2GfCV7yL1yHGxLb\u002Bl3EdM9lluNEnIC9xz\u002Bf2ZL4Er6Z2DrdXN3fZwp8CU7OfDHxggle8lTLbQ1nJ/7Z7yKmey5zYGZt4h2IzR8/trRc2PDlxJPTzfVcgJ\u002BCC0wMPOa9F6cm7up3EVM9V9386MxliVdM8GwAv6hh/awCz/w7lY25OtF5ruBz4ZLP42NYNrDAFbC3YPWuILnMAfgq3oaRQQYea/stViV\u002BsgssvjKzLvGySeaaNVfP4d7Btokgvxj/bblgpueuF1hmWcyTCmfE3J3M1lTcv0vMswM88zR\u002Bjpw4osu6me8kzkpsfLZWzxyRuabO22buxxOJ12FxnXfWgEe83pB5sOE47BsLymzscOoi7nw2JJfZreUjiUsTyzKPZm5NvBDvSuw268AzNzV8H5/Am\u002BqCnsAXgpgSW2Zq9cyKlksbPlTd\u002Bte4quWNieMHBfiNDdciYnwsdI/MaOaWhnMTf54J8CqNj8x8JXFIZltYu\u002BHqlmNT8YSBsHgAPw/vxvlVV4du/s0oaxbxg0TbL/jMni0nNcVjQq7\u002BHZfgtpbzBg342TgQ63AkmsymxBW4IjE6A\u002BD7Vzd/fyWxIM/VuCe\u002BHzTgZ2Jpy/kNJ2FJLmLm24mPJ/42A\u002BBvrxt4SISwlhsaPodH26LZB8rVA3inwwebsrixJCZzX\u002BKMxI/7AV61eVh3DV6Mx3EOvh4kN6jAg8nfUCXm4d1wE66OyxNPTQc\u002Bs3/o/MoXizL3JE5O3F3P/uBZPPF4Zr\u002BWi5uSO48ZPRdyCwn7YB/A35m5KhWNHox4fcNnIs0ddOCRSBxf8\u002BcQG\u002BHuf0l8NJVYP\u002BnI7NXy2ar4QqIGm69JfKPOE2w/mBavCzwM11R2D\u002BChsUO7hyUfmwx55qDM1xJvqZ7y08TpifuGBfjeURVJnNIVGpkNiXNS0ds7jcySDitDCCWW56LJ10fRo8sNA\u002B3qXUSZD2CtQlZh9T\u002B1rB7h9oliembflnMbzqgSNZKbKGHdPm7OwXb1CvQ1metSETMpszmzvikCJNh/h5E5PHNl4qga/\u002B/cxqrdeWDYgIe7X5L4cGJPJX2940lOX8pD41FnFnc4riluvQKbK0dcHJFi2IBHNTQSlguru4d2/wPOTNzRA3x5y\u002BU1E1uqWDkETOT026XuUJzx6u7ReLhSYenQ7uHua0fKZmwfmcPqsQjxE5WVONcRxn7X89zgn/EKPMRMxOVQXmP18Mx3q3b/Y/0cQE/IhFtHESMsHFlZ1Ml3CH3DZPHImY\u002BpxcKumNmYirtvqMBfhMuU6s3iqOQkTsMPe1tCQwO8Ajs0lxr7W\u002Bvnp1MJc9EgCNd/cy6x\u002B9D4veXmprj5wxMw/3C4egW6zzgZOlYZzfwo3F2J7ael0pJamvlPKgWNKFft1AAcKotXoFEbD7kaoSoQPVKB35\u002B5KHF0lai/rJo\u002Bup87jWEE/qqqwY\u002BqrL21LWLm95lPJ16ppKw31XC3PXYPJauPEx7B6BHCgrSizRs18qiaRp8tlN3ueCTYPHH9RNaunjI8Z7wLYpT3jZSCYXQ8e9vTsRE/q\u002Bno3XMKeObgGtaintbb/AvXj4JDkNw/5hrwYPfIvlZFUbLn7G5q\u002BeQIN09Vnho6cqvnM/Lt99RixH49wO8K0ZL41WTWHoQzvsNVkOheZqKhEGpsp3SzB\u002BBBtZAYve7uOR9tuTaaB6l0XScdYfEQPpkTUyHEGP\u002BXqyDBzu\u002BNBCITUjNWHynkrbWKOuWFn1xKzqsyx0bdvS78odp0\u002BN503Zao0uCsWuSIDku8/7EO60b41vN5\u002BSes9BKlTdvd8bhp9EBvJjWJAIn/vxwHe6b3tSk6JFPV4nq85oAOrx555v/x/rh3E6Lo\u002BbnuNS4uB4Cuq0ZfvO8X1rM6q/\u002BvnjLVqZq7v83onttc2oYF4HPJmv1gWbB4P7s0l55ZsPhcsmY/WBYs3s8uzaVn5q3F/wf70mRuBCtbjQAAAABJRU5ErkJggg=="
}'
```

## Response Examples

#### Get details about a marketing space

```json
{
  "id": "marketing",
  "name": "Marketing",
  "description": "This is the Marketing Space",
  "color": "null",
  "initials": "MK",
  "disabledFeatures": [],
  "imageUrl": "",
  "solution": "es"
}
```

