> ## Documentation Index
> Fetch the complete documentation index at: https://gcore.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Change target

> Change logs uploader target.



## OpenAPI

````yaml /api-reference/services_documented/cdn_api.yaml put /cdn/logs_uploader/targets/{id}
openapi: 3.1.0
info:
  title: Gcore OpenAPI – CDN API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: '2026-05-15T06:37:28.230198+00:00'
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: CDN service
    description: Information about the current state of the CDN service in your account.
    x-displayName: CDN service
  - name: CDN resources
    x-displayName: CDN resources
  - name: Origins
    x-displayName: Origins
  - name: Rules
    description: >-
      Rules allow to set up custom settings for certain file types or paths.

      By default, the rule inherits all options values from the related CDN
      resource.


      Each option in rule settings can be in one of the following states:

      - **Inherit** - Option is not added to the rule. Option inherits its value
      from the CDN resource settings. In this case, the option value is
      **null**.

      - **ON** - Option is added to the rule and enabled. Option values
      configured in the rule will override values from the CDN resource
      settings.

      - **OFF** - Option is added to the rule and disabled. Option will be
      turned off.
    x-displayName: Rules
  - name: Rule templates
    x-displayName: Rule templates
  - name: SSL certificates
    x-displayName: SSL certificates
  - name: Let's Encrypt certificates
    x-displayName: Let's Encrypt certificates
  - name: CA certificates
    x-displayName: CA certificates
  - name: CDN activity logs
    description: |-
      Get the history of users requests to CDN.
      It contains requests made both via the API and via the control panel.

      The following methods are not tracked in the activity logs:
      - HEAD
      - OPTIONS
    x-displayName: CDN activity logs
  - name: Log viewer
    description: >-
      Log viewer provides you with general information about CDN operation. This
      information does not contain all possible

      sets of fields and restricted by time. To receive full data, use Logs
      Uploader.
    x-displayName: Log viewer
  - name: Logs uploader
    description: >-
      Logs uploader allows you to upload logs with desired format to desired
      storages.


      Consists of three main parts:

      - **Policies** - rules that define which logs are uploaded and how they
      are uploaded.

      - **Targets** - destinations where logs are uploaded.

      - **Configs** - combinations of logs uploader policies, targets and
      resources to which they are applied.
    x-displayName: Logs uploader
  - name: Tools
    x-displayName: Tools
  - name: CDN Statistics
    description: >-
      Consumption statistics is updated in near real-time as a standard
      practice.

      However, the frequency of updates can vary, but they are typically
      available within a 24-hour period.

      Exceptions, such as maintenance periods, may delay data beyond 24 hours
      until servers resume and fill in the missing statistics.
    x-displayName: Statistics
  - name: Advanced analytics
    description: >-
      Advanced analytics allows to get statistics about unique visitors,
      traffic, and requests for countries, directories, browsers, devices, and
      operation systems for up to 90 days starting from today.


      Advanced analytics API is based on the [GraphQL
      framework](https://graphql.org/).


      Advanced analytics API has one single endpoint:

       https://api.gcore.com/cdn/advanced/v2/query

      You can pass the query parameters as a JSON object in the payload of a
      POST request to this endpoint.

      You can use curl to make requests to the Advanced analytics API.
      Alternatively, you can use a GraphQL client

      to construct queries and pass requests to the Advanced analytics API.


      You can write queries in GraphQL much like in SQL: specify the data set
      (CDN resource), the metrics

      to retrieve (such as unique visitors and traffic), and filter or group by
      dimensions (for example, a country).
    x-displayName: Advanced analytics
  - name: Origin shielding
    x-displayName: Origin shielding
  - name: IP addresses list
    x-displayName: IP addresses list
  - name: Purge history
    x-displayName: Purge history
paths:
  /cdn/logs_uploader/targets/{id}:
    put:
      tags:
        - Logs uploader
      summary: Change target
      description: Change logs uploader target.
      operationId: change-target
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLogsUploaderTarget'
      responses:
        '200':
          description: Successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LogsUploaderTargetResponse'
        '400':
          description: You will receive an error with the invalid parameter mentioned.
        '403':
          description: Feature is disabled for your account.
        '404':
          description: Logs uploader target do not exist or has been deleted.
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from gcore import Gcore

            client = Gcore(
                api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
            )
            logs_uploader_target = client.cdn.logs_uploader.targets.replace(
                id=0,
                config={
                    "access_key_id": "access_key_id",
                    "bucket_name": "bucket_name",
                    "endpoint": "endpoint",
                    "region": "region",
                    "secret_access_key": "secret_access_key",
                },
                storage_type="s3_gcore",
            )
            print(logs_uploader_target.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/G-Core/gcore-go\"\n\t\"github.com/G-Core/gcore-go/cdn\"\n\t\"github.com/G-Core/gcore-go/option\"\n)\n\nfunc main() {\n\tclient := gcore.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tlogsUploaderTarget, err := client.CDN.LogsUploader.Targets.Replace(\n\t\tcontext.TODO(),\n\t\t0,\n\t\tcdn.LogsUploaderTargetReplaceParams{\n\t\t\tConfig: cdn.LogsUploaderTargetReplaceParamsConfigUnion{\n\t\t\t\tOfS3GcoreConfig: &cdn.LogsUploaderTargetReplaceParamsConfigS3GcoreConfig{\n\t\t\t\t\tAccessKeyID:     \"access_key_id\",\n\t\t\t\t\tBucketName:      \"bucket_name\",\n\t\t\t\t\tEndpoint:        \"endpoint\",\n\t\t\t\t\tRegion:          \"region\",\n\t\t\t\t\tSecretAccessKey: \"secret_access_key\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tStorageType: cdn.LogsUploaderTargetReplaceParamsStorageTypeS3Gcore,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", logsUploaderTarget.ID)\n}\n"
components:
  schemas:
    CreateLogsUploaderTarget:
      type: object
      properties:
        storage_type:
          type: string
          enum:
            - s3_gcore
            - s3_amazon
            - s3_oss
            - s3_other
            - s3_v1
            - ftp
            - sftp
            - http
            - azure_blob
          description: Type of storage for logs.
        name:
          type: string
          description: Name of the target.
          maxLength: 255
          default: Target
        description:
          type: string
          description: Description of the target.
          maxLength: 255
        config:
          description: Config for specific storage type.
          oneOf:
            - $ref: '#/components/schemas/S3GcoreConfig'
            - $ref: '#/components/schemas/S3AmazonConfig'
            - $ref: '#/components/schemas/S3OSSConfig'
            - $ref: '#/components/schemas/S3OtherConfig'
            - $ref: '#/components/schemas/S3V1Config'
            - $ref: '#/components/schemas/FTPConfig'
            - $ref: '#/components/schemas/SFTPConfig'
            - $ref: '#/components/schemas/HTTPConfig'
            - $ref: '#/components/schemas/AzureBlobConfig'
      required:
        - storage_type
        - config
    LogsUploaderTargetResponse:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        client_id:
          type: integer
          description: Client that owns the target.
          readOnly: true
        created:
          type: string
          format: date-time
          readOnly: true
          description: Time when logs uploader target was created.
        updated:
          type: string
          format: date-time
          readOnly: true
          description: Time when logs uploader target was updated.
        storage_type:
          type: string
          enum:
            - s3_gcore
            - s3_amazon
            - s3_oss
            - s3_other
            - s3_v1
            - ftp
            - sftp
            - http
            - azure_blob
          description: Type of storage for logs.
        name:
          type: string
          description: Name of the target.
          maxLength: 255
        description:
          type: string
          description: Description of the target.
          maxLength: 255
        related_uploader_configs:
          type: array
          items:
            type: integer
          description: List of logs uploader configs that use this target.
        status:
          allOf:
            - $ref: '#/components/schemas/LogsUploaderValidationResponse'
            - type: object
              description: >-
                Validation status of the logs uploader target. Informs if the
                specified target is reachable.
        config:
          description: Config for specific storage type.
          oneOf:
            - $ref: '#/components/schemas/S3GcoreConfigResponse'
            - $ref: '#/components/schemas/S3AmazonConfigResponse'
            - $ref: '#/components/schemas/S3OSSConfigResponse'
            - $ref: '#/components/schemas/S3OtherConfigResponse'
            - $ref: '#/components/schemas/S3V1ConfigResponse'
            - $ref: '#/components/schemas/FTPConfigResponse'
            - $ref: '#/components/schemas/SFTPConfigResponse'
            - $ref: '#/components/schemas/HTTPConfigResponse'
            - $ref: '#/components/schemas/AzureBlobConfigResponse'
    S3GcoreConfig:
      title: S3 Gcore Config
      allOf:
        - $ref: '#/components/schemas/BaseS3Config'
        - type: object
          properties:
            endpoint:
              type: string
            use_path_style:
              type: boolean
              default: true
          required:
            - access_key_id
            - secret_access_key
            - bucket_name
            - endpoint
            - region
    S3AmazonConfig:
      title: S3 Amazon Config
      allOf:
        - $ref: '#/components/schemas/BaseS3Config'
        - type: object
          required:
            - access_key_id
            - secret_access_key
            - bucket_name
            - region
    S3OSSConfig:
      title: S3 OSS Config
      allOf:
        - $ref: '#/components/schemas/BaseS3Config'
        - type: object
          properties:
            region:
              type: string
              nullable: true
            endpoint:
              type: string
              nullable: true
          required:
            - access_key_id
            - secret_access_key
            - bucket_name
    S3OtherConfig:
      title: S3 Other Config
      allOf:
        - $ref: '#/components/schemas/S3GcoreConfig'
        - type: object
          properties:
            use_path_style:
              type: boolean
              default: false
    S3V1Config:
      title: S3 V1 Config
      allOf:
        - $ref: '#/components/schemas/S3OtherConfig'
    FTPConfig:
      title: FTP Config
      allOf:
        - $ref: '#/components/schemas/BaseFTPConfig'
        - type: object
          properties:
            password:
              type: string
          required:
            - user
            - password
            - hostname
    SFTPConfig:
      title: SFTP Config
      allOf:
        - $ref: '#/components/schemas/BaseFTPConfig'
        - type: object
          properties:
            password:
              type: string
              nullable: true
            private_key:
              type: string
              nullable: true
            key_passphrase:
              type: string
              nullable: true
          required:
            - user
            - hostname
    HTTPConfig:
      title: HTTP Config
      type: object
      properties:
        upload:
          $ref: '#/components/schemas/HTTPAction'
          type: object
        append:
          allOf:
            - type: object
              nullable: true
            - $ref: '#/components/schemas/HTTPAction'
        retry:
          allOf:
            - type: object
              nullable: true
            - $ref: '#/components/schemas/HTTPAction'
        auth:
          allOf:
            - type: object
              nullable: true
            - $ref: '#/components/schemas/HTTPAuth'
        content_type:
          type: string
          enum:
            - json
            - text
          default: text
      required:
        - upload
    AzureBlobConfig:
      title: Azure Blob Config
      allOf:
        - $ref: '#/components/schemas/BaseAzureBlobConfig'
        - type: object
          properties:
            auth:
              $ref: '#/components/schemas/AzureBlobAuthConfig'
          required:
            - container_name
            - account_name
            - auth
    LogsUploaderValidationResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - in_progress
            - successful
            - failed
          description: Status of the validation.
        code:
          type: integer
          description: Error code indicating the type of validation error.
        updated:
          type: string
          format: date-time
          description: Time when the validation status was updated.
        details:
          type: string
          description: Error message if the validation failed.
    S3GcoreConfigResponse:
      title: S3 Gcore Config
      properties:
        access_key_id:
          type: string
        region:
          type: string
        bucket_name:
          type: string
        directory:
          type: string
          nullable: true
        endpoint:
          type: string
        use_path_style:
          type: boolean
    S3AmazonConfigResponse:
      title: S3 Amazon Config
      properties:
        access_key_id:
          type: string
        region:
          type: string
        bucket_name:
          type: string
        directory:
          type: string
          nullable: true
    S3OSSConfigResponse:
      title: S3 OSS Config
      allOf:
        - $ref: '#/components/schemas/S3AmazonConfigResponse'
        - type: object
          properties:
            region:
              type: string
              nullable: true
            endpoint:
              type: string
              nullable: true
    S3OtherConfigResponse:
      title: S3 Other Config
      allOf:
        - $ref: '#/components/schemas/S3GcoreConfigResponse'
    S3V1ConfigResponse:
      title: S3 V1 Config
      allOf:
        - $ref: '#/components/schemas/S3GcoreConfigResponse'
    FTPConfigResponse:
      title: FTP Config
      allOf:
        - $ref: '#/components/schemas/BaseFTPConfig'
    SFTPConfigResponse:
      title: SFTP Config
      allOf:
        - $ref: '#/components/schemas/SFTPConfig'
    HTTPConfigResponse:
      title: HTTP Config
      type: object
      properties:
        upload:
          $ref: '#/components/schemas/BaseHTTPAction'
          type: object
        append:
          $ref: '#/components/schemas/BaseHTTPAction'
          type: object
        retry:
          $ref: '#/components/schemas/BaseHTTPAction'
          type: object
        auth:
          $ref: '#/components/schemas/BaseHTTPAuth'
        content_type:
          type: string
          enum:
            - json
            - text
          default: text
    AzureBlobConfigResponse:
      title: Azure Blob Config
      allOf:
        - $ref: '#/components/schemas/BaseAzureBlobConfig'
        - type: object
          properties:
            auth:
              $ref: '#/components/schemas/AzureBlobAuthConfigResponse'
    BaseS3Config:
      type: object
      properties:
        access_key_id:
          type: string
        secret_access_key:
          type: string
        region:
          type: string
        bucket_name:
          type: string
        directory:
          type: string
          nullable: true
    BaseFTPConfig:
      type: object
      properties:
        user:
          type: string
        hostname:
          type: string
        timeout_seconds:
          type: integer
          minimum: 0
          maximum: 300
        directory:
          type: string
          nullable: true
    HTTPAction:
      allOf:
        - $ref: '#/components/schemas/BaseHTTPAction'
        - type: object
          properties:
            use_compression:
              type: boolean
              default: false
            response_actions:
              type: array
              items:
                type: object
                properties:
                  match_status_code:
                    type: integer
                    default: 0
                  match_payload:
                    type: string
                    default: ''
                  description:
                    type: string
                    default: ''
                  action:
                    type: string
                    enum:
                      - drop
                      - retry
                      - append
                required:
                  - action
          required:
            - url
    HTTPAuth:
      allOf:
        - $ref: '#/components/schemas/BaseHTTPAuth'
        - type: object
          properties:
            config:
              $ref: '#/components/schemas/HTTPAuthTokenConfig'
          required:
            - type
            - config
    BaseAzureBlobConfig:
      type: object
      properties:
        container_name:
          type: string
          description: Azure Blob Storage container name.
          maxLength: 512
        account_name:
          type: string
          description: Azure Blob Storage account name.
          maxLength: 512
        endpoint:
          type: string
          description: Custom Azure Blob Storage endpoint URL.
          nullable: true
        directory:
          type: string
          description: Directory path within the container.
          nullable: true
          maxLength: 512
    AzureBlobAuthConfig:
      type: object
      properties:
        type:
          type: string
          enum:
            - shared_key
            - sas_token
          description: Authentication type.
        config:
          type: object
          description: Authentication credentials.
          oneOf:
            - type: object
              properties:
                account_key:
                  type: string
                  description: Azure Blob Storage account key.
                  maxLength: 512
              required:
                - account_key
            - type: object
              properties:
                token:
                  type: string
                  description: Azure Blob Storage SAS token.
                  maxLength: 512
              required:
                - token
      required:
        - type
        - config
    BaseHTTPAction:
      title: HTTP Action
      type: object
      properties:
        method:
          type: string
          enum:
            - POST
            - PUT
          default: POST
        url:
          type: string
        headers:
          type: object
          additionalProperties:
            type: string
        timeout_seconds:
          type: integer
          default: 30
        use_compression:
          type: boolean
        response_actions:
          type: array
          items:
            type: object
            properties:
              match_status_code:
                type: integer
              match_payload:
                type: string
              description:
                type: string
              action:
                type: string
                enum:
                  - drop
                  - retry
                  - append
    BaseHTTPAuth:
      title: HTTP Auth
      type: object
      properties:
        type:
          type: string
          enum:
            - token
        config:
          type: object
          oneOf:
            - $ref: '#/components/schemas/BaseHTTPAuthTokenConfig'
    AzureBlobAuthConfigResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - shared_key
            - sas_token
          description: Authentication type.
        config:
          type: object
          description: Authentication credentials. Secret fields are masked with '*****'.
          oneOf:
            - type: object
              properties:
                account_key:
                  type: string
                  description: Masked secret value.
                  example: '*****'
            - type: object
              properties:
                token:
                  type: string
                  description: Masked secret value.
                  example: '*****'
      required:
        - type
        - config
    HTTPAuthTokenConfig:
      allOf:
        - $ref: '#/components/schemas/BaseHTTPAuthTokenConfig'
        - type: object
          required:
            - header_name
            - token
    BaseHTTPAuthTokenConfig:
      title: HTTP Auth Token Config
      type: object
      properties:
        header_name:
          type: string
        token:
          type: string
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234$abcdef`
      type: apiKey
      in: header
      name: Authorization

````