---
title: "Create a new Target associated with an Upstream"
url: "https://nov18-dev.movespot.fyi/apis/konnect-runtime-groups-configuration-0/versions/af18902c-58f1-49d7-8ec2-9987b4e0d1bd/operations/create-target-for-upstream"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/konnect-runtime-groups-configuration-0/versions/af18902c-58f1-49d7-8ec2-9987b4e0d1bd.md

# Create a new Target associated with an Upstream

`POST` `/runtime-groups/{runtimeGroupId}/core-entities/upstreams/{upstream_id}/targets`

Operation ID: `create-target-for-upstream`

Create a new Target associated with an Upstream

## Path parameters

- `runtimeGroupId` (string, required) - The ID of your runtime group. This variable is available in the Konnect manager
- `upstream_id` (string, required) - ID or name of the related Upstream

## Request body

Content types: `application/json`

## Responses

- `200` - Successfully created Target
- `400` - Invalid Target

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Konnect Runtime Groups Configuration
  version: 0.0.1
servers:
  - url: https://us.api.konghq.com/v2
    description: United-States Production region
  - url: https://eu.api.konghq.com/v2
    description: Europe Production region
  - url: https://au.api.konghq.com/v2
    description: Australia Production region
  - url: https://me.api.konghq.com/v2
    description: Middle-East Production region
  - url: https://in.api.konghq.com/v2
    description: India Production region
  - url: https://sg.api.konghq.com/v2
    description: Singapore Production region
paths:
  /runtime-groups/{runtimeGroupId}/core-entities/upstreams/{upstream_id}/targets:
    parameters:
      - $ref: "#/components/parameters/upstream_id"
      - $ref: "#/components/parameters/runtimeGroupId"
    post:
      operationId: create-target-for-upstream
      summary: Create a new Target associated with an Upstream
      description: Create a new Target associated with an Upstream
      parameters:
        - name: upstream_id
          in: path
          description: ID or name of the related Upstream
          required: true
          schema:
            type: string
      requestBody:
        $ref: "#/components/requestBodies/target-request"
      responses:
        "200":
          description: Successfully created Target
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Target"
              examples:
                Successfully created Target:
                  value:
                    id: 173a6cee-90d1-40a7-89cf-0329eca780a6
                    created_at: 1422386534
                    upstream:
                      id: bdab0e47-4e37-4f0b-8fd0-87d95cc4addc
                    target: example.com:8000
                    weight: 100
                    tags:
                      - user-level
                      - low-priority
        "400":
          description: Invalid Target
          content:
            application/json:
              schema:
                type: object
      tags:
        - Targets
security:
  - konnectAccessToken: []
  - personalAccessToken: []
components:
  parameters:
    upstream_id:
      name: upstream_id
      in: path
      required: true
      schema:
        type: string
        example: 7fca84d6-7d37-4a74-a7b0-93e576089a41
      description: The unique identifier of the Upstream associated to the Certificate
        to be retrieved.
    runtimeGroupId:
      name: runtimeGroupId
      in: path
      required: true
      schema:
        type: string
        example: 9524ec7d-36d9-465d-a8c5-83a3c9390458
      description: The ID of your runtime group. This variable is available in the
        Konnect manager
  requestBodies:
    target-request:
      content:
        application/json:
          schema:
            type: object
            properties:
              upstream:
                description: >
                  The unique identifier or the name of the upstream for which to
                  update the target.
                type: object
                properties:
                  id:
                    description: The unique identifier or the name of the upstream for which to
                      update the target.
                    type: string
                    example: 173a6cee-90d1-40a7-89cf-0329eca780a6
              weight:
                description: The weight this target gets within the upstream loadbalancer
                  (`0`-`65535`). If the hostname resolves to an SRV record, the
                  `weight` value will be overridden by the value from the DNS
                  record.
                type: integer
                default: 100
                maximum: 65535
                minimum: 0
              tags:
                description: An optional set of strings associated with the Target for grouping
                  and filtering.
                type: array
                items:
                  type: string
              target:
                description: The target IP address
                type: string
                example: 192.158.1.38
            x-examples:
              Example 1:
                upstream:
                  id: bdab0e47-4e37-4f0b-8fd0-87d95cc4addc
                target: example.com:8000
                weight: 100
                tags:
                  - user-level
                  - low-priority
          examples:
            Example:
              value:
                upstream:
                  id: fe335516-b679-44e5-8bf0-f9af0524e230
                target: 192.158.1.38
                weight: 100
                tags:
                  - string
  schemas:
    Target:
      description: A target is an ip address/hostname with a port that identifies an
        instance of a backend service. Every upstream can have many targets, and
        the targets can be dynamically added, modified, or deleted. Changes take
        effect on the fly. To disable a target, post a new one with `weight=0`;
        alternatively, use the `DELETE` convenience method to accomplish the
        same. The current target object definition is the one with the latest
        `created_at`.
      type: object
      properties:
        created_at:
          description: Unix epoch when the resource was created.
          type: number
          example: 1422386534
        updated_at:
          description: Unix epoch when the resource was last updated.
          type: integer
          example: 1422386534
        id:
          description: The unique identifier or the name of the upstream for which to
            update the target.
          type: string
          example: 173a6cee-90d1-40a7-89cf-0329eca780a6
        tags:
          description: An optional set of strings associated with the Target for grouping
            and filtering.
          type: array
          items:
            type: string
        target:
          description: The target address (ip or hostname) and port. If the hostname
            resolves to an SRV record, the `port` value will be overridden by
            the value from the DNS record.
          type: string
        upstream:
          description: The unique identifier or the name of the upstream for which to
            update the target.
          type: object
          additionalProperties: false
          properties:
            id:
              type: string
              example: bdab0e47-4e37-4f0b-8fd0-87d95cc4addc
        weight:
          description: The weight this target gets within the upstream loadbalancer
            (`0`-`65535`). If the hostname resolves to an SRV record, the
            `weight` value will be overridden by the value from the DNS record.
          type: integer
          example: 100
          default: 100
      example:
        id: 089292a7-ba3d-4d88-acf0-97b4b2e2621a
        target: 203.0.113.42
        upstream:
          id: 5f1d7e76-2fed-4806-a6af-869984f025cb
        weight: 100
      x-examples:
        Example 1:
          created_at: 1685645663
          id: 1da9dd7e-24a2-4a82-9826-5147ed76f804
          tags:
            - string
          target: 122.158.1.38:8000
          updated_at: 1685645663
          upstream:
            id: fe335516-b679-44e5-8bf0-f9af0524e230
          weight: 100
  securitySchemes:
    konnectAccessToken:
      type: http
      scheme: bearer
      description: >-
        The Konnect access token is meant to be used by the Konnect dashboard
        and the decK CLI to

        authenticate with.
    personalAccessToken:
      type: http
      scheme: bearer
      description: The personal access token is meant to be used as an alternative to
        basic-auth when accessing Konnect via APIs. You can generate a Personal
        Access Token (PAT) from the personal access token page in the Konnect
        dashboard.
```
