---
id: log-config-create
title: "Create a log configuration"
description: "Creates a new log configuration or overwrites an existing one, replacing any previous values."
sidebar_label: "Create a log configuration"
hide_title: true
hide_table_of_contents: true
api: eJztV22L20YQ/ivLfDx0tu+ao6BC4HppIaW0oXEo1DG+tTSWNpF2ld2RXxD672V2ZZ9k65q00H4o+WTJmp15ZuaZR6MGUnSJVRUpoyGGB4uS0AkpNO5EYTKRGL1RWW0lWwhjhdmi3VnlrbTAvXKkdCaMxkhYrAqZ8K3UB1FZ3CpTO7GVRY1uAhGYCoOn1ynEUJhsFfzHiQ8MEZDMHMQL+PkUG5YR7K91XRRVIWljbAlxA4kpS6nTlZYlQgzTwmTTAVZoI7D4qUZH35v0EM5oQk18KauqUIk3nH5wnHsDLsmxlHxFh4qdmvUHTAiCH2UxZWDKrVLcyLrgBw4LTMhYiGAYfBlBZTlbUujYZe/YU4C1MQVKDdFZG17hRml0Ypcj5WgF5cqNdEM5QTmKzu/kvX75Xr8UV1e/GMKrq1i83giyNUZCkehSCCceZYaa4ov6X3euHkWFtlTOKaO/E4Yx7JQ7c/Sck0cGAhGgrkuIFx7BRhYOl20EuK/48Er2y+DIKp1dVIHh5zietzZ0zDsKPKxU9zSVhKKsHYk1CldhojYKU2Yf7mVZFRzxdnb74nr27fXN7fzmLp7N4tnsDyaMTBJTa1qptAdPacIM7QW++8ChdYFCPUHtIiYnqJL8s861KHCLxQDN7Tcv7toel0YIOAw8z1HwnAgynGMpKckx5Tum9WG8av2IDaDeKmt06ceBqZrWSZia9pzKXwTnsknScYOUxlQoPV6dyRATM8lXB2JIcV0zI7RZobXGrhybMUviu1nLIEmRb2VhsgcfOGgXtP6pw6S2ig4QLxpYo7Ro72vKIV4s2yUPtKuMdmE0b2cz/rlM6qRWYiedcHWSoHOb2nfvH2vJfy4L4qsufNWF53Vh8r8ShggC2dLVIOhxyFwPtLRWHiACRVi6z08qYcn7Bw450FGU9ej4PGwkIxaJrORaFYoOq0QSZsYePmdXWbNVKdpRuy6ns0xH4fX0cmD9qtOecUX1WuqHk1DzzDsvpx/xAPH5ShaB3/K+cDVjDS6RcsNrYGWcL7dkfQY2JWvYs8beWb9t2S3aAKK2zIacqHLxdCorNenDmSSmvKDjmxOZRfAEDOP4pnjLih1a3X9fnErJoRiDN2OR9kYQdRc/GluyeMFPv899vflN8NvT/vnDE537mu9VcKB+4xo0lCBWhqEwPD+2I1P7t+ZJ6Y3xZejY8RDaI3x/uO1oXajvzWQ2mXFAbmgpfaiOA+HdLOToWjLoUm9L/9e/RrrOEu5pWhVS+Wp5YjUdGxfQZyNEXLrTrs9Lfs7cjRfQNGvp8J0t2pb//lQjD/diyWNhFb8L/OoRQY7Sz/Npjh5CutdzBnOaosuloo2OJ+6TBCv6S9v+eL359e2cadp9BJUm5TNW7vjDRu4gBv9hRmG+m/BfA4XUWS0ztg0+mQxyOBNnM+CzOqqrPvQQNk2wmJuPqNsWoi4V4ntol23b/gnqMh4w
sidebar_class_name: "post api-method"
info_path: docs/api/control-plane
custom_edit_url: null
---

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import ParamsDetails from "@theme/ParamsDetails";
import RequestSchema from "@theme/RequestSchema";
import StatusCodes from "@theme/StatusCodes";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";
import Heading from "@theme/Heading";

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Create a log configuration"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/controlplane/log/config"}
  context={"endpoint"}
>
  
</MethodEndpoint>



Creates a new log configuration or overwrites an existing one, replacing any previous values.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={undefined}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"application/json":{"schema":{"type":"object","required":["is_default","selector","configuration"],"properties":{"is_default":{"type":"boolean","description":"Defines whether this log configuration is the default.\n>\n> **Note**: If true, it requires the `agent:log_config:create-default` permission; otherwise, it requires `agent:log_config:create`.\n>","enum":[true,false]},"expires_at":{"type":"string","description":"If the log configuration is not default, an expiration date must be specified.","example":"2024-07-12T15:00:00Z"},"account_id":{"type":"integer","description":"Applicable if the log specification is at the account level.","example":2345},"selector":{"type":"object","description":"The tags to be matched to apply the log configuration","example":{"environment":"production"}},"configuration":{"type":"object","description":"The log configuration as defined in the log specification.","example":{"log_level":"debug","no_error_sampling":50}}},"title":"logConfigCreate"}}}}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"description":"The operation was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"is_default":{"type":"boolean","description":"Defines whether this log configuration is the default. \n>\n> **Note**: If true, it requires the `agent:log_config:create-default` permission; otherwise, it requires `agent:log_config:create`.\n>","enum":[true,false]},"expires_at":{"type":"string","description":"If the log configuration is not default, an expiration date must be specified.","example":"2024-07-12T15:00:00Z"},"account_id":{"type":"integer","description":"Applicable if the log specification is at the account level.","example":2345},"selector":{"type":"object","description":"The tags to be matched to apply the log configuration.","example":{"environment":"production"}},"configuration":{"type":"object","description":"The log configuration as defined in the log specification.","example":{"log_level":"debug","no_error_sampling":50}},"created_configuration_defaults":{"type":"array","items":{"type":"object","properties":{"template_id":{"type":"string"},"template_name":{"type":"string"},"capability_category":{"type":"string"},"capability_provider":{"type":"string"},"default_configuration_id":{"type":"string"}},"title":"configurationDefault"}}},"title":"logConfig"}}}}}}
>
  
</StatusCodes>


      