---
title: "Add route to service"
method: POST
path: "/v1/kong-admin/services/{serviceId}/routes"
tags: ["Kong Admin Controller"]
---

# Add route to service

`POST /v1/kong-admin/services/{serviceId}/routes`

## Request

- Base URL: `http://api.floik.com`
- URL: `http://api.floik.com/v1/kong-admin/services/{serviceId}/routes`
- Auth: none declared
- TypeScript: <https://skmtc.dev/floik/apis/floik-authentication-server/docs/v1/kong-admin/services/:serviceId/routes/post.ts> (a function with typed inputs; its response is checked against the schema)

Adds a new route to an existing service

## Path parameters

- `serviceId` string, required

## Request body

- Route
  - `id` string
  - `name` string
  - `protocols` string[]
  - `methods` string[]
  - `hosts` string[]
  - `paths` string[]
  - `headers` object
  - `tags` string[]
  - `service` Service
    - `id` string
    - `name` string
    - `retries` integer
    - `protocol` string
    - `host` string
    - `port` integer
    - `path` string
    - `tags` string[]
    - `enabled` boolean
    - `created_at` integer
    - `updated_at` integer
    - `connect_timeout` integer
    - `write_timeout` integer
    - `read_timeout` integer
    - `client_certificate` ClientCertificate
      - `id` string
    - `tls_verify` boolean
    - `tls_verify_depth` object
    - `ca_certificates` string[]
  - `snis` string[]
  - `sources` object[]
  - `destinations` object[]
  - `regex_priority` integer
  - `strip_path` boolean
  - `preserve_host` boolean
  - `created_at` integer
  - `updated_at` integer
  - `response_buffering` boolean
  - `request_buffering` boolean
  - `https_redirect_status_code` integer
  - `path_handling` string

## Response `200`

Route added successfully

- Route
  - `id` string
  - `name` string
  - `protocols` string[]
  - `methods` string[]
  - `hosts` string[]
  - `paths` string[]
  - `headers` object
  - `tags` string[]
  - `service` Service
    - `id` string
    - `name` string
    - `retries` integer
    - `protocol` string
    - `host` string
    - `port` integer
    - `path` string
    - `tags` string[]
    - `enabled` boolean
    - `created_at` integer
    - `updated_at` integer
    - `connect_timeout` integer
    - `write_timeout` integer
    - `read_timeout` integer
    - `client_certificate` ClientCertificate
      - `id` string
    - `tls_verify` boolean
    - `tls_verify_depth` object
    - `ca_certificates` string[]
  - `snis` string[]
  - `sources` object[]
  - `destinations` object[]
  - `regex_priority` integer
  - `strip_path` boolean
  - `preserve_host` boolean
  - `created_at` integer
  - `updated_at` integer
  - `response_buffering` boolean
  - `request_buffering` boolean
  - `https_redirect_status_code` integer
  - `path_handling` string

## Other responses

- `404`: Service not found
- `500`: Internal server error

---

[API](https://skmtc.dev/floik/apis/floik-authentication-server.md) - [All operations](https://skmtc.dev/floik/apis/floik-authentication-server/llms.txt) - [OpenAPI document](https://skmtc.dev/floik/apis/floik-authentication-server/revisions/2b2a5dad2f5e?raw)
