---
title: "Create a custom service"
method: POST
path: "/sites/{id}/services"
tags: ["Services"]
---

# Create a custom service

`POST /sites/{id}/services`

## Request

- Base URL: `http://localhost:3001/api/v1`
- URL: `http://localhost:3001/api/v1/sites/{id}/services`
- Auth: HTTP bearer

Creates a custom service with optional cookies for tracking scripts not in the library.

## Path parameters

- `id` string, uuid, required: Site ID

## Request body

- object
  - `slug` string, required
  - `label` string, required
  - `description` string
  - `labelTranslations` object
  - `descriptionTranslations` object
  - `categorySlug` string, required
  - `serviceUrl` string, uri
  - `cookies` object[]
    - `name` string, required
    - `duration` string, required
    - `description` string
    - `descriptionTranslations` object

## Response `201`

Service created

- object
  - `service` object, required
    - `id` string, uuid, required
    - `slug` string, required
    - `label` string, required
    - `categoryId` string, uuid, required
  - `cookiesCreated` number, required

## Other responses

- `400`: Validation error or category not found
- `401`: Unauthorized
- `404`: Site not found
- `409`: Service slug already exists on site

---

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