---
type: api
title: Save APM server schema
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-saveapmserverschema
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-saveapmserverschema
products:
  - Kibana
---

# Save APM server schema

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

## Paths

- `POST` `/api/apm/fleet/apm_server_schema`
- `POST` `/s/{space_id}/api/apm/fleet/apm_server_schema`

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

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

## Request Body

`application/json`

- `schema` (object) — optional
  Schema object

## Responses

#### `200`

Successful response

`application/json`

Type: `object`

#### `400`

Bad Request response

`application/json`

- `error` (string)
  Error type
- `message` (string)
  Error message
- `statusCode` (number)
  Error status code
#### `401`

Unauthorized response

`application/json`

- `error` (string)
  Error type
- `message` (string)
  Error message
- `statusCode` (number)
  Error status code
#### `403`

Forbidden response

`application/json`

- `error` (string)
  Error type
- `message` (string)
  Error message
- `statusCode` (number)
  Error status code
#### `404`

Not found response

`application/json`

- `error` (string)
  Error type
- `message` (string)
  Error message
- `statusCode` (number)
  Error status code
## Code Examples

#### Console

```console
POST /api/apm/fleet/apm_server_schema
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/apm/fleet/apm_server_schema" \
  -H "elastic-api-version: string" \
  -H "kbn-xsrf: true"
```

