---
title: "Create or update a routegroup"
method: PUT
path: "/orgs/{orgName}/routegroups/{routegroupName}"
tags: ["RouteGroups"]
---

# Create or update a routegroup

`PUT /orgs/{orgName}/routegroups/{routegroupName}`

## Request

- Base URL: `https://api.signadot.com/api/v2`
- URL: `https://api.signadot.com/api/v2/orgs/{orgName}/routegroups/{routegroupName}`
- Auth: API key in header `signadot-api-key`

Creates or updates a routegroup with the provided parameters.

## Path parameters

- `orgName` string, required
- `routegroupName` string, required

## Request body

- RouteGroup
  - `createdAt` string
  - `defaults` DefaultsCompositeDefaults
    - `cluster` DefaultsDefault[]
      - `class` 'ttl'
      - `createdAt` string
      - `resourceKind` 'sandbox' | 'routegroup'
      - `updatedAt` string
      - `value` unknown
  - `endpoints` RoutegroupsEndpointURL[]
    - `cluster` string
    - `name` string
    - `target` string
    - `url` string
  - `name` string
  - `routingKey` string
  - `spec` RouteGroupSpec
    - `cluster` string: Cluster gives the cluster to which the route group applies. If left empty, this RG will become a multi-cluster RG..
    - `description` string: Description provides a short description of the route group.
    - `endpoints` RoutegroupsEndpoint[]: Endpoints define endpoints which target different in-cluster services.
      - `cluster` string
      - `name` string
      - `target` string
    - `match` RouteGroupMatch
      - `all` RouteGroupMatch[]: When All is non-nil, T matches a set of labels if and only if every element of All matches them. Only one field may be non-nil.
      - `any` RouteGroupMatch[]: When Any is non-nil, T matches a set of labels if and only if some element of Any matches them. Only one field may be non-nil.
      - `label` RouteGroupMatchLabel
        - `key` string: Key is an exact match on a label key, glob characters are just considered normal characters.
        - `value` string: Value is a glob match for the value of a sandbox label. See https://pkg.go.dev/path/filepath#Match for the file glob syntax.
    - `ttl` RouteGroupTTL
      - `duration` string: Duration represents the duration until routegroup's end of life. It should be an unsigned integer not exceeding 32 bits followed by a units character, which can be one of the following. - 'm' for minutes - 'h' for hours - 'd' for days - 'w' for weeks
      - `offsetFrom` string: OffsetFrom indicates what the Duration is relative to. It may be the empty string, "noMatchedSandboxes", "createdAt" or "updatedAt". The empty string defaults to meaning "noMatchedSandboxes".
  - `status` RouteGroupStatus
    - `matchedSandboxes` string[]: MatchedSandboxes gives the list of sandboxes whose labels were matched by the 'match' object in the spec.
    - `message` string: Message is a human readable explanation of why the sandbox is healthy or not.
    - `ready` boolean: Ready indicates whether the sandbox is ready, meaning that it can be used for testing.
    - `reason` string: Reason is a machine readable explanation of why the sandbox is healthy or not.
    - `scheduledDeleteTime` string: ScheduledDeleteTime returns the formatted and computed ttl based on the Duration and OffsetFrom
  - `updatedAt` string

## Response `200`

OK

- RouteGroup
  - `createdAt` string
  - `defaults` DefaultsCompositeDefaults
    - `cluster` DefaultsDefault[]
      - `class` 'ttl'
      - `createdAt` string
      - `resourceKind` 'sandbox' | 'routegroup'
      - `updatedAt` string
      - `value` unknown
  - `endpoints` RoutegroupsEndpointURL[]
    - `cluster` string
    - `name` string
    - `target` string
    - `url` string
  - `name` string
  - `routingKey` string
  - `spec` RouteGroupSpec
    - `cluster` string: Cluster gives the cluster to which the route group applies. If left empty, this RG will become a multi-cluster RG..
    - `description` string: Description provides a short description of the route group.
    - `endpoints` RoutegroupsEndpoint[]: Endpoints define endpoints which target different in-cluster services.
      - `cluster` string
      - `name` string
      - `target` string
    - `match` RouteGroupMatch
      - `all` RouteGroupMatch[]: When All is non-nil, T matches a set of labels if and only if every element of All matches them. Only one field may be non-nil.
      - `any` RouteGroupMatch[]: When Any is non-nil, T matches a set of labels if and only if some element of Any matches them. Only one field may be non-nil.
      - `label` RouteGroupMatchLabel
        - `key` string: Key is an exact match on a label key, glob characters are just considered normal characters.
        - `value` string: Value is a glob match for the value of a sandbox label. See https://pkg.go.dev/path/filepath#Match for the file glob syntax.
    - `ttl` RouteGroupTTL
      - `duration` string: Duration represents the duration until routegroup's end of life. It should be an unsigned integer not exceeding 32 bits followed by a units character, which can be one of the following. - 'm' for minutes - 'h' for hours - 'd' for days - 'w' for weeks
      - `offsetFrom` string: OffsetFrom indicates what the Duration is relative to. It may be the empty string, "noMatchedSandboxes", "createdAt" or "updatedAt". The empty string defaults to meaning "noMatchedSandboxes".
  - `status` RouteGroupStatus
    - `matchedSandboxes` string[]: MatchedSandboxes gives the list of sandboxes whose labels were matched by the 'match' object in the spec.
    - `message` string: Message is a human readable explanation of why the sandbox is healthy or not.
    - `ready` boolean: Ready indicates whether the sandbox is ready, meaning that it can be used for testing.
    - `reason` string: Reason is a machine readable explanation of why the sandbox is healthy or not.
    - `scheduledDeleteTime` string: ScheduledDeleteTime returns the formatted and computed ttl based on the Duration and OffsetFrom
  - `updatedAt` string

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `502`: Bad Gateway

## Changes

- **2022-12-21** `5793f7a118f7`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/signadot/apis/signadot-api/changes/orgs/:orgName/routegroups/:routegroupName/put.md)

---

[API](https://skmtc.dev/signadot/apis/signadot-api.md) - [All operations](https://skmtc.dev/signadot/apis/signadot-api/llms.txt) - [OpenAPI document](https://skmtc.dev/signadot/apis/signadot-api/revisions/5e80b0f9c718?raw)
