> ## 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.

# Update profile

> Update profile. Protection policies are updated at the same time as profile updated



## OpenAPI

````yaml /api-reference/services_documented/ddos_protection_api.yaml put /security/iaas/v2/profiles/{id}
openapi: 3.1.0
info:
  title: Gcore OpenAPI – DDoS Protection 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: Event Logs
    x-displayName: Event Logs
  - name: BGP announces
    x-displayName: BGP announces
  - name: Protected Networks
    x-displayName: Protected Networks
  - name: Protection Profiles
    x-displayName: Protection Profiles
  - name: Protection Templates
    x-displayName: Protection Templates
  - name: Security Templates
    x-displayName: Security Templates
  - name: Profiles
    x-displayName: Profiles
paths:
  /security/iaas/v2/profiles/{id}:
    put:
      tags:
        - Profiles
      summary: Update profile
      description: >-
        Update profile. Protection policies are updated at the same time as
        profile updated
      operationId: v2_profiles_update
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClientUpdateProfileTemplate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ClientUpdateProfileTemplate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ClientUpdateProfileTemplate'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientProfileReadV2'
          description: ''
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Profile not found
      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
            )
            client_profile = client.security.profiles.replace(
                id=0,
                fields=[{
                    "base_field": 1
                }],
                profile_template=1,
            )
            print(client_profile.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/option\"\n\t\"github.com/G-Core/gcore-go/security\"\n)\n\nfunc main() {\n\tclient := gcore.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tclientProfile, err := client.Security.Profiles.Replace(\n\t\tcontext.TODO(),\n\t\t0,\n\t\tsecurity.ProfileReplaceParams{\n\t\t\tFields: []security.ProfileReplaceParamsField{{\n\t\t\t\tBaseField: 1,\n\t\t\t}},\n\t\t\tProfileTemplate: 1,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", clientProfile.ID)\n}\n"
components:
  schemas:
    ClientUpdateProfileTemplate:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        profile_template:
          type: integer
          example: 1
          examples:
            - 1
            - 2
        ip_address:
          type: string
          maxLength: 50
          description: Required for Universal template only. Optional for all others.
        fields:
          type: array
          items:
            $ref: '#/components/schemas/ClientProfileField'
          writeOnly: true
        site:
          type: string
          description: Region where the protection profiles will be deployed
          example: ED
          examples:
            - ED
            - DC3
      required:
        - fields
        - id
        - profile_template
    ClientProfileReadV2:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        profile_template:
          $ref: '#/components/schemas/ClientProfileTemplate'
        ip_address:
          type: string
          example: 10.32.5.12
          examples:
            - 10.32.5.12
            - 195.23.43.64
          maxLength: 50
        fields:
          type: array
          items:
            $ref: '#/components/schemas/ClientProfileField'
          readOnly: true
        site:
          type: string
          description: Region where the protection profiles will be deployed
          example: ED
          examples:
            - ED
            - DC3
        options:
          allOf:
            - $ref: '#/components/schemas/ProfileV1Options'
          readOnly: true
        protocols:
          type: array
          items:
            type: object
            additionalProperties: {}
          readOnly: true
        status:
          type: object
          additionalProperties: {}
          readOnly: true
        plan:
          type: string
          readOnly: true
      required:
        - fields
        - id
        - options
        - plan
        - profile_template
        - protocols
        - site
        - status
    ClientProfileField:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          readOnly: true
        description:
          type: string
          readOnly: true
        field_type:
          type: string
          readOnly: true
        required:
          type: boolean
          readOnly: true
        default:
          type: string
          readOnly: true
        field_value:
          anyOf:
            - type: string
            - type: number
            - type: integer
            - type: boolean
            - type: object
            - type: array
          additionalProperties: {}
          nullable: true
          examples:
            - - 12
              - 54
              - 43
            - key: value
            - value
        base_field:
          type: integer
          example: 1
          examples:
            - 1
            - 2
        validation_schema:
          type: object
          additionalProperties: {}
          readOnly: true
      required:
        - base_field
        - default
        - description
        - field_type
        - id
        - name
        - required
        - validation_schema
    ClientProfileTemplate:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 100
        description:
          type: string
        fields:
          type: array
          items:
            $ref: '#/components/schemas/ClientProfileTemplateField'
          readOnly: true
        base_template:
          type: integer
          nullable: true
        version:
          type: string
          format: uuid
          readOnly: true
        created:
          type: string
          format: date-time
          readOnly: true
        template_sifter:
          type: string
          nullable: true
      required:
        - created
        - fields
        - id
        - name
        - version
    ProfileV1Options:
      type: object
      properties:
        bgp:
          type: boolean
        active:
          type: boolean
        price:
          type: string
          format: decimal
          pattern: ^-?\d{0,6}(?:\.\d{0,2})?$
          readOnly: true
      required:
        - active
        - bgp
        - price
    ClientProfileTemplateField:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 30
        description:
          type: string
          maxLength: 255
        field_type:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/FieldTypeEnum'
            - $ref: '#/components/schemas/NullEnum'
        required:
          type: boolean
        default:
          type: string
          nullable: true
          maxLength: 100
        validation_schema:
          type: object
          additionalProperties: {}
      required:
        - id
        - name
    FieldTypeEnum:
      enum:
        - int
        - bool
        - str
      type: string
      description: |-
        - `int` - Int
        - `bool` - Bool
        - `str` - Str
    NullEnum:
      enum:
        - null
  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

````