---
title: "Add a target to a service descriptor"
method: POST
path: "/api/services/{serviceId}/targets"
tags: ["services"]
---

# Add a target to a service descriptor

`POST /api/services/{serviceId}/targets`

Add a target to a service descriptor

## Path parameters

- `serviceId` string, required

## Request body

- Target — A Target is where an HTTP call will be forwarded in the end from a service domain
  - `host` string, hostname, required — The host on which the HTTP call will be forwarded. Can be a domain name, or an IP address. Can also have a port
  - `scheme` string, required — The protocol used for communication. Can be http or https

## Response `200`

Successful operation

- Target[]
  - `host` string, hostname, required — The host on which the HTTP call will be forwarded. Can be a domain name, or an IP address. Can also have a port
  - `scheme` string, required — The protocol used for communication. Can be http or https

## Other responses

- `400` — Bad resource format. Take another look to the swagger, or open an issue :)
- `401` — You have to provide an Api Key. Api Key can be passed with 'Otoroshi-Client-Id' and 'Otoroshi-Client-Secret' headers, or use basic http authentication
- `404` — Resource not found or does not exist

---

[API](https://skmtc.net/maif/apis/otoroshi.md) · [All operations](https://skmtc.net/maif/apis/otoroshi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/maif/otoroshi/versions/276881687271/schema)
