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

# Create an API path

> Create an API path for a domain



## OpenAPI

````yaml /api-reference/services_documented/waap_api.yaml post /waap/v1/domains/{domain_id}/api-paths
openapi: 3.1.0
info:
  title: Gcore OpenAPI – WAAP 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-14T07:00:22.640261+00:00'
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: WAAP Service
    x-displayName: WAAP Service
  - name: Domains
    x-displayName: Domains
  - name: Policies
    x-displayName: Policies
  - name: Analytics
    x-displayName: Analytics
  - name: Custom Page Sets
    x-displayName: Custom Page Sets
  - name: Custom Rules
    x-displayName: Custom Rules
  - name: Filter Templates
    x-displayName: Filter Templates
  - name: Firewall Rules
    x-displayName: Firewall Rules
  - name: Advanced Rules
    x-displayName: Advanced Rules
  - name: Tags
    x-displayName: Tags
  - name: Network Organizations
    x-displayName: Network Organizations
  - name: API Discovery
    x-displayName: API Discovery
  - name: IP Spotlight
    x-displayName: IP Spotlight
  - name: Security Insights
    x-displayName: Security Insights
  - name: IP Reputation
    x-displayName: IP Reputation
paths:
  /waap/v1/domains/{domain_id}/api-paths:
    post:
      tags:
        - API Discovery
      summary: Create an API path
      description: Create an API path for a domain
      operationId: create_api_path_v1_domains__domain_id__api_paths_post
      parameters:
        - name: domain_id
          in: path
          required: true
          schema:
            type: integer
            exclusiveMinimum: 0
            description: The domain ID
            title: Domain Id
          description: The domain ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateApiPath'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiPathResponse'
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                type: http-bad-request
                title: Bad Request
                status: 400
                detail: 'Invalid domain name: '''''''''
          description: Bad Request
        '401':
          description: Feature check fail
          content:
            application/problem+json:
              example:
                title: Feature check fail
                type: feature-check
                status: 401
                detail: >-
                  This feature is not available under your current plan. Please
                  upgrade your plan to access this feature.
        '403':
          description: Unauthenticated
          content:
            application/problem+json:
              example:
                detail: Permission denied
        '404':
          description: Resource not found
          content:
            application/problem+json:
              example:
                title: Resource not found
                type: quota-check-no-resource
                status: 404
                detail: >-
                  The quota resource requested does not exist. Cannot enable
                  WAAP for this domain. Please reach out to our support team.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/APICompositeError'
              example:
                type: request-validation-failed
                title: Request validation error.
                status: 422
                detail: One or more fields have validation errors.
                errors:
                  - loc:
                      - body
                      - name
                    detail: Input should be a valid string
                  - loc:
                      - body
                      - date
                    detail: Field required
                  - loc:
                      - query
                      - limit
                    detail: Field required
          description: Unprocessable Entity
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                type: internal-server-error
                title: Internal server error.
                status: 500
                detail: >-
                  An unexpected condition was encountered which prevented the
                  server from fulfilling the request.
          description: Internal Server Error
      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
            )
            waap_api_path = client.waap.domains.api_paths.create(
                domain_id=1,
                http_scheme="HTTP",
                method="GET",
                path="/api/v1/paths/{path_id}",
            )
            print(waap_api_path.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/waap\"\n)\n\nfunc main() {\n\tclient := gcore.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\twaapAPIPath, err := client.Waap.Domains.APIPaths.New(\n\t\tcontext.TODO(),\n\t\t1,\n\t\twaap.DomainAPIPathNewParams{\n\t\t\tHTTPScheme: waap.DomainAPIPathNewParamsHTTPSchemeHTTP,\n\t\t\tMethod:     waap.DomainAPIPathNewParamsMethodGet,\n\t\t\tPath:       \"/api/v1/paths/{path_id}\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", waapAPIPath.ID)\n}\n"
components:
  schemas:
    CreateApiPath:
      properties:
        path:
          type: string
          maxLength: 1024
          title: Path
          description: >-
            The API path, locations that are saved for resource IDs will be put
            in curly brackets
          example: /api/v1/paths/{path_id}
          examples:
            - /api/v1/paths/{path_id}
        method:
          $ref: '#/components/schemas/ApiPathMethod'
        http_scheme:
          $ref: '#/components/schemas/ApiPathHttpScheme'
        api_version:
          type: string
          maxLength: 32
          title: Api Version
          example: v1
          examples:
            - v1
        tags:
          items:
            type: string
            maxLength: 50
            pattern: ^[a-zA-Z]+[ a-zA-Z0-9]*$
            description: >-
              A user defined tag. Tags must start with a letter and can contain
              only letters, numbers and spaces.
          type: array
          maxItems: 5
          title: Tags
          example:
            - sensitivedataurl
            - highriskurl
          examples:
            - - sensitivedataurl
              - highriskurl
        api_groups:
          items:
            type: string
          type: array
          title: Api Groups
          example:
            - accounts
            - internal
          examples:
            - - accounts
              - internal
      type: object
      required:
        - path
        - method
        - http_scheme
      title: CreateApiPath
      description: Request model for creating an API path
    ApiPathResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: The path ID
        path:
          type: string
          maxLength: 1024
          title: Path
          description: >-
            The API path, locations that are saved for resource IDs will be put
            in curly brackets
          example: /api/v1/paths/{path_id}
          examples:
            - /api/v1/paths/{path_id}
        method:
          $ref: '#/components/schemas/ApiPathMethod'
          description: The API RESTful method
        api_version:
          type: string
          maxLength: 32
          title: Api Version
          description: The API version
          example: v1
          examples:
            - v1
        http_scheme:
          $ref: '#/components/schemas/ApiPathHttpScheme'
          description: The HTTP version of the API path
        first_detected:
          type: string
          format: date-time
          title: First Detected
          description: >-
            The date and time in ISO 8601 format the API path was first
            detected.
        last_detected:
          type: string
          format: date-time
          title: Last Detected
          description: The date and time in ISO 8601 format the API path was last detected.
        tags:
          items:
            type: string
            maxLength: 50
            pattern: ^[a-zA-Z]+[ a-zA-Z0-9]*$
            description: >-
              A user defined tag. Tags must start with a letter and can contain
              only letters, numbers and spaces.
          type: array
          maxItems: 5
          title: Tags
          description: An array of tags associated with the API path
          example:
            - sensitivedataurl
            - highriskurl
          examples:
            - - sensitivedataurl
              - highriskurl
        api_groups:
          items:
            type: string
          type: array
          title: Api Groups
          description: An array of api groups associated with the API path
          example:
            - accounts
            - internal
          examples:
            - - accounts
              - internal
        status:
          $ref: '#/components/schemas/ApiPathStatus'
          description: The status of the discovered API path
        source:
          $ref: '#/components/schemas/ApiPathSource'
          description: The source of the discovered API
        request_count:
          type: integer
          title: Request Count
          description: The number of requests for this path in the last 24 hours
      type: object
      required:
        - id
        - path
        - method
        - api_version
        - http_scheme
        - first_detected
        - last_detected
        - tags
        - api_groups
        - status
        - source
        - request_count
      title: ApiPathResponse
      description: Response model for the API path
    APIError:
      properties:
        type:
          type: string
          title: Type
          description: A URI identifier that categorizes the type of error.
        title:
          type: string
          title: Title
          description: A brief, human-readable title for the error.
        status:
          type: integer
          title: Status
          description: The HTTP status code applicable to this error.
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          description: A detailed human-readable explanation of the error.
      type: object
      required:
        - type
        - title
        - status
        - detail
      title: APIError
    APICompositeError:
      properties:
        type:
          type: string
          title: Type
          description: A URI identifier that categorizes the type of error.
        title:
          type: string
          title: Title
          description: A brief, human-readable title for the error.
        status:
          type: integer
          title: Status
          description: The HTTP status code applicable to this error.
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          description: A detailed human-readable explanation of the error.
        errors:
          items:
            $ref: '#/components/schemas/APIFieldError'
          type: array
          title: Errors
          description: A list of detailed errors for individual fields.
      type: object
      required:
        - type
        - title
        - status
        - detail
        - errors
      title: APICompositeError
    ApiPathMethod:
      type: string
      enum:
        - GET
        - POST
        - PUT
        - PATCH
        - DELETE
        - TRACE
        - HEAD
        - OPTIONS
      title: ApiPathMethod
      description: The different methods an API path can have
    ApiPathHttpScheme:
      type: string
      enum:
        - HTTP
        - HTTPS
      title: ApiPathHttpScheme
      description: The different HTTP schemes an API path can have
    ApiPathStatus:
      type: string
      enum:
        - CONFIRMED_API
        - POTENTIAL_API
        - NOT_API
        - DELISTED_API
      title: ApiPathStatus
      description: The different statuses an API path can have
    ApiPathSource:
      type: string
      enum:
        - API_DESCRIPTION_FILE
        - TRAFFIC_SCAN
        - USER_DEFINED
      title: ApiPathSource
      description: The different sources an API path can have
    APIFieldError:
      properties:
        loc:
          anyOf:
            - items:
                anyOf:
                  - type: integer
                  - type: string
              type: array
            - {}
          title: Loc
          description: The location of the field or a character number causing the error.
        detail:
          type: string
          title: Detail
          description: A human-readable message describing the error.
      type: object
      required:
        - loc
        - detail
      title: APIFieldError
  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

````