---
updatedAt: 2026-04-27T08:54:40.000Z
agentTools:
  siteIndex: https://techdocs.akamai.com/llms.txt
  projectIndex: https://techdocs.akamai.com/msl5-harmonic/llms.txt
---

# Create log destination

Create a new log destination for a stream.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Media Services Live API",
    "description": "",
    "license": {
      "name": ""
    },
    "version": "1.9.7"
  },
  "servers": [
    {
      "url": "https://{hostname}"
    }
  ],
  "security": [
    {
      "jwt": []
    }
  ],
  "paths": {
    "/api/v1/streams/{stream_id}/log_destinations": {
      "post": {
        "tags": [
          "Log Destination"
        ],
        "summary": "Create log destination",
        "description": "Create a new log destination for a stream.",
        "operationId": "create_log_destination",
        "parameters": [
          {
            "name": "stream_id",
            "in": "path",
            "description": "Stream ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLogDestinationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Log destination created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogDestinationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_frequency": {
                    "summary": "Invalid frequency value",
                    "value": {
                      "error": "Frequency must be 30 or 60 seconds"
                    }
                  },
                  "limit_per_account": {
                    "summary": "Account limit reached",
                    "value": {
                      "error": "Maximum log destinations for account reached"
                    }
                  },
                  "limit_per_stream": {
                    "summary": "Per-stream limit reached",
                    "value": {
                      "error": "Maximum log destinations per stream reached"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_token": {
                    "summary": "Invalid or expired token",
                    "value": {
                      "error": "Error decoding token"
                    }
                  },
                  "no_token": {
                    "summary": "Missing authentication token",
                    "value": {
                      "error": "No token found in request"
                    }
                  },
                  "token_verification_failed": {
                    "summary": "Token verification failed",
                    "value": {
                      "error": "No key found for kid"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - no access to stream.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "insufficient_permissions": {
                    "summary": "Insufficient permissions",
                    "value": {
                      "error": "Forbidden"
                    }
                  },
                  "no_stream_access": {
                    "summary": "No access to stream",
                    "value": {
                      "error": "No access on stream 'stream_id' because not authorized on Group ID 'group_id' of Contract 'contract_id'"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Stream not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "stream_not_found": {
                    "summary": "Stream not found",
                    "value": {
                      "error": "Stream not found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CreateLogDestinationRequest": {
        "type": "object",
        "required": [
          "frequency_in_sec",
          "log_destination_config"
        ],
        "properties": {
          "active": {
            "type": "boolean",
            "description": "Whether this log destination should be active. Defaults to true if not specified.",
            "example": true
          },
          "file_prefix": {
            "type": "string",
            "description": "Prefix for log file names (length limit 10).",
            "example": "msl"
          },
          "file_suffix": {
            "type": "string",
            "description": "Suffix for log file names (length limit 100).",
            "example": "logs"
          },
          "frequency_in_sec": {
            "type": "integer",
            "format": "int32",
            "description": "Export frequency in seconds (30 or 60).",
            "example": 30
          },
          "log_destination_config": {
            "description": "Configuration for the log destination."
          }
        },
        "example": {
          "active": false,
          "file_prefix": "msl",
          "file_suffix": "logs",
          "frequency_in_sec": 30,
          "log_destination_config": {
            "access_key": "AKIAIOSFODNN7EXAMPLE",
            "bucket": "my-bucket",
            "compress_logs": true,
            "description": "My S3 destination",
            "destination_type": "S3_COMPATIBLE",
            "endpoint": "https://s3.amazonaws.com",
            "path": "logs",
            "region": "us-west-2",
            "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Error message."
          }
        }
      },
      "FrequencyInSec": {
        "type": "string",
        "description": "Allowed frequency values for log export in seconds.\nOnly 30 or 60 seconds are supported.",
        "enum": [
          "Thirty",
          "Sixty"
        ]
      },
      "LogDestinationResponse": {
        "type": "object",
        "required": [
          "log_destination_id",
          "stream_id",
          "file_prefix",
          "file_suffix",
          "frequency_in_sec",
          "log_destination_config",
          "active",
          "created_by",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "active": {
            "type": "boolean",
            "description": "Whether this log destination is active.",
            "example": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the log destination was created.",
            "example": "2024-01-01T00:00:00Z"
          },
          "created_by": {
            "type": "string",
            "description": "Identity of who created the log destination.",
            "example": "user@example.com"
          },
          "file_prefix": {
            "type": "string",
            "description": "Prefix for log file names.",
            "example": "msl"
          },
          "file_suffix": {
            "type": "string",
            "description": "Suffix for log file names.",
            "example": "logs"
          },
          "frequency_in_sec": {
            "$ref": "#/components/schemas/FrequencyInSec",
            "description": "Export frequency in seconds (30 or 60)."
          },
          "log_destination_config": {
            "description": "Configuration for the log destination."
          },
          "log_destination_id": {
            "type": "string",
            "description": "Unique identifier for the log destination.",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          },
          "stream_id": {
            "type": "string",
            "description": "Stream ID associated with this log destination.",
            "example": "abc12345-6789-4abc-8def-1234567890ab"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the log destination was last updated.",
            "example": "2024-01-01T00:00:00Z"
          }
        },
        "example": {
          "active": true,
          "created_at": "2024-01-01T00:00:00Z",
          "created_by": "user@example.com",
          "file_prefix": "msl",
          "file_suffix": "logs",
          "frequency_in_sec": 30,
          "log_destination_config": {
            "access_key": "AKIAIOSFODNN7EXAMPLE",
            "bucket": "my-bucket",
            "compress_logs": true,
            "description": "My S3 destination",
            "destination_type": "S3_COMPATIBLE",
            "endpoint": "https://s3.amazonaws.com",
            "path": "logs",
            "region": "us-west-2",
            "secret_access_key": "********"
          },
          "log_destination_id": "123e4567-e89b-12d3-a456-426614174000",
          "stream_id": "abc12345-6789-4abc-8def-1234567890ab",
          "updated_at": "2024-01-01T00:00:00Z"
        }
      }
    },
    "securitySchemes": {
      "jwt": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}
```

# Sibling pages

* [List log destinations](https://techdocs.akamai.com/msl5-harmonic/reference/list_log_destinations.md)
* [Get log destination details](https://techdocs.akamai.com/msl5-harmonic/reference/get_log_destination.md)
* [Update log destination](https://techdocs.akamai.com/msl5-harmonic/reference/update_log_destination.md)
* [Delete log destination](https://techdocs.akamai.com/msl5-harmonic/reference/delete_log_destination.md)
* [Activate log destination](https://techdocs.akamai.com/msl5-harmonic/reference/activate_log_destination.md)
* [Deactivate log destination](https://techdocs.akamai.com/msl5-harmonic/reference/deactivate_log_destination.md)