# Set project trace-export configuration **PUT /api/v1/projects/{id}/trace-export/config** Stores the project-level OTLP trace-export settings. The auth secret is referenced only (headers_secret_ref); the raw value is never accepted or stored. Bumps the generation counter and marks the config pending for downstream delivery. The project scope is carried by the route id path parameter and the org is derived from that project. ## Servers - https://agentengine.mongodb.com: https://agentengine.mongodb.com () ## Authentication methods - Bearer auth ## Parameters ### Path parameters - **id** (string) Project ID ### Body: application/json (object) Typed JSON config - **content_mode** (string) ContentMode selects span content redaction. Empty means metadata_only. - **egress_mode** (string) EgressMode selects where spans are delivered. Empty means platform_only. - **enabled** (boolean) Enabled is a pointer so the handler can distinguish an omitted field (nil, rejected) from an explicit false (a valid "disable export" request). - **endpoint** (string) Endpoint is the customer's OTLP/HTTP endpoint. Required when enabled. Must be https and must not point at an internal/loopback address (see Validate). - **headers** (object) Headers holds NON-SECRET export headers a preset requires (e.g. a workspace id). Secret values must never be placed here — use HeadersSecretRef. - **headers_secret_ref** (string) HeadersSecretRef is a pointer to the single stored auth secret (typically an API key). It is a reference — never the secret value. Must be scoped to the caller's project (see Validate). - **insecure_skip_verify** (boolean) InsecureSkipVerify disables TLS verification of the customer endpoint. A pointer so nil (verify, the default) is distinct from an explicit opt-out; the UI surfaces enabling this as a deliberate reduction in security. - **protocol** (string) Protocol is the outbound OTLP protocol. v1 supports http/protobuf only. - **resource_attributes** (object) ResourceAttributes are extra OTLP resource attributes stamped onto every span sent to the customer endpoint (e.g. a destination-required project/model identifier). Which keys a given destination requires comes from its preset (see pkg/traceexportconfig/presets); values are always customer-supplied, since they typically name a project on the destination's own side that this platform has no way to look up. - **sampling_policy** (object) SamplingPolicy selects the head sampler applied before export. - **secret_header_name** (string) SecretHeaderName is the header name the referenced secret's value is sent as (e.g. "api_key"), taken from the preset's secret_header_keys or entered by the user for a custom destination. The platform composes the outbound ": " header line, so the stored secret is always the bare value (never a pre-formatted header line). Required when HeadersSecretRef is set (see Validate). ## Responses ### 406 Unsupported or malformed API version, an operation unavailable in the selected published contract, or an unacceptable representation (including unsupported media-type parameters or excluded SSE). Existing authentication, authorization, and rate-limit failures take precedence. #### Body: application/json (object) - **badRequestDetail** (object) Optional validation details defined by the standard error schema; API negotiation errors do not emit this field. - **detail** (string) Human-readable error details. - **error** (integer) HTTP status code. - **errorCode** (string) Machine-readable error code. - **parameters** (array[string]) Request parameter names associated with the error; omitted when none apply. - **reason** (string) HTTP status reason phrase. ### 200 OK #### Body: application/json (object) - **generation** (integer) - **updated_at** (string) ### 400 Invalid config #### Body: application/json (object) - **code** (string) - **error** (string) - **success** (boolean) ### 401 Missing or invalid credentials #### Body: application/json (object) - **code** (string) - **error** (string) - **success** (boolean) ### 403 Caller lacks project-owner permission #### Body: application/json (object) - **code** (string) - **error** (string) - **success** (boolean) ### 413 Config exceeds 16 KB #### Body: application/json (object) - **code** (string) - **error** (string) - **success** (boolean) [Powered by Bump.sh](https://bump.sh)